diff --git a/crates/oxc_semantic/src/checker/javascript.rs b/crates/oxc_semantic/src/checker/javascript.rs index 820a07eed..787cbf057 100644 --- a/crates/oxc_semantic/src/checker/javascript.rs +++ b/crates/oxc_semantic/src/checker/javascript.rs @@ -44,9 +44,6 @@ impl EarlyErrorJavaScript { AstKind::Directive(dir) => check_directive(dir, node, ctx), AstKind::ModuleDeclaration(decl) => { check_module_declaration(decl, node, ctx); - if let ModuleDeclaration::ImportDeclaration(import_decl) = decl { - check_import_declaration(import_decl, ctx); - } } AstKind::MetaProperty(prop) => check_meta_property(prop, node, ctx), @@ -447,13 +444,6 @@ fn check_module_declaration<'a>( } } -fn check_import_declaration(decl: &ImportDeclaration, ctx: &SemanticBuilder<'_>) { - // ModuleItem : ImportDeclaration - // It is a Syntax Error if the BoundNames of ImportDeclaration contains any duplicate entries. - // bound_names are usually small, a simple loop should be more performant checking with a hashmap - check_duplicate_bound_names(decl, ctx); -} - fn check_meta_property<'a>(prop: &MetaProperty, node: &AstNode<'a>, ctx: &SemanticBuilder<'a>) { #[derive(Debug, Error, Diagnostic)] #[error("Unexpected new.target expression")] diff --git a/tasks/coverage/parser_test262.snap b/tasks/coverage/parser_test262.snap index f0063e7a5..9a96b9b68 100644 --- a/tasks/coverage/parser_test262.snap +++ b/tasks/coverage/parser_test262.snap @@ -17970,15 +17970,6 @@ Expect Syntax Error: "language/import/import-attributes/json-named-bindings.js" × Identifier `x` has already been declared ╭─[language/import/dup-bound-names.js:15:1] 15 │ - 16 │ import { x, y as x } from 'z'; - · ┬ ┬ - · │ ╰── It can not be redeclared here - · ╰── `x` has already been declared here - ╰──── - - × Identifier `x` has already been declared - ╭─[language/import/dup-bound-names.js:15:1] - 15 │ 16 │ import { x, y as x } from 'z'; · ┬ ┬ · │ ╰── It can not be redeclared here