Update meriyah to v4.2.0 (#11194)

This commit is contained in:
fisker Cheung authored and GitHub committed 2021-07-12 14:45:33 +08:00
1 parent fceaab3e84
commit 10053999d7
6 files changed
+87 -103

No files matched your search

+1 -1
View File
@@ -59,7 +59,7 @@
"linguist-languages": "7.15.0",
"lodash": "4.17.21",
"mem": "8.1.1",
"meriyah": "4.1.5",
"meriyah": "4.2.0",
"minimatch": "3.0.4",
"minimist": "1.2.5",
"n-readlines": "1.0.1",
@@ -1,12 +1,5 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`example.js [meriyah] format 1`] = `
"[1:5]: 'Await' may not be used as an identifier in this context (1:5)
> 1 | await something();
| ^
2 |"
`;
exports[`example.js format 1`] = `
====================================options=====================================
parsers: ["babel", "typescript"]
@@ -1,3 +1 @@
run_spec(__dirname, ["babel", "typescript"], {
errors: { meriyah: true },
});
run_spec(__dirname, ["babel", "typescript"]);
@@ -9,12 +9,6 @@ exports[`snippet: #0 [babel] format 1`] = `
`;
exports[`snippet: #0 [babel] format 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)
> 1 | async (x = await (2)) => {};
| ^"
@@ -43,57 +37,25 @@ exports[`snippet: #0 [flow] format 1`] = `
`;
exports[`snippet: #0 [meriyah] format 1`] = `
"[2:24]: 'Await' may not be used as an identifier in this context (2:24)
"[2:24]: Await is only valid in async functions (2:24)
1 | async function foo() {
> 2 | function bar(x = await 2) {}
| ^
3 | }"
`;
exports[`snippet: #0 [meriyah] format 2`] = `
"[1:16]: 'Await' may not be used as an identifier in this context (1:16)
> 1 | async (x = await (2)) => {};
| ^"
`;
exports[`snippet: #0 [meriyah] format 3`] = `
"[2:11]: 'Await' may not be used as an identifier in this context (2:11)
1 | export class C {
> 2 | p = await 0;
| ^
3 | }"
`;
exports[`snippet: #1 [babel] format 1`] = `
"'await' is not allowed in async function parameters. (1:12)
> 1 | async (x = await 2) => {};
| ^"
`;
exports[`snippet: #1 [babel] format 2`] = `
"Illegal expression. Wrap left hand side or entire exponentiation in parentheses. (1:23)
> 1 | f = async () => await -5 ** 6;
| ^"
`;
exports[`snippet: #1 [babel] format 3`] = `
"Unexpected token (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;
exports[`snippet: #1 [espree] format 1`] = `
"Await expression cannot be a default value (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 [flow] format 1`] = `
"Unexpected number, expected the token \`,\` (1:18)
> 1 | async (x = await 2) => {};
@@ -101,21 +63,9 @@ exports[`snippet: #1 [flow] format 1`] = `
`;
exports[`snippet: #1 [meriyah] format 1`] = `
"[1:16]: 'Await' may not be used as an identifier in this context (1:16)
"[1:22]: Await expression not allowed in formal parameter (1:22)
> 1 | async (x = await 2) => {};
| ^"
`;
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;
| ^"
| ^"
`;
exports[`snippet: #2 [babel] format 1`] = `
@@ -213,3 +163,75 @@ exports[`snippet: #5 [meriyah] format 1`] = `
> 1 | (-+5 ** 6);
| ^"
`;
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 [espree] format 1`] = `
"Unexpected token ** (1:25)
> 1 | f = async () => await 5 ** 6;
| ^"
`;
exports[`snippet: #6 [flow] format 1`] = `
"Invalid left-hand side in exponentiation expression (1:17)
> 1 | f = async () => await 5 ** 6;
| ^^^^^^^"
`;
exports[`snippet: #6 [meriyah] format 1`] = `
"[1:26]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:26)
> 1 | f = async () => await 5 ** 6;
| ^"
`;
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 [espree] format 1`] = `
"Unexpected token ** (1:26)
> 1 | f = async () => await -5 ** 6;
| ^"
`;
exports[`snippet: #7 [flow] format 1`] = `
"Invalid left-hand side in exponentiation expression (1:17)
> 1 | f = async () => await -5 ** 6;
| ^^^^^^^^"
`;
exports[`snippet: #7 [meriyah] format 1`] = `
"[1:27]: Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:27)
> 1 | f = async () => await -5 ** 6;
| ^"
`;
exports[`snippet: #8 [babel] format 1`] = `
"Unexpected token (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;
exports[`snippet: #8 [espree] format 1`] = `
"Shorthand property assignments are valid only in destructuring patterns (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;
exports[`snippet: #8 [flow] format 1`] = `
"Unexpected token \`=\` (1:15)
> 1 | async({ foo33 = 1 });
| ^"
`;
exports[`snippet: #8 [meriyah] format 1`] = `
"[1:21]: Invalid shorthand property initializer (1:21)
> 1 | async({ foo33 = 1 });
| ^"
`;
@@ -14,13 +14,9 @@ run_spec(
"f = (a) => +a! ** 6;",
"async (a) => (await a!) ** 6;",
"(-+5 ** 6);",
// TODO: Test these two edge case
// outdent`
// export class C {
// p = await (0);
// }
// `,
// "await (0);"
"f = async () => await 5 ** 6;",
"f = async () => await -5 ** 6;",
"async({ foo33 = 1 });",
],
},
["babel", "espree", "meriyah", "flow"]
@@ -30,34 +26,9 @@ run_spec(
{
dirname: __dirname,
snippets: [
// `espree` and `meriyah` didn't throw
"f = async () => await 5 ** 6;",
// `espree` didn't throw
"f = async () => await -5 ** 6;",
// `flow` and `meriyah` didn't throw
"async (x = await (2)) => {};",
],
},
["babel"]
);
run_spec(
{
dirname: __dirname,
snippets: ["async (x = await (2)) => {};", "async({ foo33 = 1 });"],
},
["babel", "espree", "meriyah"]
);
run_spec(
{
dirname: __dirname,
snippets: [
outdent`
export class C {
p = await 0;
}
`,
"await 0;",
],
},
["meriyah"]
["babel", "espree"]
);
+4 -4
View File
@@ -4808,10 +4808,10 @@ merge2@^1.3.0:
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
meriyah@4.1.5:
version "4.1.5"
resolved "https://registry.yarnpkg.com/meriyah/-/meriyah-4.1.5.tgz#0352d4ad2ef9c459413d8c9530129edc2569dd85"
integrity sha512-ptw5umwiQILhfIGKO99NIY3Y2/jhEyEPIwSFwKLBQdXnN/6606rQoHyF4WK+2WiUmvFbBbTVMo4Q+po30xVjtg==
meriyah@4.2.0:
version "4.2.0"
resolved "https://registry.yarnpkg.com/meriyah/-/meriyah-4.2.0.tgz#29d28c37ac7b67f8b9aaa92df0b8ac12469fe98b"
integrity sha512-fCVh5GB9YT53Bq14l00HLYE3i9DywrY0JVZxbk0clXWDuMsUKKwluvC5sY0bMBqHbnIbpIjfSSIsnrzbauA8Yw==
micromatch@^4.0.2, micromatch@^4.0.4:
version "4.0.4"