Skip to content

Commit

Permalink
Remove some misc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed May 1, 2021
1 parent 54eec7e commit 9c3965e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 370 deletions.
264 changes: 22 additions & 242 deletions tests/format/misc/errors/js/async-await/__snapshots__/jsfmt.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ exports[`snippet: #0 [babel] format 1`] = `
`;

exports[`snippet: #0 [babel] format 2`] = `
"'await' is not allowed in async function parameters. (1:12)
> 1 | async (x = await (2)) => {};
| ^"
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await 5 ** 6;
| ^"
`;

exports[`snippet: #0 [babel] format 3`] = `
"await is not allowed in async function parameters (1:12)
"'await' is not allowed in async function parameters. (1:12)
> 1 | async (x = await (2)) => {};
| ^"
`;
Expand Down Expand Up @@ -79,12 +79,9 @@ exports[`snippet: #1 [babel] format 1`] = `
`;

exports[`snippet: #1 [babel] format 2`] = `
"Unexpected reserved word 'await' (2:3)
1 | function foo() {
> 2 | await
| ^
3 | foo;
4 | }"
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await -5 ** 6;
| ^"
`;

exports[`snippet: #1 [espree] format 1`] = `
Expand Down Expand Up @@ -118,313 +115,96 @@ exports[`snippet: #1 [meriyah] format 2`] = `
`;

exports[`snippet: #2 [babel] format 1`] = `
"'await' is only allowed within async functions (1:25)
> 1 | function foo(promise) { await promise; }
| ^"
`;

exports[`snippet: #2 [babel] format 2`] = `
"Unexpected reserved word 'await' (1:25)
> 1 | function foo(promise) { await (promise); }
| ^"
`;

exports[`snippet: #2 [espree] format 1`] = `
"Cannot use keyword 'await' outside an async function (1:25)
> 1 | function foo(promise) { await promise; }
| ^"
`;

exports[`snippet: #2 [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:31)
> 1 | function foo(promise) { await promise; }
| ^^^^^^^"
`;

exports[`snippet: #2 [meriyah] format 1`] = `
"[1:29]: 'Await' may not be used as an identifier in this context (1:29)
> 1 | function foo(promise) { await promise; }
| ^"
`;

exports[`snippet: #3 [babel] format 1`] = `
"'await' is only allowed within async functions (2:10)
1 | function a() {
> 2 | return await 1
| ^
3 | }"
`;

exports[`snippet: #3 [babel] format 2`] = `
"Unexpected reserved word 'await' (2:10)
1 | function a() {
> 2 | return await (1)
| ^
3 | }"
`;

exports[`snippet: #3 [espree] format 1`] = `
"Cannot use keyword 'await' outside an async function (2:10)
1 | function a() {
> 2 | return await 1
| ^
3 | }"
`;

exports[`snippet: #3 [flow] format 1`] = `
"Unexpected number, expected the token \`;\` (2:16)
1 | function a() {
> 2 | return await 1
| ^
3 | }"
`;

exports[`snippet: #3 [meriyah] format 1`] = `
"[2:14]: 'Await' may not be used as an identifier in this context (2:14)
1 | function a() {
> 2 | return await 1
| ^
3 | }"
`;

exports[`snippet: #4 [babel] format 1`] = `
"'await' is only allowed within async functions (1:9)
> 1 | () => { await x };
| ^"
`;

exports[`snippet: #4 [babel] format 2`] = `
"Unexpected reserved word 'await' (1:9)
> 1 | () => { await (x) };
| ^"
`;

exports[`snippet: #4 [espree] format 1`] = `
"Cannot use keyword 'await' outside an async function (1:9)
> 1 | () => { await x };
| ^"
`;

exports[`snippet: #4 [flow] format 1`] = `
"Unexpected identifier, expected the end of an expression statement (\`;\`) (1:15)
> 1 | () => { await x };
| ^"
`;

exports[`snippet: #4 [meriyah] format 1`] = `
"[1:13]: 'Await' may not be used as an identifier in this context (1:13)
> 1 | () => { await x };
| ^"
`;

exports[`snippet: #5 [babel] format 1`] = `
"Unexpected reserved word 'await' (1:37)
> 1 | C = class { static { function f() { await } } };
| ^"
`;

exports[`snippet: #5 [babel] format 2`] = `
"Unexpected reserved word 'await' (2:3)
1 | function foo() {
> 2 | await
| ^
3 | (foo);
4 | }"
`;

exports[`snippet: #5 [espree] format 1`] = `
"Unexpected token { (1:20)
> 1 | C = class { static { function f() { await } } };
| ^"
`;
exports[`snippet: #5 [flow] format 1`] = `
"Unexpected token \`{\`, expected an identifier (1:20)
> 1 | C = class { static { function f() { await } } };
| ^"
`;
exports[`snippet: #5 [meriyah] format 1`] = `
"[1:20]: Unexpected token: '{' (1:20)
> 1 | C = class { static { function f() { await } } };
| ^"
`;
exports[`snippet: #6 [babel] format 1`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await 5 ** 6;
| ^"
`;
exports[`snippet: #6 [babel] format 2`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await 5 ** 6;
| ^"
`;
exports[`snippet: #6 [espree] format 1`] = `
"Unexpected token { (1:20)
> 1 | C = class { static { function f(await) {} } };
| ^"
`;
exports[`snippet: #6 [flow] format 1`] = `
"Unexpected token \`{\`, expected an identifier (1:20)
> 1 | C = class { static { function f(await) {} } };
| ^"
`;
exports[`snippet: #6 [meriyah] format 1`] = `
"[1:20]: Unexpected token: '{' (1:20)
> 1 | C = class { static { function f(await) {} } };
| ^"
`;
exports[`snippet: #7 [babel] format 1`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await -5 ** 6;
| ^"
`;
exports[`snippet: #7 [babel] format 2`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await -5 ** 6;
| ^"
`;
exports[`snippet: #7 [espree] format 1`] = `
"Unexpected token { (1:20)
> 1 | C = class { static { function f(x = await) {} } };
| ^"
`;
exports[`snippet: #7 [flow] format 1`] = `
"Unexpected token \`{\`, expected an identifier (1:20)
> 1 | C = class { static { function f(x = await) {} } };
| ^"
`;
exports[`snippet: #7 [meriyah] format 1`] = `
"[1:20]: Unexpected token: '{' (1:20)
> 1 | C = class { static { function f(x = await) {} } };
| ^"
`;
exports[`snippet: #8 [babel] format 1`] = `
"Unexpected reserved word 'await' (1:36)
> 1 | C = class { static { function f({ [await]: x }) {} } };
| ^"
`;
exports[`snippet: #8 [espree] format 1`] = `
"Unexpected token { (1:20)
> 1 | C = class { static { function f({ [await]: x }) {} } };
| ^"
`;
exports[`snippet: #8 [flow] format 1`] = `
"Unexpected token \`{\`, expected an identifier (1:20)
> 1 | C = class { static { function f({ [await]: x }) {} } };
| ^"
`;
exports[`snippet: #8 [meriyah] format 1`] = `
"[1:20]: Unexpected token: '{' (1:20)
> 1 | C = class { static { function f({ [await]: x }) {} } };
| ^"
`;
exports[`snippet: #9 [babel] format 1`] = `
"Unexpected token (1:27)
> 1 | f = async (a) => await a! ** 6;
| ^"
`;

exports[`snippet: #9 [espree] format 1`] = `
exports[`snippet: #2 [espree] format 1`] = `
"Unexpected token ! (1:25)
> 1 | f = async (a) => await a! ** 6;
| ^"
`;

exports[`snippet: #9 [flow] format 1`] = `
exports[`snippet: #2 [flow] format 1`] = `
"Unexpected token \`!\`, expected the end of an expression statement (\`;\`) (1:25)
> 1 | f = async (a) => await a! ** 6;
| ^"
`;

exports[`snippet: #9 [meriyah] format 1`] = `
exports[`snippet: #2 [meriyah] format 1`] = `
"[1:25]: Unexpected token: '!' (1:25)
> 1 | f = async (a) => await a! ** 6;
| ^"
`;

exports[`snippet: #10 [babel] format 1`] = `
exports[`snippet: #3 [babel] format 1`] = `
"Unexpected token (1:16)
> 1 | f = (a) => +a! ** 6;
| ^"
`;

exports[`snippet: #10 [espree] format 1`] = `
exports[`snippet: #3 [espree] format 1`] = `
"Unexpected token ! (1:14)
> 1 | f = (a) => +a! ** 6;
| ^"
`;

exports[`snippet: #10 [flow] format 1`] = `
exports[`snippet: #3 [flow] format 1`] = `
"Unexpected token \`!\`, expected the end of an expression statement (\`;\`) (1:14)
> 1 | f = (a) => +a! ** 6;
| ^"
`;

exports[`snippet: #10 [meriyah] format 1`] = `
exports[`snippet: #3 [meriyah] format 1`] = `
"[1:14]: Unexpected token: '!' (1:14)
> 1 | f = (a) => +a! ** 6;
| ^"
`;

exports[`snippet: #11 [babel] format 1`] = `
exports[`snippet: #4 [babel] format 1`] = `
"Unexpected token, expected \\",\\" (1:22)
> 1 | async (a) => (await a!) ** 6;
| ^"
`;

exports[`snippet: #11 [espree] format 1`] = `
exports[`snippet: #4 [espree] format 1`] = `
"Unexpected token ! (1:22)
> 1 | async (a) => (await a!) ** 6;
| ^"
`;

exports[`snippet: #11 [flow] format 1`] = `
exports[`snippet: #4 [flow] format 1`] = `
"Unexpected token \`!\`, expected the token \`)\` (1:22)
> 1 | async (a) => (await a!) ** 6;
| ^"
`;

exports[`snippet: #11 [meriyah] format 1`] = `
exports[`snippet: #4 [meriyah] format 1`] = `
"[1:22]: Expected ')' (1:22)
> 1 | async (a) => (await a!) ** 6;
| ^"
`;

exports[`snippet: #12 [babel] format 1`] = `
exports[`snippet: #5 [babel] format 1`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:3)
> 1 | (-+5 ** 6);
| ^"
`;

exports[`snippet: #12 [espree] format 1`] = `
exports[`snippet: #5 [espree] format 1`] = `
"Unexpected token ** (1:6)
> 1 | (-+5 ** 6);
| ^"
`;

exports[`snippet: #12 [flow] format 1`] = `
exports[`snippet: #5 [flow] format 1`] = `
"Invalid left-hand side in exponentiation expression (1:2)
> 1 | (-+5 ** 6);
| ^^^"
`;

exports[`snippet: #12 [meriyah] format 1`] = `
exports[`snippet: #5 [meriyah] format 1`] = `
"[1:7]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:7)
> 1 | (-+5 ** 6);
| ^"
Expand Down

0 comments on commit 9c3965e

Please sign in to comment.