Remove duplicated location info in error message from meriyah parser (#12307)
This commit is contained in:
1 parent
f21d18aab9
commit
da7eb9aa60
49 files changed
+167
-154
No files matched your search
@@ -61,13 +61,13 @@ exports[`snippet: #0 [flow] format 2`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:8]: Expected '(' (1:8)
|
||||
"Expected '(' (1:8)
|
||||
> 1 | for each (a in b) {}
|
||||
| ^"
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 2`] = `
|
||||
"[1:9]: Invalid left-hand side in assignment (1:9)
|
||||
"Invalid left-hand side in assignment (1:9)
|
||||
> 1 | (a = b) = 1
|
||||
| ^"
|
||||
`;
|
||||
@@ -139,13 +139,13 @@ exports[`snippet: #1 [flow] format 2`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:12]: Unexpected strict mode reserved word (1:12)
|
||||
"Unexpected strict mode reserved word (1:12)
|
||||
> 1 | class switch() {}
|
||||
| ^"
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 2`] = `
|
||||
"[1:7]: Invalid left-hand side in assignment (1:7)
|
||||
"Invalid left-hand side in assignment (1:7)
|
||||
> 1 | a = 1 = 2
|
||||
| ^"
|
||||
`;
|
||||
@@ -181,7 +181,7 @@ exports[`snippet: #2 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:9]: Invalid left-hand side in assignment (1:9)
|
||||
"Invalid left-hand side in assignment (1:9)
|
||||
> 1 | (a = 1) = 2
|
||||
| ^"
|
||||
`;
|
||||
@@ -211,7 +211,7 @@ exports[`snippet: #3 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #3 [meriyah] format 1`] = `
|
||||
"[1:10]: Invalid left-hand side in assignment (1:10)
|
||||
"Invalid left-hand side in assignment (1:10)
|
||||
> 1 | (a += b) = 1
|
||||
| ^"
|
||||
`;
|
||||
@@ -241,7 +241,7 @@ exports[`snippet: #4 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #4 [meriyah] format 1`] = `
|
||||
"[1:10]: Invalid left-hand side in assignment (1:10)
|
||||
"Invalid left-hand side in assignment (1:10)
|
||||
> 1 | (a = b) += 1
|
||||
| ^"
|
||||
`;
|
||||
@@ -25,7 +25,7 @@ exports[`snippet: #0 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:6]: Invalid left-hand side in assignment (1:6)
|
||||
"Invalid left-hand side in assignment (1:6)
|
||||
> 1 | ({}) = x;
|
||||
| ^"
|
||||
`;
|
||||
@@ -51,7 +51,7 @@ exports[`snippet: #0 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[2:24]: Await is only valid in async functions (2:24)
|
||||
"Await is only valid in async functions (2:24)
|
||||
1 | async function foo() {
|
||||
> 2 | function bar(x = await 2) {}
|
||||
| ^
|
||||
@@ -83,7 +83,7 @@ exports[`snippet: #1 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:22]: Await expression not allowed in formal parameter (1:22)
|
||||
"Await expression not allowed in formal parameter (1:22)
|
||||
> 1 | async (x = await 2) => {};
|
||||
| ^"
|
||||
`;
|
||||
@@ -113,7 +113,7 @@ exports[`snippet: #2 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:25]: Unexpected token: '!' (1:25)
|
||||
"Unexpected token: '!' (1:25)
|
||||
> 1 | f = async (a) => await a! ** 6;
|
||||
| ^"
|
||||
`;
|
||||
@@ -143,7 +143,7 @@ exports[`snippet: #3 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #3 [meriyah] format 1`] = `
|
||||
"[1:14]: Unexpected token: '!' (1:14)
|
||||
"Unexpected token: '!' (1:14)
|
||||
> 1 | f = (a) => +a! ** 6;
|
||||
| ^"
|
||||
`;
|
||||
@@ -173,7 +173,7 @@ exports[`snippet: #4 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #4 [meriyah] format 1`] = `
|
||||
"[1:22]: Expected ')' (1:22)
|
||||
"Expected ')' (1:22)
|
||||
> 1 | async (a) => (await a!) ** 6;
|
||||
| ^"
|
||||
`;
|
||||
@@ -203,7 +203,7 @@ exports[`snippet: #5 [flow] 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)
|
||||
"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:7)
|
||||
> 1 | (-+5 ** 6);
|
||||
| ^"
|
||||
`;
|
||||
@@ -233,7 +233,7 @@ exports[`snippet: #6 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
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)
|
||||
"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:26)
|
||||
> 1 | f = async () => await 5 ** 6;
|
||||
| ^"
|
||||
`;
|
||||
@@ -263,7 +263,7 @@ exports[`snippet: #7 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
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)
|
||||
"Unary expressions as the left operand of an exponentiation expression must be disambiguated with parentheses (1:27)
|
||||
> 1 | f = async () => await -5 ** 6;
|
||||
| ^"
|
||||
`;
|
||||
@@ -293,7 +293,7 @@ exports[`snippet: #8 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #8 [meriyah] format 1`] = `
|
||||
"[1:21]: Invalid shorthand property initializer (1:21)
|
||||
"Invalid shorthand property initializer (1:21)
|
||||
> 1 | async({ foo33 = 1 });
|
||||
| ^"
|
||||
`;
|
||||
@@ -55,7 +55,7 @@ exports[`snippet: #0 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
|
||||
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
|
||||
> 1 | for (let.foo of []);
|
||||
| ^"
|
||||
`;
|
||||
@@ -91,7 +91,7 @@ exports[`snippet: #1 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:9]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
|
||||
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:9)
|
||||
> 1 | for (let().bar of []);
|
||||
| ^"
|
||||
`;
|
||||
@@ -127,7 +127,7 @@ exports[`snippet: #2 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:10]: Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10)
|
||||
"Identifier \\"let\\" disallowed as left-hand side expression in strict mode (1:10)
|
||||
> 1 | for (let\`\`.bar of []);
|
||||
| ^"
|
||||
`;
|
||||
|
||||
@@ -37,7 +37,7 @@ exports[`snippet: #0 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:8]: Unexpected token: ')' (1:8)
|
||||
"Unexpected token: ')' (1:8)
|
||||
> 1 | import();
|
||||
| ^"
|
||||
`;
|
||||
@@ -85,7 +85,7 @@ exports[`snippet: #1 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:21]: Unexpected token: ')' (1:21)
|
||||
"Unexpected token: ')' (1:21)
|
||||
> 1 | import(/* comment */);
|
||||
| ^"
|
||||
`;
|
||||
@@ -133,7 +133,7 @@ exports[`snippet: #2 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:11]: Cannot use new with import(...) (1:11)
|
||||
"Cannot use new with import(...) (1:11)
|
||||
> 1 | new import('./a.mjs');
|
||||
| ^"
|
||||
`;
|
||||
@@ -181,7 +181,7 @@ exports[`snippet: #3 [flow] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #3 [meriyah] format 1`] = `
|
||||
"[1:11]: Cannot use new with import(...) (1:11)
|
||||
"Cannot use new with import(...) (1:11)
|
||||
> 1 | new import();
|
||||
| ^"
|
||||
`;
|
||||
|
||||
@@ -22,7 +22,7 @@ exports[`invalid-exponent.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`invalid-exponent.js [meriyah] format 1`] = `
|
||||
"[1:5]: Non-number found after exponent indicator (1:5)
|
||||
"Non-number found after exponent indicator (1:5)
|
||||
> 1 | 12.3e
|
||||
| ^
|
||||
2 |"
|
||||
|
||||
@@ -28,7 +28,7 @@ exports[`getter-generator.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`getter-generator.js [meriyah] format 1`] = `
|
||||
"[2:9]: A getter cannot be a generator (2:9)
|
||||
"A getter cannot be a generator (2:9)
|
||||
1 | ({
|
||||
> 2 | get *iterator() { },
|
||||
| ^
|
||||
@@ -58,7 +58,7 @@ exports[`getter-with-parameter.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`getter-with-parameter.js [meriyah] format 1`] = `
|
||||
"[1:10]: Getter functions must have exactly no arguments (1:10)
|
||||
"Getter functions must have exactly no arguments (1:10)
|
||||
> 1 | ({ get x(a){} });
|
||||
| ^
|
||||
2 |"
|
||||
@@ -92,7 +92,7 @@ exports[`setter-generator.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`setter-generator.js [meriyah] format 1`] = `
|
||||
"[2:9]: A getter cannot be a generator (2:9)
|
||||
"A getter cannot be a generator (2:9)
|
||||
1 | ({
|
||||
> 2 | set *iterator(iter) { },
|
||||
| ^
|
||||
@@ -122,7 +122,7 @@ exports[`setter-without-parameter.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`setter-without-parameter.js [meriyah] format 1`] = `
|
||||
"[1:10]: Setter functions must have exactly one argument (1:10)
|
||||
"Setter functions must have exactly one argument (1:10)
|
||||
> 1 | ({ set x(){} });
|
||||
| ^
|
||||
2 |"
|
||||
|
||||
@@ -19,7 +19,7 @@ exports[`snippet: #0 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:22]: Invalid optional chain from new expression (1:22)
|
||||
"Invalid optional chain from new expression (1:22)
|
||||
> 1 | const baz3 = new obj?.foo?.bar?.baz(); // baz instance
|
||||
| ^"
|
||||
`;
|
||||
@@ -43,7 +43,7 @@ exports[`snippet: #1 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:23]: Invalid optional chain from new expression (1:23)
|
||||
"Invalid optional chain from new expression (1:23)
|
||||
> 1 | const safe5 = new obj?.qux?.baz(); // undefined
|
||||
| ^"
|
||||
`;
|
||||
@@ -67,7 +67,7 @@ exports[`snippet: #2 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:23]: Invalid optional chain from new expression (1:23)
|
||||
"Invalid optional chain from new expression (1:23)
|
||||
> 1 | const safe6 = new obj?.foo.bar.qux?.(); // undefined
|
||||
| ^"
|
||||
`;
|
||||
@@ -91,7 +91,7 @@ exports[`snippet: #3 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #3 [meriyah] format 1`] = `
|
||||
"[1:27]: Invalid optional chain from new expression (1:27)
|
||||
"Invalid optional chain from new expression (1:27)
|
||||
> 1 | const willThrow = new obj?.foo.bar.qux(); // Error: not a constructor
|
||||
| ^"
|
||||
`;
|
||||
@@ -121,7 +121,7 @@ exports[`snippet: #4 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #4 [meriyah] format 1`] = `
|
||||
"[4:10]: Invalid optional chain from new expression (4:10)
|
||||
"Invalid optional chain from new expression (4:10)
|
||||
2 | class Test {
|
||||
3 | }
|
||||
> 4 | new Test?.(); // test instance
|
||||
@@ -147,7 +147,7 @@ exports[`snippet: #5 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #5 [meriyah] format 1`] = `
|
||||
"[1:12]: Invalid optional chain from new expression (1:12)
|
||||
"Invalid optional chain from new expression (1:12)
|
||||
> 1 | new exists?.(); // undefined
|
||||
| ^"
|
||||
`;
|
||||
@@ -19,7 +19,7 @@ exports[`snippet: #0 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:1]: '#' not followed by identifier (1:1)
|
||||
"'#' not followed by identifier (1:1)
|
||||
> 1 | #{a() {}}
|
||||
| ^"
|
||||
`;
|
||||
@@ -43,7 +43,7 @@ exports[`snippet: #1 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:1]: '#' not followed by identifier (1:1)
|
||||
"'#' not followed by identifier (1:1)
|
||||
> 1 | #{async b() {}}
|
||||
| ^"
|
||||
`;
|
||||
@@ -67,7 +67,7 @@ exports[`snippet: #2 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #2 [meriyah] format 1`] = `
|
||||
"[1:1]: '#' not followed by identifier (1:1)
|
||||
"'#' not followed by identifier (1:1)
|
||||
> 1 | #{get c() {}}
|
||||
| ^"
|
||||
`;
|
||||
@@ -91,7 +91,7 @@ exports[`snippet: #3 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #3 [meriyah] format 1`] = `
|
||||
"[1:1]: '#' not followed by identifier (1:1)
|
||||
"'#' not followed by identifier (1:1)
|
||||
> 1 | #{set d(_) {}}
|
||||
| ^"
|
||||
`;
|
||||
@@ -115,7 +115,7 @@ exports[`snippet: #4 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #4 [meriyah] format 1`] = `
|
||||
"[1:1]: '#' not followed by identifier (1:1)
|
||||
"'#' not followed by identifier (1:1)
|
||||
> 1 | #{*e() {}}
|
||||
| ^"
|
||||
`;
|
||||
@@ -22,7 +22,7 @@ exports[`invalid-flags.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`invalid-flags.js [meriyah] format 1`] = `
|
||||
"[1:5]: Unexpected regular expression flag (1:5)
|
||||
"Unexpected regular expression flag (1:5)
|
||||
> 1 | /a/ugv;
|
||||
| ^
|
||||
2 |"
|
||||
@@ -50,7 +50,7 @@ exports[`invalid-flags2.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`invalid-flags2.js [meriyah] format 1`] = `
|
||||
"[1:3]: Unexpected regular expression flag (1:3)
|
||||
"Unexpected regular expression flag (1:3)
|
||||
> 1 | /a/vu;
|
||||
| ^
|
||||
2 |"
|
||||
|
||||
@@ -7,7 +7,7 @@ exports[`snippet: #0 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #0 [meriyah] format 1`] = `
|
||||
"[1:15]: Unexpected strict mode reserved word (1:15)
|
||||
"Unexpected strict mode reserved word (1:15)
|
||||
> 1 | class interface {}
|
||||
| ^"
|
||||
`;
|
||||
@@ -19,7 +19,7 @@ exports[`snippet: #1 [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`snippet: #1 [meriyah] format 1`] = `
|
||||
"[1:16]: Unexpected strict mode reserved word (1:16)
|
||||
"Unexpected strict mode reserved word (1:16)
|
||||
> 1 | import interface from \\"foo\\";
|
||||
| ^"
|
||||
`;
|
||||
@@ -22,7 +22,7 @@ exports[`invalid-const.js [espree] format 1`] = `
|
||||
`;
|
||||
|
||||
exports[`invalid-const.js [meriyah] format 1`] = `
|
||||
"[1:10]: Missing initializer in const declaration (1:10)
|
||||
"Missing initializer in const declaration (1:10)
|
||||
> 1 | const foo;
|
||||
| ^
|
||||
2 |"
|
||||
|
||||
Reference in new issue
Block a user