diff --git a/crates/oxc_semantic/src/binder.rs b/crates/oxc_semantic/src/binder.rs index 3c32e1ac3..d475b4367 100644 --- a/crates/oxc_semantic/src/binder.rs +++ b/crates/oxc_semantic/src/binder.rs @@ -2,10 +2,10 @@ #[allow(clippy::wildcard_imports)] use oxc_ast::ast::*; -use oxc_ast::syntax_directed_operations::BoundNames; +use oxc_ast::{syntax_directed_operations::BoundNames, AstKind}; use crate::{ - scope::{ScopeFlags, ScopeId}, + scope::{Scope, ScopeFlags, ScopeId}, symbol::SymbolFlags, SemanticBuilder, }; @@ -14,21 +14,6 @@ pub trait Binder { fn bind(&self, _builder: &mut SemanticBuilder) {} } -impl<'a> Binder for Class<'a> { - fn bind(&self, builder: &mut SemanticBuilder) { - if let Some(ident) = self.id.as_ref() - && self.r#type == ClassType::ClassDeclaration && !self.modifiers.contains(ModifierKind::Declare) { - builder.declare_symbol( - &ident.name, - ident.span, - builder.scope.current_scope_id, - SymbolFlags::Class , - SymbolFlags::ClassExcludes, - ); - } - } -} - impl<'a> Binder for VariableDeclarator<'a> { fn bind(&self, builder: &mut SemanticBuilder) { let current_scope_id = builder.scope.current_scope_id; @@ -75,6 +60,83 @@ impl<'a> Binder for VariableDeclarator<'a> { } } +impl<'a> Binder for Class<'a> { + fn bind(&self, builder: &mut SemanticBuilder) { + if let Some(ident) = &self.id + && self.r#type == ClassType::ClassDeclaration && !self.modifiers.contains(ModifierKind::Declare) { + builder.declare_symbol( + &ident.name, + ident.span, + builder.scope.current_scope_id, + SymbolFlags::Class, + SymbolFlags::ClassExcludes, + ); + } + } +} + +// It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains any duplicate entries, +// unless the source text matched by this production is not strict mode code +// and the duplicate entries are only bound by FunctionDeclarations. +// https://tc39.es/ecma262/#sec-block-level-function-declarations-web-legacy-compatibility-semantics +#[must_use] +fn function_as_var(scope: &Scope, is_script: bool) -> bool { + scope.flags.intersects(ScopeFlags::Function) + || (is_script && scope.flags.intersects(ScopeFlags::Top)) +} + +impl<'a> Binder for Function<'a> { + fn bind(&self, builder: &mut SemanticBuilder) { + if let Some(ident) = &self.id { + let current_scope_id = builder.scope.current_scope_id; + let scope = builder.scope.current_scope(); + if !scope.strict_mode && matches!(builder.parent_kind(), AstKind::IfStatement(_)) { + // Do not declare in if single statements, + // if (false) function f() {} else function g() { } + } else if matches!(self.r#type, FunctionType::FunctionDeclaration) { + // the visitor is already inside the function scope, + // retrieve the parent scope for the function id to bind to. + let parent_scope_id = + builder.scope.scopes[*current_scope_id].parent().unwrap().into(); + let parent_scope: &Scope = &builder.scope.scopes[parent_scope_id]; + + let (includes, excludes) = + if parent_scope.strict_mode || self.r#async || self.generator { + if function_as_var(parent_scope, builder.source_type.is_script()) { + ( + SymbolFlags::FunctionScopedVariable | SymbolFlags::Function, + SymbolFlags::FunctionScopedVariableExcludes, + ) + } else { + ( + SymbolFlags::BlockScopedVariable | SymbolFlags::Function, + SymbolFlags::BlockScopedVariableExcludes, + ) + } + } else if function_as_var(parent_scope, builder.source_type.is_script()) { + ( + SymbolFlags::Function, + SymbolFlags::FunctionScopedVariableExcludes - SymbolFlags::Function, + ) + } else { + ( + SymbolFlags::Function, + SymbolFlags::BlockScopedVariableExcludes - SymbolFlags::Function, + ) + }; + + builder.declare_symbol( + &ident.name, + ident.span, + parent_scope_id, + includes, + excludes, + ); + }; + } + } +} + impl<'a> Binder for FormalParameters<'a> { fn bind(&self, builder: &mut SemanticBuilder) { let includes = SymbolFlags::FunctionScopedVariable; diff --git a/crates/oxc_semantic/src/builder.rs b/crates/oxc_semantic/src/builder.rs index 7a73a2314..7d050cf18 100644 --- a/crates/oxc_semantic/src/builder.rs +++ b/crates/oxc_semantic/src/builder.rs @@ -178,6 +178,13 @@ impl<'a> SemanticBuilder<'a> { AstKind::VariableDeclarator(decl) => { decl.bind(self); } + AstKind::Function(func) => { + func.bind(self); + } + AstKind::Class(class) => { + self.current_node_flags |= NodeFlags::Class; + class.bind(self); + } AstKind::FormalParameters(params) => { params.bind(self); } @@ -190,10 +197,6 @@ impl<'a> SemanticBuilder<'a> { AstKind::JSXElementName(elem) => { self.reference_jsx_element_name(elem); } - AstKind::Class(class) => { - self.current_node_flags |= NodeFlags::Class; - class.bind(self); - } _ => {} } } diff --git a/crates/oxc_semantic/src/symbol/mod.rs b/crates/oxc_semantic/src/symbol/mod.rs index 032fe2151..7ccb9744c 100644 --- a/crates/oxc_semantic/src/symbol/mod.rs +++ b/crates/oxc_semantic/src/symbol/mod.rs @@ -39,11 +39,10 @@ bitflags! { const BlockScopedVariable = 1 << 1; const Class = 1 << 5; const CatchVariable = 1 << 6; // try {} catch(catch_variable) {} + const Function = 1 << 7; const Variable = Self::FunctionScopedVariable.bits | Self::BlockScopedVariable.bits; - const Value = Self::Variable.bits | Self::Class.bits; - - const ClassExcludes = Self::Value.bits; + const Value = Self::Variable.bits | Self::Function.bits | Self::Class.bits; /// Variables can be redeclared, but can not redeclare a block-scoped declaration with the /// same name, or any other value that is not a variable, e.g. ValueModule or Class @@ -52,6 +51,9 @@ bitflags! { /// Block-scoped declarations are not allowed to be re-declared /// they can not merge with anything in the value space const BlockScopedVariableExcludes = Self::Value.bits; + + const FunctionExcludes = Self::Value.bits - (Self::Function.bits | Self::Class.bits); + const ClassExcludes = Self::Value.bits - Self::Function.bits; } } diff --git a/tasks/coverage/babel.snap b/tasks/coverage/babel.snap index 0dc997d8a..0f9e60055 100644 --- a/tasks/coverage/babel.snap +++ b/tasks/coverage/babel.snap @@ -1,7 +1,7 @@ Babel Summary: -AST Parsed : 2056/2069 (99.37%) -Positive Passed: 2056/2069 (99.37%) -Negative Passed: 972/1502 (64.71%) +AST Parsed : 2054/2069 (99.28%) +Positive Passed: 2054/2069 (99.28%) +Negative Passed: 987/1502 (65.71%) Expect Syntax Error: "annex-b/disabled/1.1-html-comments-close/input.js" Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions-if-body/input.js" Expect Syntax Error: "annex-b/disabled/3.1-sloppy-labeled-functions-multiple-labels/input.js" @@ -24,13 +24,6 @@ Expect Syntax Error: "core/legacy-octal/legacy-octal-after-use-strict-function/i Expect Syntax Error: "core/legacy-octal/legacy-octal-after-use-strict/input.js" Expect Syntax Error: "core/opts/allowNewTargetOutsideFunction-false-2/input.js" Expect Syntax Error: "core/opts/allowNewTargetOutsideFunction-false/input.js" -Expect Syntax Error: "core/scope/dupl-bind-catch-func/input.js" -Expect Syntax Error: "core/scope/dupl-bind-class-func/input.js" -Expect Syntax Error: "core/scope/dupl-bind-func-gen/input.js" -Expect Syntax Error: "core/scope/dupl-bind-func-module-sloppy/input.js" -Expect Syntax Error: "core/scope/dupl-bind-func-module/input.js" -Expect Syntax Error: "core/scope/dupl-bind-func-var-sloppy/input.js" -Expect Syntax Error: "core/scope/dupl-bind-gen-func/input.js" Expect Syntax Error: "core/scope/undecl-export-as-default/input.js" Expect Syntax Error: "core/scope/undecl-export-as/input.js" Expect Syntax Error: "core/scope/undecl-export-block/input.js" @@ -122,14 +115,6 @@ Expect Syntax Error: "es2015/modules/duplicate-export-default-and-export-as-defa Expect Syntax Error: "es2015/modules/duplicate-export-default/input.js" Expect Syntax Error: "es2015/modules/duplicate-named-export-class-declaration/input.js" Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring-assignment/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring10/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring11/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring12/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring13/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring2/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring3/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring4/input.js" -Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring5/input.js" Expect Syntax Error: "es2015/modules/duplicate-named-export-function-declaration/input.js" Expect Syntax Error: "es2015/modules/duplicate-named-export-variable-declaration/input.js" Expect Syntax Error: "es2015/modules/duplicate-named-export/input.js" @@ -532,6 +517,28 @@ Expect Syntax Error: "typescript/types/tuple-optional-invalid/input.ts" Expect Syntax Error: "typescript/types/tuple-required-after-labeled-optional/input.ts" Expect Syntax Error: "typescript/types/tuple-unlabeled-spread-after-labeled/input.ts" Expect Syntax Error: "typescript/types/tuple-unlabeled-spread-before-labeled/input.ts" +Expect to Parse: "core/scope/dupl-bind-func-var/input.js" + + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-func-var/input.js:1:1] + 1 │ function foo() {} + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ var foo = 1; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── +Expect to Parse: "core/scope/dupl-bind-gen-gen-script/input.js" + + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-gen-gen-script/input.js:1:1] + 1 │ function *foo() {}; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ function *foo() {}; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── Expect to Parse: "typescript/arrow-function/generic-tsx-babel-7/input.ts" × Expect token @@ -944,6 +951,18 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts" · ╰── `foo` has already been declared here ╰──── + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-catch-func/input.js:1:1] + 1 │ try { + 2 │ } catch (foo) { + · ─┬─ + · ╰── `foo` has already been declared here + 3 │ function foo() {} + · ─┬─ + · ╰── It can not be redeclared here + 4 │ } + ╰──── + × Identifier `"foo"` has already been declared ╭─[core/scope/dupl-bind-catch-let/input.js:1:1] 1 │ try { @@ -1010,6 +1029,16 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts" · ╰── It can not be redeclared here ╰──── + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-class-func/input.js:1:1] + 1 │ class foo {}; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ function foo () {}; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + × Identifier `"foo"` has already been declared ╭─[core/scope/dupl-bind-class-let/input.js:1:1] 1 │ class foo {}; @@ -1038,6 +1067,52 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts" · ╰── `foo` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[core/scope/dupl-bind-func-gen/input.js:1:1] + 1 │ { function f() {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-func-module-sloppy/input.js:1:1] + 1 │ { function foo() {} function foo() {} } + · ─┬─ ─┬─ + · │ ╰── It can not be redeclared here + · ╰── `foo` has already been declared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-func-module/input.js:1:1] + 1 │ function foo() {} + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ function foo() {} + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[core/scope/dupl-bind-func-var-sloppy/input.js:1:1] + 1 │ { + 2 │ function foo() {} + · ─┬─ + · ╰── `foo` has already been declared here + 3 │ var foo = 1; + · ─┬─ + · ╰── It can not be redeclared here + 4 │ } + ╰──── + + × Identifier `"f"` has already been declared + ╭─[core/scope/dupl-bind-gen-func/input.js:1:1] + 1 │ { function* f() {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"foo"` has already been declared ╭─[core/scope/dupl-bind-let-let/input.js:1:1] 1 │ let foo, foo; @@ -2454,6 +2529,46 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts" · ╰── keyword cannot contain escape characters ╰──── + × Identifier `"foo"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring10/input.js:1:1] + 1 │ export function foo() {}; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ export const { a: [{foo}] } = bar; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo4"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring11/input.js:1:1] + 1 │ export function foo4() {}; + · ──┬─ + · ╰── `foo4` has already been declared here + 2 │ export const [{ a: [{ foo }], b: { foo2: [{ foo3: foo4 }] } }] = bar; + · ──┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo4"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring12/input.js:1:1] + 1 │ export function foo4() {}; + · ──┬─ + · ╰── `foo4` has already been declared here + 2 │ export const { a: [{ foo }], b: { foo2: [{ foo3: foo4 }] } } = bar; + · ──┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo4"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring13/input.js:1:1] + 1 │ export function foo4() {}; + · ──┬─ + · ╰── `foo4` has already been declared here + 2 │ export const { a: [{ foo4: foo }], b, c: { foo2: [{ foo3: foo4 }] } } = bar; + · ──┬─ + · ╰── It can not be redeclared here + ╰──── + × Identifier `"foo"` has already been declared ╭─[es2015/modules/duplicate-named-export-destructuring14/input.js:1:1] 1 │ export const foo = 1; @@ -2520,6 +2635,46 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts" 3 │ ╰──── + × Identifier `"foo"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring2/input.js:1:1] + 1 │ export function foo() {}; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ export const { foo } = bar; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring3/input.js:1:1] + 1 │ export const { foo } = bar; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ export function foo() {}; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring4/input.js:1:1] + 1 │ export function foo() {}; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ export const [foo] = bar; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"foo"` has already been declared + ╭─[es2015/modules/duplicate-named-export-destructuring5/input.js:1:1] + 1 │ export const [foo] = bar; + · ─┬─ + · ╰── `foo` has already been declared here + 2 │ export function foo() {}; + · ─┬─ + · ╰── It can not be redeclared here + ╰──── + × Identifier `"foo"` has already been declared ╭─[es2015/modules/duplicate-named-export-destructuring6/input.js:1:1] 1 │ export const { foo } = bar; diff --git a/tasks/coverage/test262.snap b/tasks/coverage/test262.snap index d0e49647d..ea4362c26 100644 --- a/tasks/coverage/test262.snap +++ b/tasks/coverage/test262.snap @@ -1,7 +1,7 @@ Test262 Summary: -AST Parsed : 44022/44034 (99.97%) -Positive Passed: 44022/44034 (99.97%) -Negative Passed: 2696/3917 (68.83%) +AST Parsed : 44015/44034 (99.96%) +Positive Passed: 44015/44034 (99.96%) +Negative Passed: 2821/3917 (72.02%) Expect Syntax Error: "annexB/language/statements/for-in/const-initializer.js" Expect Syntax Error: "annexB/language/statements/for-in/let-initializer.js" Expect Syntax Error: "annexB/language/statements/for-in/strict-initializer.js" @@ -17,71 +17,6 @@ Expect Syntax Error: "language/block-scope/syntax/function-declarations/in-state Expect Syntax Error: "language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement-else-statement.js" Expect Syntax Error: "language/block-scope/syntax/function-declarations/in-statement-position-if-expression-statement.js" Expect Syntax Error: "language/block-scope/syntax/function-declarations/in-statement-position-while-expression-statement.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-generator.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-function.js" -Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-generator.js" Expect Syntax Error: "language/directive-prologue/10.1.1-2gs.js" Expect Syntax Error: "language/directive-prologue/10.1.1-5gs.js" Expect Syntax Error: "language/directive-prologue/10.1.1-8gs.js" @@ -577,15 +512,10 @@ Expect Syntax Error: "language/literals/string/legacy-non-octal-escape-sequence- Expect Syntax Error: "language/literals/string/legacy-non-octal-escape-sequence-8-strict-explicit-pragma.js" Expect Syntax Error: "language/literals/string/legacy-non-octal-escape-sequence-9-strict-explicit-pragma.js" Expect Syntax Error: "language/module-code/early-dup-export-as-star-as.js" -Expect Syntax Error: "language/module-code/early-dup-export-decl.js" Expect Syntax Error: "language/module-code/early-dup-export-dflt-id.js" Expect Syntax Error: "language/module-code/early-dup-export-id-as.js" Expect Syntax Error: "language/module-code/early-dup-export-id.js" Expect Syntax Error: "language/module-code/early-dup-export-star-as-dflt.js" -Expect Syntax Error: "language/module-code/early-dup-top-function-async-generator.js" -Expect Syntax Error: "language/module-code/early-dup-top-function-async.js" -Expect Syntax Error: "language/module-code/early-dup-top-function-generator.js" -Expect Syntax Error: "language/module-code/early-dup-top-function.js" Expect Syntax Error: "language/module-code/early-export-global.js" Expect Syntax Error: "language/module-code/early-export-unresolvable.js" Expect Syntax Error: "language/module-code/early-import-arguments.js" @@ -593,10 +523,6 @@ Expect Syntax Error: "language/module-code/early-import-as-arguments.js" Expect Syntax Error: "language/module-code/early-import-as-eval.js" Expect Syntax Error: "language/module-code/early-import-eval.js" Expect Syntax Error: "language/module-code/early-new-target.js" -Expect Syntax Error: "language/module-code/export-default-asyncfunction-declaration-binding-exists.js" -Expect Syntax Error: "language/module-code/export-default-asyncgenerator-declaration-binding-exists.js" -Expect Syntax Error: "language/module-code/export-default-function-declaration-binding-exists.js" -Expect Syntax Error: "language/module-code/export-default-generator-declaration-binding-exists.js" Expect Syntax Error: "language/module-code/parse-err-decl-pos-export-arrow-function.js" Expect Syntax Error: "language/module-code/parse-err-decl-pos-export-block-stmt-list.js" Expect Syntax Error: "language/module-code/parse-err-decl-pos-export-block-stmt.js" @@ -683,8 +609,6 @@ Expect Syntax Error: "language/module-code/parse-err-decl-pos-import-try-catch.j Expect Syntax Error: "language/module-code/parse-err-decl-pos-import-try-finally.js" Expect Syntax Error: "language/module-code/parse-err-decl-pos-import-try-try.js" Expect Syntax Error: "language/module-code/parse-err-decl-pos-import-while.js" -Expect Syntax Error: "language/module-code/parse-err-hoist-lex-fun.js" -Expect Syntax Error: "language/module-code/parse-err-hoist-lex-gen.js" Expect Syntax Error: "language/module-code/parse-err-return.js" Expect Syntax Error: "language/module-code/top-level-await/syntax/early-does-not-propagate-to-fn-declaration-body.js" Expect Syntax Error: "language/module-code/top-level-await/syntax/early-does-not-propagate-to-fn-declaration-params.js" @@ -1125,60 +1049,11 @@ Expect Syntax Error: "language/statements/return/S12.9_A1_T7.js" Expect Syntax Error: "language/statements/return/S12.9_A1_T8.js" Expect Syntax Error: "language/statements/return/S12.9_A1_T9.js" Expect Syntax Error: "language/statements/switch/S12.11_A2_T1.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js" -Expect Syntax Error: "language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js" Expect Syntax Error: "language/statements/try/catch-parameter-boundnames-restriction-arguments-negative-early.js" Expect Syntax Error: "language/statements/try/catch-parameter-boundnames-restriction-eval-negative-early.js" Expect Syntax Error: "language/statements/try/dstr/ary-ptrn-rest-init-ary.js" Expect Syntax Error: "language/statements/try/dstr/ary-ptrn-rest-init-id.js" Expect Syntax Error: "language/statements/try/dstr/ary-ptrn-rest-init-obj.js" -Expect Syntax Error: "language/statements/try/early-catch-function.js" Expect Syntax Error: "language/statements/try/static-init-await-binding-invalid.js" Expect Syntax Error: "language/statements/variable/12.2.1-1gs.js" Expect Syntax Error: "language/statements/variable/12.2.1-4gs.js" @@ -1223,6 +1098,30 @@ Expect Syntax Error: "language/statements/with/decl-fun.js" Expect Syntax Error: "language/statements/with/strict-fn-decl-nested-1.js" Expect Syntax Error: "language/statements/with/strict-fn-decl-nested-2.js" Expect Syntax Error: "language/statements/with/strict-fn-decl.js" +Expect to Parse: "language/block-scope/syntax/redeclaration-global/allowed-to-redeclare-function-declaration-with-var.js" + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration-global/allowed-to-redeclare-function-declaration-with-var.js:8:1] + 8 │ ---*/ + 9 │ function f() {} var f; + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 10 │ + ╰──── +Expect to Parse: "language/destructuring/binding/syntax/recursive-array-and-object-patterns.js" + + × Identifier `"fn4"` has already been declared + ╭─[language/destructuring/binding/syntax/recursive-array-and-object-patterns.js:22:1] + 22 │ + 23 │ function fn4([], [[]], [[[[[[[[[x]]]]]]]]]) {} + · ─┬─ + · ╰── `fn4` has already been declared here + 24 │ + 25 │ function fn4([[x, y, ...z]]) {} + · ─┬─ + · ╰── It can not be redeclared here + ╰──── Expect to Parse: "language/expressions/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js" × Unexpected token @@ -1292,6 +1191,17 @@ Expect to Parse: "language/expressions/class/decorator/syntax/valid/decorator-pa · ─ 54 │ @(_) ╰──── +Expect to Parse: "language/global-code/decl-func-dup.js" + + × Identifier `"f"` has already been declared + ╭─[language/global-code/decl-func-dup.js:8:1] + 8 │ ---*/ + 9 │ function f() { return 1; } function f() { return 2; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 10 │ + ╰──── Expect to Parse: "language/statements/class/decorator/syntax/class-valid/decorator-member-expr-private-identifier.js" × Unexpected token @@ -1325,6 +1235,83 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 52 │ @(yield) class C {} · ───── ╰──── +Expect to Parse: "language/statements/function/S13_A6_T1.js" + + × Identifier `"__func"` has already been declared + ╭─[language/statements/function/S13_A6_T1.js:11:1] + 11 │ + 12 │ function __func(){return 1}; + · ───┬── + · ╰── `__func` has already been declared here + 13 │ + 14 │ var __store__func = __func; + 15 │ + 16 │ var __1 = __func(); + 17 │ + 18 │ function __func(){return 'A'}; + · ───┬── + · ╰── It can not be redeclared here + 19 │ + ╰──── +Expect to Parse: "language/statements/function/S13_A6_T2.js" + + × Identifier `"__func"` has already been declared + ╭─[language/statements/function/S13_A6_T2.js:24:1] + 24 │ + 25 │ function __func(){return "FIRST";}; + · ───┬── + · ╰── `__func` has already been declared here + 26 │ + 27 │ ////////////////////////////////////////////////////////////////////////////// + 28 │ //CHECK#2 + 29 │ __result = __func(); + 30 │ if (__result !== "SECOND") { + 31 │ throw new Test262Error('#2: __result === "SECOND". Actual: __result ==='+__result); + 32 │ } + 33 │ // + 34 │ ////////////////////////////////////////////////////////////////////////////// + 35 │ + 36 │ function __func(){return "SECOND";}; + · ───┬── + · ╰── It can not be redeclared here + ╰──── +Expect to Parse: "language/statements/function/S14_A5_T1.js" + + × Identifier `"__func"` has already been declared + ╭─[language/statements/function/S14_A5_T1.js:21:1] + 21 │ + 22 │ function __func(){return "ascii"}; + · ───┬── + · ╰── `__func` has already been declared here + 23 │ function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode + · ──────────────────┬───────────────── + · ╰── It can not be redeclared here + 24 │ function __\u0066\u0075\u006e\u0063(){return "both"};//__func in unicode + ╰──── + + × Identifier `"__func"` has already been declared + ╭─[language/statements/function/S14_A5_T1.js:21:1] + 21 │ + 22 │ function __func(){return "ascii"}; + · ───┬── + · ╰── `__func` has already been declared here + 23 │ function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode + 24 │ function __\u0066\u0075\u006e\u0063(){return "both"};//__func in unicode + · ─────────────┬──────────── + · ╰── It can not be redeclared here + ╰──── +Expect to Parse: "language/statements/function/S14_A5_T2.js" + + × Identifier `"__func"` has already been declared + ╭─[language/statements/function/S14_A5_T2.js:21:1] + 21 │ + 22 │ function __func(){return "ascii"}; + · ───┬── + · ╰── `__func` has already been declared here + 23 │ function \u005f\u005f\u0066\u0075\u006e\u0063(){return "unicode"};//__func in unicode + · ──────────────────┬───────────────── + · ╰── It can not be redeclared here + ╰──── × '0'-prefixed octal literals and octal escape sequences are deprecated ╭─[annexB/language/expressions/template-literal/legacy-octal-escape-sequence-strict.js:17:1] @@ -1652,6 +1639,168 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 17 │ while (false) ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { async function f() {} async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { async function f() {} async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ { async function f() {} class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ { async function f() {} const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ { async function f() {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { async function f() {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ { async function f() {} let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ { async function f() {} var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { async function* f() {} async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { async function* f() {} async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ { async function* f() {} class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ { async function* f() {} const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ { async function* f() {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { async function* f() {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ { async function* f() {} let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ { async function* f() {} var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { class f {} async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { class f {} async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -1670,6 +1819,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ { class f {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { class f {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -1688,6 +1855,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { const f = 0; async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { const f = 0; async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -1706,6 +1891,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ { const f = 0; function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { const f = 0; function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -1724,6 +1927,26 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-function.js:23:1] + 23 │ function x() { + 24 │ { async function f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 25 │ } + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-async-generator.js:23:1] + 23 │ function x() { + 24 │ { async function* f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 25 │ } + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-class.js:22:1] 22 │ function x() { @@ -1744,6 +1967,26 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 24 │ } ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-function.js:22:1] + 22 │ function x() { + 23 │ { function f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 24 │ } + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-generator.js:23:1] + 23 │ function x() { + 24 │ { function* f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + 25 │ } + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-let.js:22:1] 22 │ function x() { @@ -1754,6 +1997,183 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 24 │ } ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-declaration-attempt-to-redeclare-with-var-declaration-nested-in-function.js:23:1] + 23 │ // A lexically declared function declaration. + 24 │ function f() {} + · ┬ + · ╰── `f` has already been declared here + 25 │ + 26 │ // An inner block-statement with a variable-declared name. + 27 │ { + 28 │ var f; + · ┬ + · ╰── It can not be redeclared here + 29 │ } + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { function f() {} async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { function f() {} async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js:21:1] + 21 │ + 22 │ { function f() {} class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js:21:1] + 21 │ + 22 │ { function f() {} const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ { function f() {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { function f() {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js:21:1] + 21 │ + 22 │ { function f() {} let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js:21:1] + 21 │ + 22 │ { function f() {} var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { function* f() {} async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { function* f() {} async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ { function* f() {} class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ { function* f() {} const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ { function* f() {} function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { function* f() {} function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ { function* f() {} let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ { function* f() {} var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-function.js:38:1] + 38 │ + 39 │ { { var f; } async function f() {}; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-async-generator.js:38:1] + 38 │ + 39 │ { { var f; } async function* f() {}; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-class.js:37:1] 37 │ @@ -1772,6 +2192,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-function.js:37:1] + 37 │ + 38 │ { { var f; } function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-generator.js:38:1] + 38 │ + 39 │ { { var f; } function* f() {}; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-let.js:37:1] 37 │ @@ -1781,6 +2219,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-function.js:38:1] + 38 │ + 39 │ { async function f() {}; { var f; } } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-async-generator.js:38:1] + 38 │ + 39 │ { async function* f() {}; { var f; } } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-class.js:37:1] 37 │ @@ -1799,6 +2255,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-function.js:37:1] + 37 │ + 38 │ { function f() {} { var f; } } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-generator.js:38:1] + 38 │ + 39 │ { function* f() {}; { var f; } } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-let.js:37:1] 37 │ @@ -1808,6 +2282,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { let f; async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { let f; async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -1826,6 +2318,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ { let f; function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { let f; function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -1844,6 +2354,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ { var f; async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ { var f; async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -1862,6 +2390,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ { var f; function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ { var f; function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -1871,6 +2417,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-function.js:22:1] + 22 │ + 23 │ { async function f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-async-generator.js:22:1] + 22 │ + 23 │ { async function* f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-class.js:21:1] 21 │ @@ -1889,6 +2453,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-function.js:21:1] + 21 │ + 22 │ { function f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-generator.js:22:1] + 22 │ + 23 │ { function* f() {}; var f; } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-let.js:21:1] 21 │ @@ -15719,6 +16301,17 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 25 │ }; ╰──── + × Identifier `"f"` has already been declared + ╭─[language/module-code/early-dup-export-decl.js:16:1] + 16 │ + 17 │ export function f() {} + · ┬ + · ╰── `f` has already been declared here + 18 │ export function *f() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + × Unexpected token ╭─[language/module-code/early-dup-export-dflt.js:15:1] 15 │ @@ -15750,6 +16343,50 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── It can not be redeclared here ╰──── + × Identifier `"x"` has already been declared + ╭─[language/module-code/early-dup-top-function-async-generator.js:18:1] + 18 │ + 19 │ function x() {} + · ┬ + · ╰── `x` has already been declared here + 20 │ async function* x() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"x"` has already been declared + ╭─[language/module-code/early-dup-top-function-async.js:18:1] + 18 │ + 19 │ function x() {} + · ┬ + · ╰── `x` has already been declared here + 20 │ async function x() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"x"` has already been declared + ╭─[language/module-code/early-dup-top-function-generator.js:18:1] + 18 │ + 19 │ function x() {} + · ┬ + · ╰── `x` has already been declared here + 20 │ function* x() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"x"` has already been declared + ╭─[language/module-code/early-dup-top-function.js:18:1] + 18 │ + 19 │ function x() {} + · ┬ + · ╰── `x` has already been declared here + 20 │ function x() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + × An export name cannot include a unicode lone surrogate ╭─[language/module-code/early-export-ill-formed-string.js:20:1] 20 │ // 🌙 is '\uD83C\uDF19' @@ -15822,6 +16459,51 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 18 │ } ╰──── + × Identifier `"A"` has already been declared + ╭─[language/module-code/export-default-asyncfunction-declaration-binding-exists.js:21:1] + 21 │ + 22 │ class A {}; + · ┬ + · ╰── `A` has already been declared here + 23 │ export default async function A() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"AG"` has already been declared + ╭─[language/module-code/export-default-asyncgenerator-declaration-binding-exists.js:21:1] + 21 │ + 22 │ class AG {} + · ─┬ + · ╰── `AG` has already been declared here + 23 │ export default async function * AG() {} + · ─┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"F"` has already been declared + ╭─[language/module-code/export-default-function-declaration-binding-exists.js:21:1] + 21 │ + 22 │ class F {} + · ┬ + · ╰── `F` has already been declared here + 23 │ export default function F() {} + · ┬ + · ╰── It can not be redeclared here + 24 │ + ╰──── + + × Identifier `"G"` has already been declared + ╭─[language/module-code/export-default-generator-declaration-binding-exists.js:21:1] + 21 │ + 22 │ class G {} + · ┬ + · ╰── `G` has already been declared here + 23 │ export default function * G() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + × An export name cannot include a unicode lone surrogate ╭─[language/module-code/export-expname-from-as-unpaired-surrogate.js:20:1] 20 │ @@ -15932,6 +16614,28 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ─── ╰──── + × Identifier `"f"` has already been declared + ╭─[language/module-code/parse-err-hoist-lex-fun.js:23:1] + 23 │ + 24 │ var f; + · ┬ + · ╰── `f` has already been declared here + 25 │ function f() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + + × Identifier `"g"` has already been declared + ╭─[language/module-code/parse-err-hoist-lex-gen.js:25:1] + 25 │ + 26 │ var g; + · ┬ + · ╰── `g` has already been declared here + 27 │ function* g() {} + · ┬ + · ╰── It can not be redeclared here + ╰──── + × Empty parenthesized expression ╭─[language/module-code/parse-err-invoke-anon-fun-decl.js:25:1] 25 │ @@ -24116,6 +24820,168 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par 20 │ case 0: ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-function-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function f() {} default: var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/async-generator-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ switch (0) { case 1: async function* f() {} default: var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: class f {} default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: class f {} default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -24134,6 +25000,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ switch (0) { case 1: class f {} default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: class f {} default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -24152,6 +25036,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: const f = 0; default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: const f = 0; default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -24170,6 +25072,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ switch (0) { case 1: const f = 0; default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: const f = 0; default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -24188,6 +25108,168 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function f() {} default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function f() {} default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-class.js:21:1] + 21 │ + 22 │ switch (0) { case 1: function f() {} default: class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-const.js:21:1] + 21 │ + 22 │ switch (0) { case 1: function f() {} default: const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ switch (0) { case 1: function f() {} default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function f() {} default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-let.js:21:1] + 21 │ + 22 │ switch (0) { case 1: function f() {} default: let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/function-name-redeclaration-attempt-with-var.js:21:1] + 21 │ + 22 │ switch (0) { case 1: function f() {} default: var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-class.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: class f {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-const.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: const f = 0 } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-let.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: let f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/generator-name-redeclaration-attempt-with-var.js:22:1] + 22 │ + 23 │ switch (0) { case 1: function* f() {} default: var f } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: let f; default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: let f; default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -24206,6 +25288,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ switch (0) { case 1: let f; default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: let f; default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -24224,6 +25324,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-function.js:22:1] + 22 │ + 23 │ switch (0) { case 1: var f; default: async function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-async-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: var f; default: async function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-class.js:21:1] 21 │ @@ -24242,6 +25360,24 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `f` has already been declared here ╰──── + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-function.js:21:1] + 21 │ + 22 │ switch (0) { case 1: var f; default: function f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + + × Identifier `"f"` has already been declared + ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-generator.js:22:1] + 22 │ + 23 │ switch (0) { case 1: var f; default: function* f() {} } + · ┬ ┬ + · │ ╰── It can not be redeclared here + · ╰── `f` has already been declared here + ╰──── + × Identifier `"f"` has already been declared ╭─[language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-let.js:21:1] 21 │ @@ -24404,6 +25540,18 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par · ╰── `x` has already been declared here ╰──── + × Identifier `"e"` has already been declared + ╭─[language/statements/try/early-catch-function.js:21:1] + 21 │ try { + 22 │ } catch (e) { + · ┬ + · ╰── `e` has already been declared here + 23 │ function e(){} + · ┬ + · ╰── It can not be redeclared here + 24 │ } + ╰──── + × Identifier `"x"` has already been declared ╭─[language/statements/try/early-catch-lex.js:16:1] 16 │ diff --git a/tasks/coverage/typescript.snap b/tasks/coverage/typescript.snap index 928ee6a2c..b9401247e 100644 --- a/tasks/coverage/typescript.snap +++ b/tasks/coverage/typescript.snap @@ -1,7 +1,7 @@ TypeScript Summary: AST Parsed : 2305/2338 (98.59%) Positive Passed: 2305/2338 (98.59%) -Negative Passed: 589/2532 (23.26%) +Negative Passed: 590/2532 (23.30%) Expect Syntax Error: "Symbols/ES5SymbolProperty2.ts" Expect Syntax Error: "Symbols/ES5SymbolProperty6.ts" Expect Syntax Error: "additionalChecks/noPropertyAccessFromIndexSignature1.ts" @@ -882,7 +882,6 @@ Expect Syntax Error: "externalModules/verbatimModuleSyntaxInternalImportEquals.t Expect Syntax Error: "fixSignatureCaching.ts" Expect Syntax Error: "functions/functionImplementationErrors.ts" Expect Syntax Error: "functions/functionImplementations.ts" -Expect Syntax Error: "functions/functionNameConflicts.ts" Expect Syntax Error: "functions/functionOverloadCompatibilityWithVoid01.ts" Expect Syntax Error: "functions/functionOverloadErrors.ts" Expect Syntax Error: "functions/functionWithUseStrictAndSimpleParameterList_es2016.ts" @@ -6054,6 +6053,54 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts" 15 │ } ╰──── + × Identifier `"fn1"` has already been declared + ╭─[functions/functionNameConflicts.ts:4:1] + 4 │ module M { + 5 │ function fn1() { } + · ─┬─ + · ╰── `fn1` has already been declared here + 6 │ var fn1; + · ─┬─ + · ╰── It can not be redeclared here + 7 │ + ╰──── + + × Identifier `"fn2"` has already been declared + ╭─[functions/functionNameConflicts.ts:7:1] + 7 │ + 8 │ var fn2; + · ─┬─ + · ╰── `fn2` has already been declared here + 9 │ function fn2() { } + · ─┬─ + · ╰── It can not be redeclared here + 10 │ } + ╰──── + + × Identifier `"fn3"` has already been declared + ╭─[functions/functionNameConflicts.ts:11:1] + 11 │ + 12 │ function fn3() { } + · ─┬─ + · ╰── `fn3` has already been declared here + 13 │ var fn3; + · ─┬─ + · ╰── It can not be redeclared here + 14 │ + ╰──── + + × Identifier `"fn5"` has already been declared + ╭─[functions/functionNameConflicts.ts:18:1] + 18 │ + 19 │ function fn5() { } + · ─┬─ + · ╰── `fn5` has already been declared here + 20 │ var fn5; + · ─┬─ + · ╰── It can not be redeclared here + 21 │ } + ╰──── + × Rest element must be last element ╭─[functions/functionOverloadErrorsSyntax.ts:8:1] 8 │ //Function overload signature with rest param followed by non-optional parameter