Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build(deps): Bump @babel/parser from 7.13.13 to 7.13.15 (#10682)
* Build(deps): Bump @babel/parser from 7.13.13 to 7.13.15 Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.13.13 to 7.13.15. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.15/packages/babel-parser) Signed-off-by: dependabot[bot] <support@github.com> * Add test for babel/babel#13099 * Test babel/babel#13049 * Test babel/babel#13101 * Add long name test * Style * Print necessary parens in `{ a: (b as any) = 2000 }` Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: fisker Cheung <lionkay@gmail.com> Co-authored-by: Georgii Dolzhykov <thorn.mailbox@gmail.com>
- Loading branch information
1 parent
62b9c63
commit 147c30f
Showing
12 changed files
with
241 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
109 changes: 109 additions & 0 deletions
109
tests/misc/errors/js/for-of/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`snippet: #0 [babel] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #0 [babel-flow] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #0 [babel-ts] format 1`] = ` | ||
"The left-hand side of a for-of loop may not start with 'let'. (1:6) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #0 [flow] format 1`] = ` | ||
"Unexpected token \`.\`, expected an identifier (1:9) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #0 [meriyah] format 1`] = ` | ||
"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #0 [typescript] format 1`] = ` | ||
"Variable declaration expected. (1:9) | ||
> 1 | for (let.foo of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [babel] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [babel-flow] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [babel-ts] format 1`] = ` | ||
"The left-hand side of a for-of loop may not start with 'let'. (1:6) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [flow] format 1`] = ` | ||
"Unexpected token \`(\`, expected an identifier (1:9) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [meriyah] format 1`] = ` | ||
"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #1 [typescript] format 1`] = ` | ||
"Variable declaration expected. (1:9) | ||
> 1 | for (let().bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #2 [babel] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #2 [babel-flow] format 1`] = ` | ||
"Unexpected reserved word 'let' (1:6) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #2 [babel-ts] format 1`] = ` | ||
"The left-hand side of a for-of loop may not start with 'let'. (1:6) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #2 [flow] format 1`] = ` | ||
"Unexpected template literal part, expected an identifier (1:9) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^^" | ||
`; | ||
|
||
exports[`snippet: #2 [meriyah] format 1`] = ` | ||
"[1:10]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^" | ||
`; | ||
|
||
exports[`snippet: #2 [typescript] format 1`] = ` | ||
"Variable declaration expected. (1:9) | ||
> 1 | for (let\`\`.bar of []); | ||
| ^" | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
run_spec( | ||
{ | ||
dirname: __dirname, | ||
snippets: [ | ||
"for (let.foo of []);", | ||
"for (let().bar of []);", | ||
"for (let``.bar of []);", | ||
], | ||
}, | ||
[ | ||
"babel", | ||
// Espree didn't throw https://github.com/acornjs/acorn/issues/1009 | ||
// "espree", | ||
"meriyah", | ||
"flow", | ||
"typescript", | ||
"babel-flow", | ||
"babel-ts", | ||
] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,11 @@ | ||
run_spec(__dirname, ["babel-ts"]); | ||
run_spec( | ||
{ | ||
dirname: __dirname, | ||
snippets: [ | ||
"foo as any = 10;", | ||
"({ a: b as any = 2000 } = x);", | ||
"<string>foo = '100';", | ||
], | ||
}, | ||
["babel-ts"] | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
(a as number) = 42; | ||
({ a: (b as any) = 2000 } = x); |
58 changes: 58 additions & 0 deletions
58
tests/typescript/declare/trailing-comma/__snapshots__/jsfmt.spec.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`function-rest-trailing-comma.ts - {"trailingComma":"all"} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
trailingComma: "all" | ||
| printWidth | ||
=====================================input====================================== | ||
declare function foo(...args: any[], ) | ||
declare function foo(...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[], ) | ||
=====================================output===================================== | ||
declare function foo(...args: any[]); | ||
declare function foo( | ||
...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[] | ||
); | ||
================================================================================ | ||
`; | ||
|
||
exports[`function-rest-trailing-comma.ts - {"trailingComma":"es5"} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
trailingComma: "es5" | ||
| printWidth | ||
=====================================input====================================== | ||
declare function foo(...args: any[], ) | ||
declare function foo(...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[], ) | ||
=====================================output===================================== | ||
declare function foo(...args: any[]); | ||
declare function foo( | ||
...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[] | ||
); | ||
================================================================================ | ||
`; | ||
|
||
exports[`function-rest-trailing-comma.ts - {"trailingComma":"none"} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["typescript"] | ||
printWidth: 80 | ||
trailingComma: "none" | ||
| printWidth | ||
=====================================input====================================== | ||
declare function foo(...args: any[], ) | ||
declare function foo(...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[], ) | ||
=====================================output===================================== | ||
declare function foo(...args: any[]); | ||
declare function foo( | ||
...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[] | ||
); | ||
================================================================================ | ||
`; |
2 changes: 2 additions & 0 deletions
2
tests/typescript/declare/trailing-comma/function-rest-trailing-comma.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
declare function foo(...args: any[], ) | ||
declare function foo(...long_long_long_long_long_long_long_long_long_long_long_long_long_long_long_args: any[], ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
run_spec(__dirname, ["typescript"], { trailingComma: "es5" }); | ||
run_spec(__dirname, ["typescript"], { trailingComma: "none" }); | ||
run_spec(__dirname, ["typescript"], { trailingComma: "all" }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters