Skip to content
Merged
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: 4 additions & 0 deletions crates/oxc_parser/src/js/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ impl<'a> ParserImpl<'a> {
None => unreachable!(),
}
} else {
if has_default_specifier {
// `import something 'source'`
self.expect_without_advance(Kind::From);
}
None
}
} else {
Expand Down
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/import-defer-without-from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import defer 'module';
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/import-from-str.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import from 'module';
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/import-source-without-from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import source 'module';
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/import-type-without-from.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import type 'module';
1 change: 1 addition & 0 deletions tasks/coverage/misc/fail/import-without-from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import unknown 'module';
1 change: 1 addition & 0 deletions tasks/coverage/misc/pass/import-from-from.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import from from 'module';
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/codegen_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
codegen_misc Summary:
AST Parsed : 49/49 (100.00%)
Positive Passed: 49/49 (100.00%)
AST Parsed : 50/50 (100.00%)
Positive Passed: 50/50 (100.00%)
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/formatter_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
formatter_misc Summary:
AST Parsed : 49/49 (100.00%)
Positive Passed: 49/49 (100.00%)
AST Parsed : 50/50 (100.00%)
Positive Passed: 50/50 (100.00%)
41 changes: 38 additions & 3 deletions 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 : 49/49 (100.00%)
Positive Passed: 49/49 (100.00%)
Negative Passed: 113/113 (100.00%)
AST Parsed : 50/50 (100.00%)
Positive Passed: 50/50 (100.00%)
Negative Passed: 118/118 (100.00%)

× Cannot assign to 'arguments' in strict mode
╭─[misc/fail/arguments-eval.ts:1:10]
Expand Down Expand Up @@ -187,13 +187,48 @@ Negative Passed: 113/113 (100.00%)
· ╰── `,` or `]` expected
╰────

× Expected `from` but found `string`
╭─[misc/fail/import-defer-without-from.js:1:14]
1 │ import defer 'module';
· ────┬───
· ╰── `from` expected
╰────

× Expected `from` but found `string`
╭─[misc/fail/import-from-str.js:1:13]
1 │ import from 'module';
· ────┬───
· ╰── `from` expected
╰────

× Expected `from` but found `Identifier`
╭─[misc/fail/import-source-non-from.js:1:19]
1 │ import source foo bar from 'module';
· ─┬─
· ╰── `from` expected
╰────

× Expected `from` but found `string`
╭─[misc/fail/import-source-without-from.js:1:15]
1 │ import source 'module';
· ────┬───
· ╰── `from` expected
╰────

× Expected `from` but found `string`
╭─[misc/fail/import-type-without-from.ts:1:13]
1 │ import type 'module';
· ────┬───
· ╰── `from` expected
╰────

× Expected `from` but found `string`
╭─[misc/fail/import-without-from.js:1:16]
1 │ import unknown 'module';
· ────┬───
· ╰── `from` expected
╰────

× Unexpected JSX expression
╭─[misc/fail/jsx-in-js.js:1:20]
1 │ export const foo = <Foo />;
Expand Down
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/semantic_misc.snap
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
semantic_misc Summary:
AST Parsed : 49/49 (100.00%)
Positive Passed: 31/49 (63.27%)
AST Parsed : 50/50 (100.00%)
Positive Passed: 32/50 (64.00%)
semantic Error: tasks/coverage/misc/pass/oxc-11593.ts
Scope children mismatch:
after transform: ScopeId(0): [ScopeId(1)]
Expand Down
4 changes: 2 additions & 2 deletions tasks/coverage/snapshots/transformer_misc.snap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
transformer_misc Summary:
AST Parsed : 49/49 (100.00%)
Positive Passed: 49/49 (100.00%)
AST Parsed : 50/50 (100.00%)
Positive Passed: 50/50 (100.00%)
Loading