Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
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", | ||
] | ||
); |