mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 12:19:15 +00:00
fix(parser): parse import source from from 'mod' (#8056)
This commit is contained in:
parent
8b025e36db
commit
be2c60dd10
3 changed files with 4 additions and 17 deletions
|
|
@ -60,9 +60,7 @@ impl<'a> ParserImpl<'a> {
|
|||
let mut phase = None;
|
||||
match self.cur_kind() {
|
||||
Kind::Source => {
|
||||
let peek_kind = self.peek_kind();
|
||||
// Allow `import source from 'mod'`
|
||||
if peek_kind.is_binding_identifier() && peek_kind != Kind::From {
|
||||
if self.peek_kind().is_binding_identifier() && self.nth_kind(2) == Kind::From {
|
||||
self.bump_any();
|
||||
phase = Some(ImportPhase::Source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,9 @@
|
|||
commit: c4317b0c
|
||||
|
||||
parser_test262 Summary:
|
||||
AST Parsed : 44100/44101 (100.00%)
|
||||
Positive Passed: 44100/44101 (100.00%)
|
||||
AST Parsed : 44101/44101 (100.00%)
|
||||
Positive Passed: 44101/44101 (100.00%)
|
||||
Negative Passed: 4454/4454 (100.00%)
|
||||
Expect to Parse: tasks/coverage/test262/test/language/module-code/source-phase-import/import-source-binding-name-2.js
|
||||
|
||||
× Unexpected token
|
||||
╭─[test262/test/language/module-code/source-phase-import/import-source-binding-name-2.js:23:20]
|
||||
22 │ import source source from '<do not resolve>';
|
||||
23 │ import source from from '<do not resolve>';
|
||||
· ────
|
||||
╰────
|
||||
|
||||
× '0'-prefixed octal literals and octal escape sequences are deprecated
|
||||
╭─[test262/test/annexB/language/expressions/template-literal/legacy-octal-escape-sequence-strict.js:19:4]
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ commit: c4317b0c
|
|||
|
||||
semantic_test262 Summary:
|
||||
AST Parsed : 44101/44101 (100.00%)
|
||||
Positive Passed: 43582/44101 (98.82%)
|
||||
Positive Passed: 43583/44101 (98.83%)
|
||||
tasks/coverage/test262/test/annexB/language/function-code/if-decl-else-decl-a-func-block-scoping.js
|
||||
semantic error: Symbol scope ID mismatch for "f":
|
||||
after transform: SymbolId(3): ScopeId(4294967294)
|
||||
|
|
@ -3633,9 +3633,6 @@ Unresolved references mismatch:
|
|||
after transform: ["$DONE", "Object", "assert", "require"]
|
||||
rebuilt : ["$DONE", "Object", "_superprop_getMethod", "assert", "require"]
|
||||
|
||||
tasks/coverage/test262/test/language/module-code/source-phase-import/import-source-binding-name-2.js
|
||||
semantic error: Unexpected token
|
||||
|
||||
tasks/coverage/test262/test/language/module-code/top-level-await/syntax/for-await-await-expr-func-expression.js
|
||||
semantic error: Scope children mismatch:
|
||||
after transform: ScopeId(14): [ScopeId(1)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue