New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update @babel/parser to 7.12 #9408
Changes from 10 commits
c87b672
b5308bd
7979066
b19743f
d599e72
7417d90
cf0ed63
2e42f06
6c20b0d
58cbf8b
cab1ee7
e418282
d2365f6
26ec800
9eb8275
ac9f558
71128fe
766c4cf
c06180e
b1558d1
6452008
f1182e7
226b1db
bc5251d
0fddd9a
7042f57
aaa7326
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
({ set x(){} }); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,9 @@ | ||
run_spec(__dirname, ["babel"], { | ||
errors: { espree: ["expression.js", "invalid-accessor-generator.js"] }, | ||
errors: { | ||
espree: [ | ||
"expression.js", | ||
"invalid-accessor-generator.js", | ||
"invalid-setter.js", | ||
], | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
const foo; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
run_spec(__dirname, ["babel", "flow", "typescript"]); | ||
run_spec(__dirname, ["babel", "flow", "typescript"], { | ||
errors: { | ||
espree: ["invalid-const.js"], | ||
flow: ["invalid-const.js"], | ||
}, | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`issue-8041.ts error test 1`] = ` | ||
"Did not expect a type annotation here. (1:2) | ||
> 1 | (a:b) | ||
| ^ | ||
exports[`type-annotation.ts error test 1`] = ` | ||
"Did not expect a type annotation here. (1:9) | ||
> 1 | func<T>(a: T); | ||
| ^ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why does Babel parse There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, I found babel/babel#12185 |
||
2 | " | ||
`; |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
func<T>(a: T); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,10 @@ class A { | |
} | ||
} | ||
|
||
class B { | ||
constructor<>() {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will it work if there are comments inside? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, class constructor in TypeScript does not accept type parameterss. |
||
} | ||
|
||
=====================================output===================================== | ||
class foo { | ||
constructor(static a: number) {} | ||
|
@@ -37,6 +41,10 @@ class A { | |
} | ||
} | ||
|
||
class B { | ||
constructor<>() {} | ||
} | ||
|
||
================================================================================ | ||
`; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,7 @@ class A { | |
return new A() | ||
} | ||
} | ||
|
||
class B { | ||
constructor<>() {} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
class B {p: number;} | ||
class C extends B {declare p: 256 | 1000;} | ||
class D { | ||
declare field = "field"; | ||
} | ||
declare class D { | ||
field = "field"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ declare namespace A { | |
function x(); | ||
function y(): void; | ||
} | ||
|
||
declare function f([]?) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// Invalid, but recoverable | ||
declare function foo() {} | ||
declare function bar() { | ||
// comment | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare module m { | ||
class C { | ||
field = "field"; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
declare namespace m { | ||
class C { | ||
field = "field"; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
case
isn't needed. The AST shouldn't contain such nodes.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
226b1db 👍