Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Jun 13, 2021
1 parent b060153 commit 26ece61
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Expand Up @@ -84,13 +84,25 @@ exports[`snippet: #1 [babel] format 2`] = `
| ^"
`;

exports[`snippet: #1 [babel] format 3`] = `
"Unexpected token (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;

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

exports[`snippet: #1 [espree] format 2`] = `
"Shorthand property assignments are valid only in destructuring patterns (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;

exports[`snippet: #1 [espree] format 3`] = `
"Cannot use keyword 'await' outside an async function (1:1)
> 1 | await 0;
| ^"
Expand All @@ -109,6 +121,12 @@ exports[`snippet: #1 [meriyah] format 1`] = `
`;

exports[`snippet: #1 [meriyah] format 2`] = `
"[1:21]: Invalid shorthand property initializer (1:21)
> 1 | async({ foo33 = 1 });
| ^"
`;

exports[`snippet: #1 [meriyah] format 3`] = `
"[1:5]: 'Await' may not be used as an identifier in this context (1:5)
> 1 | await 0;
| ^"
Expand Down
2 changes: 1 addition & 1 deletion tests/format/misc/errors/js/async-await/jsfmt.spec.js
Expand Up @@ -42,7 +42,7 @@ run_spec(
run_spec(
{
dirname: __dirname,
snippets: ["async (x = await (2)) => {};"],
snippets: ["async (x = await (2)) => {};", "async({ foo33 = 1 });"],
},
["babel", "espree", "meriyah"]
);
Expand Down

0 comments on commit 26ece61

Please sign in to comment.