Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/oxc_parser/src/error_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ impl<'a> ParserImpl<'a> {
// The lexer should have reported a more meaningful diagnostic
// when it is a undetermined kind.
if matches!(self.cur_kind(), Kind::Eof | Kind::Undetermined) {
if let Some(error) = self.lexer.errors.pop() {
self.set_fatal_error(error);
if let Some(error) = self.lexer.errors.last() {
self.set_fatal_error(error.clone());
return;
}
}
Expand Down
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/oxc-12816.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
if(\ ()<1){}
24 changes: 24 additions & 0 deletions tasks/coverage/snapshots/parser_babel.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ──
╰────

× Unterminated string
╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/381/input.js:1:9]
1 │ var x = "
· ──
╰────

× Identifier expected. 'if' is a reserved word that cannot be used here.
╭─[babel/packages/babel-parser/test/fixtures/core/uncategorised/382/input.js:1:5]
1 │ var if = 42
Expand Down Expand Up @@ -4664,6 +4670,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
╰────
help: Try insert a semicolon here

× Invalid Character `𫠞`
╭─[babel/packages/babel-parser/test/fixtures/es2015/uncategorised/327/input.js:1:5]
1 │ var 𫠞_ = 12;
· ──
╰────

× Invalid Character `𫠞`
╭─[babel/packages/babel-parser/test/fixtures/es2015/uncategorised/327/input.js:1:5]
1 │ var 𫠞_ = 12;
Expand Down Expand Up @@ -9669,6 +9681,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ─
╰────

× Invalid Character `🀒`
╭─[babel/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_id_smp/input.js:1:5]
1 │ var 🀒
· ─
╰────

× Invalid Unicode escape sequence
╭─[babel/packages/babel-parser/test/fixtures/esprima/es2015-identifier/invalid_lone_surrogate/input.js:1:2]
1 │ \uD800!
Expand Down Expand Up @@ -10688,6 +10706,12 @@ Expect to Parse: tasks/coverage/babel/packages/babel-parser/test/fixtures/typesc
· ──
╰────

× Unterminated string
╭─[babel/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0063/input.js:1:9]
1 │ var x = "
· ──
╰────

× Identifier expected. 'if' is a reserved word that cannot be used here.
╭─[babel/packages/babel-parser/test/fixtures/esprima/invalid-syntax/migrated_0064/input.js:1:5]
1 │ var if = 42
Expand Down
8 changes: 7 additions & 1 deletion tasks/coverage/snapshots/parser_misc.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parser_misc Summary:
AST Parsed : 48/48 (100.00%)
Positive Passed: 48/48 (100.00%)
Negative Passed: 78/78 (100.00%)
Negative Passed: 79/79 (100.00%)

× Cannot assign to 'arguments' in strict mode
╭─[misc/fail/arguments-eval.ts:1:10]
Expand Down Expand Up @@ -437,6 +437,12 @@ Negative Passed: 78/78 (100.00%)
· ──────────────────────
╰────

× Invalid Unicode escape sequence
╭─[misc/fail/oxc-12816.ts:1:5]
1 │ if(\ ()<1){}
· ─
╰────

× 'super' can only be referenced in members of derived classes or object literal expressions.
╭─[misc/fail/oxc-13284.ts:5:9]
4 │ bar() {
Expand Down
80 changes: 52 additions & 28 deletions tasks/coverage/snapshots/parser_test262.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2754,37 +2754,33 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm
· ──
╰────

× Expected `in` but found `throw`
╭─[test262/test/language/comments/hashbang/escaped-bang-041.js:20:1]
19 │
20 │ throw "Test262: This statement should not be evaluated.";
· ──┬──
· ╰── `in` expected
╰────
× Invalid Unicode escape sequence
╭─[test262/test/language/comments/hashbang/escaped-bang-041.js:1:3]
1 │ #\041
· ─
2 │
╰────

× Expected `in` but found `throw`
╭─[test262/test/language/comments/hashbang/escaped-bang-u0021.js:20:1]
19 │
20 │ throw "Test262: This statement should not be evaluated.";
· ──┬──
· ╰── `in` expected
╰────
× Invalid Character `!`
╭─[test262/test/language/comments/hashbang/escaped-bang-u0021.js:1:8]
1 │ #\u0021
· ▲
2 │
╰────

× Expected `in` but found `throw`
╭─[test262/test/language/comments/hashbang/escaped-bang-u21.js:20:1]
19 │
20 │ throw "Test262: This statement should not be evaluated.";
· ──┬──
· ╰── `in` expected
╰────
× Invalid Character `!`
╭─[test262/test/language/comments/hashbang/escaped-bang-u21.js:1:8]
1 │ #\u{21}
· ▲
2 │
╰────

× Expected `in` but found `throw`
╭─[test262/test/language/comments/hashbang/escaped-bang-x21.js:20:1]
19 │
20 │ throw "Test262: This statement should not be evaluated.";
· ──┬──
· ╰── `in` expected
╰────
× Invalid Unicode escape sequence
╭─[test262/test/language/comments/hashbang/escaped-bang-x21.js:1:3]
1 │ #\x21
· ─
2 │
╰────

× Invalid Unicode escape sequence
╭─[test262/test/language/comments/hashbang/escaped-hash-043.js:1:2]
Expand Down Expand Up @@ -21091,6 +21087,13 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm
× Invalid Character `ⸯ`
╭─[test262/test/language/identifiers/vertical-tilde-start.js:17:5]
16 │
17 │ var ⸯ; // U+2E2F
· ─
╰────

× Invalid Character `ⸯ`
╭─[test262/test/language/identifiers/vertical-tilde-start.js:17:5]
16 │
17 │ var ⸯ; // U+2E2F
· ─
╰────
Expand Down Expand Up @@ -39181,6 +39184,13 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm
× Unterminated string
╭─[test262/test/language/types/string/S8.4_A13_T2.js:16:11]
15 │
16 │ var str = ';
· ───
╰────

× Unterminated string
╭─[test262/test/language/types/string/S8.4_A13_T2.js:16:11]
15 │
16 │ var str = ';
· ───
╰────
Expand All @@ -39196,6 +39206,13 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm
× Unterminated string
╭─[test262/test/language/types/string/S8.4_A14_T1.js:16:11]
15 │
16 │ var str = ";
· ───
╰────

× Unterminated string
╭─[test262/test/language/types/string/S8.4_A14_T1.js:16:11]
15 │
16 │ var str = ";
· ───
╰────
Expand Down Expand Up @@ -39264,3 +39281,10 @@ Expect to Parse: tasks/coverage/test262/test/annexB/language/expressions/assignm
33 │ var᠎foo;
· ─
╰────

× Invalid Character `᠎`
╭─[test262/test/language/white-space/mongolian-vowel-separator.js:33:4]
32 │ // U+180E between "var" and "foo"; UTF8(0x180E) = 0xE1 0xA0 0x8E
33 │ var᠎foo;
· ─
╰────
Expand Down
33 changes: 25 additions & 8 deletions tasks/coverage/snapshots/parser_typescript.snap
Original file line number Diff line number Diff line change
Expand Up @@ -12938,6 +12938,15 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc
2 │ var es1 = "line 1
· ────────
3 │ ";
4 │ var es2 = 'line 1
╰────

× Unterminated string
╭─[typescript/tests/cases/compiler/stringLiteralsErrors.ts:2:11]
1 │ // Srtings missing line terminator
2 │ var es1 = "line 1
· ────────
3 │ ";
4 │ var es2 = 'line 1
╰────

Expand Down Expand Up @@ -18337,6 +18346,18 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc
· ──────────────────
╰────

× Unterminated string
╭─[typescript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings24.ts:1:9]
1 │ var x = "\u{00000000000067
· ──────────────────
╰────

× Unterminated string
╭─[typescript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings25.ts:1:9]
1 │ var x = "\u{00000000000067}
· ───────────────────
╰────

× Unterminated string
╭─[typescript/tests/cases/conformance/es6/unicodeExtendedEscapes/unicodeExtendedEscapesInStrings25.ts:1:9]
1 │ var x = "\u{00000000000067}
Expand Down Expand Up @@ -24214,11 +24235,9 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc
1 │ foo(a, \
╰────

× Expected `,` but found `Identifier`
╭─[typescript/tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens18.ts:1:7]
× Invalid Unicode escape sequence
╭─[typescript/tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens18.ts:1:8]
1 │ foo(a \
· ┬
· ╰── `,` expected
╰────

× Invalid Unicode escape sequence
Expand All @@ -24239,11 +24258,9 @@ Expect to Parse: tasks/coverage/typescript/tests/cases/conformance/parser/ecmasc
· ─
╰────

× Expected `,` but found `Identifier`
╭─[typescript/tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens20.ts:1:12]
× Invalid Unicode escape sequence
╭─[typescript/tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens20.ts:1:13]
1 │ var v: X<T \
· ┬
· ╰── `,` expected
╰────

× Invalid Unicode escape sequence
Expand Down
2 changes: 1 addition & 1 deletion tasks/track_memory_allocations/allocs_minifier.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ RadixUIAdoptionSection.jsx | 2.52 kB || 76 | 4 |

pdf.mjs | 567.30 kB || 19577 | 2898 || 47403 | 7782 | 1.624 MB

antd.js | 6.69 MB || 99857 | 13518 || 331723 | 70354 | 17.408 MB
antd.js | 4.12 MB || 115026 | 15149 || 275588 | 60441 | 14.716 MB

2 changes: 1 addition & 1 deletion tasks/track_memory_allocations/allocs_parser.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ RadixUIAdoptionSection.jsx | 2.52 kB || 4 | 0 |

pdf.mjs | 567.30 kB || 688 | 71 || 90678 | 8148 | 4.308 MB

antd.js | 6.69 MB || 6938 | 236 || 528505 | 55357 | 27.618 MB
antd.js | 4.12 MB || 6864 | 282 || 509752 | 55282 | 25.574 MB

binder.ts | 193.08 kB || 540 | 7 || 16807 | 1475 | 873.704 kB

Loading