mirror of
https://github.com/danbulant/oxc
synced 2026-05-24 12:21:58 +00:00
feat(semantic): bind VariableDeclarator
This commit is contained in:
parent
b1e802cecc
commit
323bb9a2b6
6 changed files with 1076 additions and 97 deletions
|
|
@ -2,8 +2,13 @@
|
|||
|
||||
#[allow(clippy::wildcard_imports)]
|
||||
use oxc_ast::ast::*;
|
||||
use oxc_ast::syntax_directed_operations::BoundNames;
|
||||
|
||||
use crate::{symbol::SymbolFlags, SemanticBuilder};
|
||||
use crate::{
|
||||
scope::{ScopeFlags, ScopeId},
|
||||
symbol::SymbolFlags,
|
||||
SemanticBuilder,
|
||||
};
|
||||
|
||||
pub trait Binder {
|
||||
fn bind(&self, _builder: &mut SemanticBuilder) {}
|
||||
|
|
@ -23,3 +28,49 @@ impl<'a> Binder for Class<'a> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Binder for VariableDeclarator<'a> {
|
||||
fn bind(&self, builder: &mut SemanticBuilder) {
|
||||
let current_scope_id = builder.scope.current_scope_id;
|
||||
let (includes, excludes) = match self.kind {
|
||||
VariableDeclarationKind::Const | VariableDeclarationKind::Let => {
|
||||
(SymbolFlags::BlockScopedVariable, SymbolFlags::BlockScopedVariableExcludes)
|
||||
}
|
||||
VariableDeclarationKind::Var => {
|
||||
(SymbolFlags::FunctionScopedVariable, SymbolFlags::FunctionScopedVariableExcludes)
|
||||
}
|
||||
};
|
||||
for ident in self.id.bound_names() {
|
||||
let symbol_id = builder.declare_symbol(
|
||||
&ident.name,
|
||||
ident.span,
|
||||
current_scope_id,
|
||||
includes,
|
||||
excludes,
|
||||
);
|
||||
if self.kind == VariableDeclarationKind::Var
|
||||
&& !builder.scope.current_scope().flags.intersects(ScopeFlags::VAR)
|
||||
{
|
||||
let mut scope_ids = vec![];
|
||||
for scope_id in current_scope_id.ancestors(&builder.scope.scopes).skip(1) {
|
||||
let scope = builder.scope.scopes[scope_id].get();
|
||||
if scope.flags.intersects(ScopeFlags::VAR) {
|
||||
scope_ids.push(ScopeId::from(scope_id));
|
||||
break;
|
||||
}
|
||||
scope_ids.push(ScopeId::from(scope_id));
|
||||
}
|
||||
for scope_id in scope_ids {
|
||||
if builder
|
||||
.check_redeclaration(scope_id, &ident.name, ident.span, excludes)
|
||||
.is_none()
|
||||
{
|
||||
builder.scope.scopes[scope_id]
|
||||
.variables
|
||||
.insert(ident.name.clone(), symbol_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -175,6 +175,7 @@ impl<'a> Visit<'a> for SemanticBuilder<'a> {
|
|||
impl<'a> SemanticBuilder<'a> {
|
||||
fn enter_kind(&mut self, kind: AstKind<'a>) {
|
||||
match kind {
|
||||
AstKind::VariableDeclarator(decl) => decl.bind(self),
|
||||
AstKind::IdentifierReference(ident) => {
|
||||
self.reference_identifier(ident);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,11 +33,24 @@ bitflags! {
|
|||
#[derive(Default)]
|
||||
pub struct SymbolFlags: u16 {
|
||||
const None = 0;
|
||||
/// Variable (var) or parameter
|
||||
const FunctionScopedVariable = 1 << 0;
|
||||
/// A block-scoped variable (let or const)
|
||||
const BlockScopedVariable = 1 << 1;
|
||||
const Class = 1 << 5;
|
||||
|
||||
const Value = Self::Class.bits;
|
||||
const Variable = Self::FunctionScopedVariable.bits | Self::BlockScopedVariable.bits;
|
||||
const Value = Self::Variable.bits | Self::Class.bits;
|
||||
|
||||
const ClassExcludes = Self::Value.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
|
||||
const FunctionScopedVariableExcludes = Self::Value.bits - Self::FunctionScopedVariable.bits;
|
||||
|
||||
/// 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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Babel Summary:
|
||||
AST Parsed : 2056/2069 (99.37%)
|
||||
Positive Passed: 2056/2069 (99.37%)
|
||||
Negative Passed: 938/1502 (62.45%)
|
||||
Negative Passed: 965/1502 (64.25%)
|
||||
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"
|
||||
|
|
@ -26,30 +26,18 @@ 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-2nd-lvl-lex-nested/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-2nd-lvl-lex/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-2nd-lvl-var-nested/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-2nd-lvl-var/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-arr-destr/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-dbl-let/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-func/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-let/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-obj-destr/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-var-arr-destr/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-catch-var-obj-destr/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-class-const/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-class-func/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-class-let/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-class-var/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-const-const/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/dupl-bind-let-let/input.js"
|
||||
Expect Syntax Error: "core/scope/dupl-bind-nested-let-var/input.js"
|
||||
Expect Syntax Error: "core/scope/for-var/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"
|
||||
|
|
@ -145,20 +133,10 @@ Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring10/inpu
|
|||
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-destructuring14/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring15/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring16/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring17/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring18/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring19/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-destructuring6/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring7/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring8/input.js"
|
||||
Expect Syntax Error: "es2015/modules/duplicate-named-export-destructuring9/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"
|
||||
|
|
@ -261,11 +239,6 @@ Expect Syntax Error: "es2017/async-functions/await-inside-parameters-of-nested-a
|
|||
Expect Syntax Error: "es2017/async-functions/await-inside-parameters-of-nested-function/input.js"
|
||||
Expect Syntax Error: "es2017/async-functions/await-inside-parameters/input.js"
|
||||
Expect Syntax Error: "es2017/trailing-function-commas/7/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/11/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/12/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/13/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/14/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/15/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/24/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/comma-after-rest/input.js"
|
||||
Expect Syntax Error: "es2018/object-rest-spread/comma-after-spread-for-in/input.js"
|
||||
|
|
@ -896,6 +869,60 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
╰────
|
||||
help: Try insert a semicolon here
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-2nd-lvl-lex-nested/input.js:2:1]
|
||||
2 │ let bar;
|
||||
3 │ var foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
4 │ let foo = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
5 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-2nd-lvl-lex/input.js:1:1]
|
||||
1 │ let bar;
|
||||
2 │ var foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
3 │ let foo = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-2nd-lvl-var-nested/input.js:2:1]
|
||||
2 │ let bar;
|
||||
3 │ let foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
4 │ var foo = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
5 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-2nd-lvl-var/input.js:1:1]
|
||||
1 │ let bar;
|
||||
2 │ let foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
3 │ var foo = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-catch-dbl-let/input.js:1:1]
|
||||
1 │ let foo; try {} catch (foo) {} let foo;
|
||||
· ─┬─ ─┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-class-class/input.js:1:1]
|
||||
1 │ class foo {};
|
||||
|
|
@ -906,6 +933,75 @@ 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-const/input.js:1:1]
|
||||
1 │ class foo {};
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── 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 {};
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ let foo = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-class-var/input.js:1:1]
|
||||
1 │ class foo {};
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ var foo;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[core/scope/dupl-bind-const-const/input.js:1:1]
|
||||
1 │ const foo=1, foo=2;
|
||||
· ─┬─ ─┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo` 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;
|
||||
· ─┬─ ─┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"a"` has already been declared
|
||||
╭─[core/scope/dupl-bind-nested-let-var/input.js:1:1]
|
||||
1 │ {
|
||||
2 │ let a;
|
||||
· ┬
|
||||
· ╰── `a` has already been declared here
|
||||
3 │ { var a; }
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"i"` has already been declared
|
||||
╭─[core/scope/for-var/input.js:1:1]
|
||||
1 │ for (let i = 0;;) {
|
||||
· ┬
|
||||
· ╰── `i` has already been declared here
|
||||
2 │ var i;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
3 │ }
|
||||
╰────
|
||||
|
||||
× A 'get' accessor must not have any formal parameters.
|
||||
╭─[core/uncategorised/.542/input.js:1:1]
|
||||
1 │ ({ get prop(x) {} })
|
||||
|
|
@ -2291,6 +2387,112 @@ 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-destructuring14/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const { foo2: foo } = bar;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"foo2"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring15/input.js:1:1]
|
||||
1 │ export const { foo: foo2 } = bar;
|
||||
· ──┬─
|
||||
· ╰── `foo2` has already been declared here
|
||||
2 │ export const foo2 = 1;
|
||||
· ──┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring16/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const [bar, ...foo] = baz;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"bar"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring17/input.js:1:1]
|
||||
1 │ export const [foo, ...bar] = baz;
|
||||
· ─┬─
|
||||
· ╰── `bar` has already been declared here
|
||||
2 │ export const bar = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring18/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const [bar, [baz, ...foo]] = qux;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring19/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const { bar: [baz, ...foo] } = qux;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring6/input.js:1:1]
|
||||
1 │ export const { foo } = bar;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const [foo] = bar2;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring7/input.js:1:1]
|
||||
1 │ export const [foo] = bar;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const { foo } = bar2;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"Foo"` has already been declared
|
||||
╭─[es2015/modules/duplicate-named-export-destructuring8/input.js:1:1]
|
||||
1 │ export class 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-destructuring9/input.js:1:1]
|
||||
1 │ export class Foo {};
|
||||
· ─┬─
|
||||
· ╰── `Foo` has already been declared here
|
||||
2 │ export const [Foo] = bar;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[es2015/modules/export-default-variable-declaration/input.js:1:1]
|
||||
1 │ export default const Foo = () => {
|
||||
|
|
@ -3582,6 +3784,56 @@ Expect to Parse: "typescript/types/const-type-parameters/input.ts"
|
|||
3 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2018/object-rest-spread/11/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const { bar, ...foo } = baz;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"bar"` has already been declared
|
||||
╭─[es2018/object-rest-spread/12/input.js:1:1]
|
||||
1 │ export const { foo, ...bar } = baz;
|
||||
· ─┬─
|
||||
· ╰── `bar` has already been declared here
|
||||
2 │ export const bar = 1;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2018/object-rest-spread/13/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const { bar: { baz, ...foo } } = qux;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2018/object-rest-spread/14/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const [bar, { baz, ...foo }] = qux;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Identifier `"foo"` has already been declared
|
||||
╭─[es2018/object-rest-spread/15/input.js:1:1]
|
||||
1 │ export const foo = 1;
|
||||
· ─┬─
|
||||
· ╰── `foo` has already been declared here
|
||||
2 │ export const [bar, [{ baz, ...foo }]] = qux;
|
||||
· ─┬─
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× Invalid rest argument
|
||||
╭─[es2018/object-rest-spread/16/input.js:1:1]
|
||||
1 │ var {...{z}} = { z: 1};
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Test262 Summary:
|
||||
AST Parsed : 44022/44034 (99.97%)
|
||||
Positive Passed: 44022/44034 (99.97%)
|
||||
Negative Passed: 2630/3917 (67.14%)
|
||||
Negative Passed: 2686/3917 (68.57%)
|
||||
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"
|
||||
|
|
@ -35,26 +35,16 @@ Expect Syntax Error: "language/block-scope/syntax/redeclaration/async-generator-
|
|||
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-const.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/class-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/class-name-redeclaration-attempt-with-var.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-const.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/const-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/const-name-redeclaration-attempt-with-var.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/fn-scope-var-name-redeclaration-attempt-with-const.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/fn-scope-var-name-redeclaration-attempt-with-let.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"
|
||||
|
|
@ -74,40 +64,24 @@ Expect Syntax Error: "language/block-scope/syntax/redeclaration/generator-name-r
|
|||
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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-name-redeclaration-attempt-with-const.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-name-redeclaration-attempt-with-let.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/inner-block-var-redeclaration-attempt-after-const.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/inner-block-var-redeclaration-attempt-after-let.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-const.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/let-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/let-name-redeclaration-attempt-with-var.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-name-redeclaration-attempt-with-const.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-name-redeclaration-attempt-with-let.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-class.js"
|
||||
Expect Syntax Error: "language/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-const.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/block-scope/syntax/redeclaration/var-redeclaration-attempt-after-let.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"
|
||||
|
|
@ -615,7 +589,6 @@ 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-lex.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"
|
||||
|
|
@ -626,7 +599,6 @@ Expect Syntax Error: "language/module-code/early-import-arguments.js"
|
|||
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-lex-and-var.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"
|
||||
|
|
@ -980,14 +952,11 @@ Expect Syntax Error: "language/statements/class/method/rest-param-strict-body.js
|
|||
Expect Syntax Error: "language/statements/class/static-gen-method-param-dflt-yield.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-await-binding-invalid.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-invalid-await.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-invalid-lex-dup.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-invalid-lex-var.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-invalid-return.js"
|
||||
Expect Syntax Error: "language/statements/class/static-init-invalid-super-call.js"
|
||||
Expect Syntax Error: "language/statements/const/dstr/ary-ptrn-rest-init-ary.js"
|
||||
Expect Syntax Error: "language/statements/const/dstr/ary-ptrn-rest-init-id.js"
|
||||
Expect Syntax Error: "language/statements/const/dstr/ary-ptrn-rest-init-obj.js"
|
||||
Expect Syntax Error: "language/statements/const/redeclaration-error-from-within-strict-mode-function-const.js"
|
||||
Expect Syntax Error: "language/statements/const/static-init-await-binding-invalid.js"
|
||||
Expect Syntax Error: "language/statements/do-while/decl-fun.js"
|
||||
Expect Syntax Error: "language/statements/do-while/labelled-fn-stmt.js"
|
||||
|
|
@ -1038,10 +1007,6 @@ Expect Syntax Error: "language/statements/for-await-of/head-let-init.js"
|
|||
Expect Syntax Error: "language/statements/for-await-of/head-var-init.js"
|
||||
Expect Syntax Error: "language/statements/for-in/decl-fun.js"
|
||||
Expect Syntax Error: "language/statements/for-in/dstr/obj-id-identifier-yield-expr.js"
|
||||
Expect Syntax Error: "language/statements/for-in/head-const-bound-names-dup.js"
|
||||
Expect Syntax Error: "language/statements/for-in/head-const-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for-in/head-let-bound-names-dup.js"
|
||||
Expect Syntax Error: "language/statements/for-in/head-let-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for-in/labelled-fn-stmt-const.js"
|
||||
Expect Syntax Error: "language/statements/for-in/labelled-fn-stmt-let.js"
|
||||
Expect Syntax Error: "language/statements/for-in/labelled-fn-stmt-lhs.js"
|
||||
|
|
@ -1069,11 +1034,7 @@ Expect Syntax Error: "language/statements/for-of/dstr/var-ary-ptrn-rest-init-ary
|
|||
Expect Syntax Error: "language/statements/for-of/dstr/var-ary-ptrn-rest-init-id.js"
|
||||
Expect Syntax Error: "language/statements/for-of/dstr/var-ary-ptrn-rest-init-obj.js"
|
||||
Expect Syntax Error: "language/statements/for-of/dstr/var-obj-ptrn-init-err.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-const-bound-names-dup.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-const-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-const-init.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-let-bound-names-dup.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-let-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-let-init.js"
|
||||
Expect Syntax Error: "language/statements/for-of/head-var-init.js"
|
||||
Expect Syntax Error: "language/statements/for-of/labelled-fn-stmt-const.js"
|
||||
|
|
@ -1090,8 +1051,6 @@ Expect Syntax Error: "language/statements/for/dstr/let-ary-ptrn-rest-init-obj.js
|
|||
Expect Syntax Error: "language/statements/for/dstr/var-ary-ptrn-rest-init-ary.js"
|
||||
Expect Syntax Error: "language/statements/for/dstr/var-ary-ptrn-rest-init-id.js"
|
||||
Expect Syntax Error: "language/statements/for/dstr/var-ary-ptrn-rest-init-obj.js"
|
||||
Expect Syntax Error: "language/statements/for/head-const-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for/head-let-bound-names-in-stmt.js"
|
||||
Expect Syntax Error: "language/statements/for/labelled-fn-stmt-const.js"
|
||||
Expect Syntax Error: "language/statements/for/labelled-fn-stmt-expr.js"
|
||||
Expect Syntax Error: "language/statements/for/labelled-fn-stmt-let.js"
|
||||
|
|
@ -1162,7 +1121,6 @@ Expect Syntax Error: "language/statements/labeled/decl-fun-strict.js"
|
|||
Expect Syntax Error: "language/statements/let/dstr/ary-ptrn-rest-init-ary.js"
|
||||
Expect Syntax Error: "language/statements/let/dstr/ary-ptrn-rest-init-id.js"
|
||||
Expect Syntax Error: "language/statements/let/dstr/ary-ptrn-rest-init-obj.js"
|
||||
Expect Syntax Error: "language/statements/let/redeclaration-error-from-within-strict-mode-function.js"
|
||||
Expect Syntax Error: "language/statements/let/static-init-await-binding-invalid.js"
|
||||
Expect Syntax Error: "language/statements/return/S12.9_A1_T1.js"
|
||||
Expect Syntax Error: "language/statements/return/S12.9_A1_T10.js"
|
||||
|
|
@ -1193,19 +1151,12 @@ Expect Syntax Error: "language/statements/switch/syntax/redeclaration/async-gene
|
|||
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-const.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/class-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/class-name-redeclaration-attempt-with-var.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-class.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-const.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/const-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/const-name-redeclaration-attempt-with-var.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"
|
||||
|
|
@ -1224,19 +1175,12 @@ Expect Syntax Error: "language/statements/switch/syntax/redeclaration/generator-
|
|||
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-class.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-const.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/let-name-redeclaration-attempt-with-let.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/let-name-redeclaration-attempt-with-var.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-class.js"
|
||||
Expect Syntax Error: "language/statements/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-const.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/switch/syntax/redeclaration/var-name-redeclaration-attempt-with-let.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"
|
||||
|
|
@ -1727,6 +1671,243 @@ 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-const.js:21:1]
|
||||
21 │
|
||||
22 │ { class 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/class-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ { class 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/class-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ { class 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/const-name-redeclaration-attempt-with-class.js:21:1]
|
||||
21 │
|
||||
22 │ { const f = 0; 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/const-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ { const f = 0; 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/const-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ { const f = 0; 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/const-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ { const f = 0; 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/fn-scope-var-name-redeclaration-attempt-with-class.js:22:1]
|
||||
22 │ function x() {
|
||||
23 │ { class 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-const.js:22:1]
|
||||
22 │ function x() {
|
||||
23 │ { const f = 0; 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-let.js:22:1]
|
||||
22 │ function x() {
|
||||
23 │ { let 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/inner-block-var-name-redeclaration-attempt-with-class.js:37:1]
|
||||
37 │
|
||||
38 │ { { var 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/inner-block-var-name-redeclaration-attempt-with-const.js:37:1]
|
||||
37 │
|
||||
38 │ { { var 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/inner-block-var-name-redeclaration-attempt-with-let.js:37:1]
|
||||
37 │
|
||||
38 │ { { var 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/inner-block-var-redeclaration-attempt-after-class.js:37:1]
|
||||
37 │
|
||||
38 │ { class 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-const.js:37:1]
|
||||
37 │
|
||||
38 │ { const f = 0; { 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 │
|
||||
38 │ { let 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/let-name-redeclaration-attempt-with-class.js:21:1]
|
||||
21 │
|
||||
22 │ { let 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/let-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ { let 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/let-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ { let 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/let-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ { let 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-name-redeclaration-attempt-with-class.js:21:1]
|
||||
21 │
|
||||
22 │ { var 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/var-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ { var 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/var-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ { var 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/var-redeclaration-attempt-after-class.js:21:1]
|
||||
21 │
|
||||
22 │ { class 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-const.js:21:1]
|
||||
21 │
|
||||
22 │ { const f = 0; 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 │
|
||||
22 │ { let f; var f; }
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `f` has already been declared here
|
||||
╰────
|
||||
|
||||
× Unterminated multiline comment
|
||||
╭─[language/comments/S7.4_A2_T2.js:14:1]
|
||||
14 │
|
||||
|
|
@ -15496,6 +15677,17 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
18 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/module-code/early-dup-lex.js:16:1]
|
||||
16 │
|
||||
17 │ let x;
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ const x = 0;
|
||||
· ┬
|
||||
· ╰── 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'
|
||||
|
|
@ -15523,6 +15715,17 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
24 │
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/module-code/early-lex-and-var.js:16:1]
|
||||
16 │
|
||||
17 │ let x;
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
╰────
|
||||
|
||||
× The keyword '"public"' is reserved
|
||||
╭─[language/module-code/early-strict-mode.js:14:1]
|
||||
14 │
|
||||
|
|
@ -20627,6 +20830,30 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
22 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/class/static-init-invalid-lex-dup.js:20:1]
|
||||
20 │ static {
|
||||
21 │ let x;
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
22 │ let x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
23 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/class/static-init-invalid-lex-var.js:21:1]
|
||||
21 │ static {
|
||||
22 │ let x;
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
23 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
24 │ }
|
||||
╰────
|
||||
|
||||
× Jump target cannot cross function boundary.
|
||||
╭─[language/statements/class/static-init-invalid-undefined-break-target.js:21:1]
|
||||
21 │ x: while (false) {
|
||||
|
|
@ -20726,6 +20953,16 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
31 │
|
||||
╰────
|
||||
|
||||
× Identifier `"f"` has already been declared
|
||||
╭─[language/statements/const/redeclaration-error-from-within-strict-mode-function-const.js:13:1]
|
||||
13 │ $DONOTEVALUATE();
|
||||
14 │ (function() { 'use strict'; { const f = 1; var f; } })
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `f` has already been declared here
|
||||
15 │
|
||||
╰────
|
||||
|
||||
× Missing initializer in const declaration
|
||||
╭─[language/statements/const/syntax/block-scope-syntax-const-declarations-mixed-with-without-initialiser.js:12:1]
|
||||
12 │ $DONOTEVALUATE();
|
||||
|
|
@ -21880,6 +22117,27 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
34 │ ]) ;
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-in/head-const-bound-names-dup.js:16:1]
|
||||
16 │
|
||||
17 │ for (const [x, x] in {}) {}
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `x` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-in/head-const-bound-names-in-stmt.js:16:1]
|
||||
16 │
|
||||
17 │ for (const x in {}) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
19 │ }
|
||||
╰────
|
||||
|
||||
× `let` cannot be declared as a variable name inside of a `"const"` declaration
|
||||
╭─[language/statements/for-in/head-const-bound-names-let.js:16:1]
|
||||
16 │
|
||||
|
|
@ -21887,6 +22145,27 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
· ───
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-in/head-let-bound-names-dup.js:16:1]
|
||||
16 │
|
||||
17 │ for (let [x, x] in {}) {}
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `x` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-in/head-let-bound-names-in-stmt.js:16:1]
|
||||
16 │
|
||||
17 │ for (let x in {}) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
19 │ }
|
||||
╰────
|
||||
|
||||
× `let` cannot be declared as a variable name inside of a `"let"` declaration
|
||||
╭─[language/statements/for-in/head-let-bound-names-let.js:16:1]
|
||||
16 │
|
||||
|
|
@ -22307,6 +22586,27 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
· ╰── keyword cannot contain escape characters
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-of/head-const-bound-names-dup.js:16:1]
|
||||
16 │
|
||||
17 │ for (const [x, x] of []) {}
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `x` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-of/head-const-bound-names-in-stmt.js:16:1]
|
||||
16 │
|
||||
17 │ for (const x of []) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
19 │ }
|
||||
╰────
|
||||
|
||||
× `let` cannot be declared as a variable name inside of a `"const"` declaration
|
||||
╭─[language/statements/for-of/head-const-bound-names-let.js:16:1]
|
||||
16 │
|
||||
|
|
@ -22330,6 +22630,27 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
· ╰── Expect `)` here, but found `,`
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-of/head-let-bound-names-dup.js:16:1]
|
||||
16 │
|
||||
17 │ for (let [x, x] of []) {}
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `x` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for-of/head-let-bound-names-in-stmt.js:16:1]
|
||||
16 │
|
||||
17 │ for (let x of []) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
18 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
19 │ }
|
||||
╰────
|
||||
|
||||
× `let` cannot be declared as a variable name inside of a `"let"` declaration
|
||||
╭─[language/statements/for-of/head-let-bound-names-let.js:16:1]
|
||||
16 │
|
||||
|
|
@ -22680,6 +23001,30 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
46 │
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for/head-const-bound-names-in-stmt.js:19:1]
|
||||
19 │
|
||||
20 │ for (const x = 0; false; ) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
21 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
22 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"x"` has already been declared
|
||||
╭─[language/statements/for/head-let-bound-names-in-stmt.js:19:1]
|
||||
19 │
|
||||
20 │ for (let x; false; ) {
|
||||
· ┬
|
||||
· ╰── `x` has already been declared here
|
||||
21 │ var x;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
22 │ }
|
||||
╰────
|
||||
|
||||
× Lexical declaration cannot appear in a single-statement context
|
||||
╭─[language/statements/for/let-array-with-newline.js:19:1]
|
||||
19 │
|
||||
|
|
@ -23481,6 +23826,16 @@ Expect to Parse: "language/statements/class/decorator/syntax/valid/decorator-par
|
|||
31 │
|
||||
╰────
|
||||
|
||||
× Identifier `"f"` has already been declared
|
||||
╭─[language/statements/let/redeclaration-error-from-within-strict-mode-function.js:13:1]
|
||||
13 │ $DONOTEVALUATE();
|
||||
14 │ (function() { 'use strict'; { let f; var f; } })
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `f` has already been declared here
|
||||
15 │
|
||||
╰────
|
||||
|
||||
× The keyword '"let"' is reserved
|
||||
╭─[language/statements/let/syntax/identifier-let-allowed-as-lefthandside-expression-strict.js:15:1]
|
||||
15 │ var o = { a: 1 };
|
||||
|
|
@ -23699,6 +24054,132 @@ 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-const.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: class 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/class-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: class 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/class-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: class 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/const-name-redeclaration-attempt-with-class.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: const f = 0; 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/const-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: const f = 0; 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/const-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: const f = 0; 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/const-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: const f = 0; 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-class.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: let 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/let-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: let 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/let-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: let 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/let-name-redeclaration-attempt-with-var.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: let 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/var-name-redeclaration-attempt-with-class.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: var 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/var-name-redeclaration-attempt-with-const.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: var 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/var-name-redeclaration-attempt-with-let.js:21:1]
|
||||
21 │
|
||||
22 │ switch (0) { case 1: var f; default: let f }
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `f` has already been declared here
|
||||
╰────
|
||||
|
||||
× Expect token
|
||||
╭─[language/statements/try/S12.14_A16_T1.js:17:1]
|
||||
17 │ // CHECK#1
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
TypeScript Summary:
|
||||
AST Parsed : 2308/2338 (98.72%)
|
||||
Positive Passed: 2308/2338 (98.72%)
|
||||
Negative Passed: 580/2532 (22.91%)
|
||||
AST Parsed : 2306/2338 (98.63%)
|
||||
Positive Passed: 2306/2338 (98.63%)
|
||||
Negative Passed: 587/2532 (23.18%)
|
||||
Expect Syntax Error: "Symbols/ES5SymbolProperty2.ts"
|
||||
Expect Syntax Error: "Symbols/ES5SymbolProperty6.ts"
|
||||
Expect Syntax Error: "additionalChecks/noPropertyAccessFromIndexSignature1.ts"
|
||||
|
|
@ -91,7 +91,6 @@ Expect Syntax Error: "classes/classDeclarations/classAbstractKeyword/classAbstra
|
|||
Expect Syntax Error: "classes/classDeclarations/classAbstractKeyword/classAbstractUsingAbstractMethods2.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classAbstractKeyword/classAbstractWithInterface.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classAndInterfaceMergeConflictingMembers.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classAndVariableWithSameName.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classExtendingClassLikeType.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classExtendingNonConstructor.ts"
|
||||
Expect Syntax Error: "classes/classDeclarations/classHeritageSpecification/classExtendsItself.ts"
|
||||
|
|
@ -512,7 +511,6 @@ Expect Syntax Error: "es6/destructuring/destructuringParameterProperties2.ts"
|
|||
Expect Syntax Error: "es6/destructuring/destructuringParameterProperties3.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringParameterProperties4.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringParameterProperties5.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringSameNames.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringSpread.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringTypeAssertionsES5_1.ts"
|
||||
Expect Syntax Error: "es6/destructuring/destructuringTypeAssertionsES5_2.ts"
|
||||
|
|
@ -570,8 +568,6 @@ Expect Syntax Error: "es6/for-ofStatements/for-of39.ts"
|
|||
Expect Syntax Error: "es6/for-ofStatements/for-of46.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of47.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of48.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of52.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of54.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of55.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of6.ts"
|
||||
Expect Syntax Error: "es6/for-ofStatements/for-of7.ts"
|
||||
|
|
@ -958,7 +954,6 @@ Expect Syntax Error: "internalModules/importDeclarations/shadowedInternalModule.
|
|||
Expect Syntax Error: "internalModules/moduleBody/invalidModuleWithStatementsOfEveryKind.ts"
|
||||
Expect Syntax Error: "internalModules/moduleBody/invalidModuleWithVarStatements.ts"
|
||||
Expect Syntax Error: "internalModules/moduleDeclarations/InvalidNonInstantiatedModule.ts"
|
||||
Expect Syntax Error: "internalModules/moduleDeclarations/invalidInstantiatedModule.ts"
|
||||
Expect Syntax Error: "internalModules/moduleDeclarations/invalidNestedModules.ts"
|
||||
Expect Syntax Error: "jsdoc/assertionsAndNonReturningFunctions.ts"
|
||||
Expect Syntax Error: "jsdoc/callOfPropertylessConstructorFunction.ts"
|
||||
|
|
@ -1497,8 +1492,6 @@ Expect Syntax Error: "salsa/moduleExportAliasUnknown.ts"
|
|||
Expect Syntax Error: "salsa/moduleExportsAliasLoop1.ts"
|
||||
Expect Syntax Error: "salsa/moduleExportsAliasLoop2.ts"
|
||||
Expect Syntax Error: "salsa/multipleDeclarations.ts"
|
||||
Expect Syntax Error: "salsa/plainJSRedeclare.ts"
|
||||
Expect Syntax Error: "salsa/plainJSRedeclare2.ts"
|
||||
Expect Syntax Error: "salsa/plainJSReservedStrict.ts"
|
||||
Expect Syntax Error: "salsa/propertyAssignmentOnUnresolvedImportedSymbol.ts"
|
||||
Expect Syntax Error: "salsa/propertyAssignmentUseParentType2.ts"
|
||||
|
|
@ -1995,6 +1988,19 @@ Expect to Parse: "classes/propertyMemberDeclarations/staticPropertyNameConflicts
|
|||
· ╰── Classes may not have a static property named prototype
|
||||
33 │ prototype(): any; // ok
|
||||
╰────
|
||||
Expect to Parse: "es6/for-ofStatements/for-of53.ts"
|
||||
|
||||
× Identifier `"v"` has already been declared
|
||||
╭─[es6/for-ofStatements/for-of53.ts:1:1]
|
||||
1 │ //@target: ES6
|
||||
2 │ for (let v of []) {
|
||||
· ┬
|
||||
· ╰── `v` has already been declared here
|
||||
3 │ var v;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ }
|
||||
╰────
|
||||
Expect to Parse: "esDecorators/classExpression/classSuper/esDecorators-classExpression-classSuper.1.ts"
|
||||
|
||||
× Unexpected token
|
||||
|
|
@ -2250,6 +2256,19 @@ Expect to Parse: "jsx/tsxReactEmitSpreadAttribute.ts"
|
|||
· ╰── Expect `>` here, but found `Identifier`
|
||||
8 │ }
|
||||
╰────
|
||||
Expect to Parse: "salsa/plainJSRedeclare3.ts"
|
||||
|
||||
× Identifier `"orbitol"` has already been declared
|
||||
╭─[salsa/plainJSRedeclare3.ts:4:1]
|
||||
4 │ // @filename: plainJSRedeclare.js
|
||||
5 │ const orbitol = 1
|
||||
· ───┬───
|
||||
· ╰── `orbitol` has already been declared here
|
||||
6 │ var orbitol = 1 + false
|
||||
· ───┬───
|
||||
· ╰── It can not be redeclared here
|
||||
7 │ orbitol.toExponential()
|
||||
╰────
|
||||
Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
||||
|
||||
× Private identifier '#"bar"' is not allowed outside class bodies
|
||||
|
|
@ -2530,6 +2549,32 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
17 │ }
|
||||
╰────
|
||||
|
||||
× Identifier `"C"` has already been declared
|
||||
╭─[classes/classDeclarations/classAndVariableWithSameName.ts:1:1]
|
||||
1 │ class C { foo: string; } // error
|
||||
· ┬
|
||||
· ╰── `C` has already been declared here
|
||||
2 │ var C = ''; // error
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
3 │
|
||||
╰────
|
||||
|
||||
× Identifier `"D"` has already been declared
|
||||
╭─[classes/classDeclarations/classAndVariableWithSameName.ts:4:1]
|
||||
4 │ module M {
|
||||
5 │ class D { // error
|
||||
· ┬
|
||||
· ╰── `D` has already been declared here
|
||||
6 │ bar: string;
|
||||
7 │ }
|
||||
8 │
|
||||
9 │ var D = 1; // error
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
10 │ }
|
||||
╰────
|
||||
|
||||
× Automatic Semicolon Insertion
|
||||
╭─[classes/classDeclarations/classBody/classBodyWithStatements.ts:1:1]
|
||||
1 │ class C {
|
||||
|
|
@ -4448,6 +4493,85 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
8 │ function a1({public}) { }
|
||||
╰────
|
||||
|
||||
× Identifier `"foo1"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:20:1]
|
||||
20 │
|
||||
21 │ let { foo1, foo1 } = { foo1: 10 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo1` has already been declared here
|
||||
22 │ let { foo2, bar2: foo2 } = { foo2: 20, bar2: 220 };
|
||||
╰────
|
||||
|
||||
× Identifier `"foo2"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:21:1]
|
||||
21 │ let { foo1, foo1 } = { foo1: 10 };
|
||||
22 │ let { foo2, bar2: foo2 } = { foo2: 20, bar2: 220 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo2` has already been declared here
|
||||
23 │ let { bar3: foo3, foo3 } = { foo3: 30, bar3: 330 };
|
||||
╰────
|
||||
|
||||
× Identifier `"foo3"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:22:1]
|
||||
22 │ let { foo2, bar2: foo2 } = { foo2: 20, bar2: 220 };
|
||||
23 │ let { bar3: foo3, foo3 } = { foo3: 30, bar3: 330 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo3` has already been declared here
|
||||
24 │ const { foo4, foo4 } = { foo4: 40 };
|
||||
╰────
|
||||
|
||||
× Identifier `"foo4"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:23:1]
|
||||
23 │ let { bar3: foo3, foo3 } = { foo3: 30, bar3: 330 };
|
||||
24 │ const { foo4, foo4 } = { foo4: 40 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo4` has already been declared here
|
||||
25 │ const { foo5, bar5: foo5 } = { foo5: 50, bar5: 550 };
|
||||
╰────
|
||||
|
||||
× Identifier `"foo5"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:24:1]
|
||||
24 │ const { foo4, foo4 } = { foo4: 40 };
|
||||
25 │ const { foo5, bar5: foo5 } = { foo5: 50, bar5: 550 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo5` has already been declared here
|
||||
26 │ const { bar6: foo6, foo6 } = { foo6: 60, bar6: 660 };
|
||||
╰────
|
||||
|
||||
× Identifier `"foo6"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:25:1]
|
||||
25 │ const { foo5, bar5: foo5 } = { foo5: 50, bar5: 550 };
|
||||
26 │ const { bar6: foo6, foo6 } = { foo6: 60, bar6: 660 };
|
||||
· ──┬─ ──┬─
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `foo6` has already been declared here
|
||||
27 │
|
||||
╰────
|
||||
|
||||
× Identifier `"blah1"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:27:1]
|
||||
27 │
|
||||
28 │ let [blah1, blah1] = [111, 222];
|
||||
· ──┬── ──┬──
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `blah1` has already been declared here
|
||||
29 │ const [blah2, blah2] = [333, 444];
|
||||
╰────
|
||||
|
||||
× Identifier `"blah2"` has already been declared
|
||||
╭─[es6/destructuring/destructuringSameNames.ts:28:1]
|
||||
28 │ let [blah1, blah1] = [111, 222];
|
||||
29 │ const [blah2, blah2] = [333, 444];
|
||||
· ──┬── ──┬──
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `blah2` has already been declared here
|
||||
╰────
|
||||
|
||||
× Missing initializer in destructuring declaration
|
||||
╭─[es6/destructuring/emptyVariableDeclarationBindingPatterns02_ES5.ts:4:1]
|
||||
4 │ (function () {
|
||||
|
|
@ -4680,6 +4804,27 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
· ───
|
||||
╰────
|
||||
|
||||
× Identifier `"v"` has already been declared
|
||||
╭─[es6/for-ofStatements/for-of52.ts:1:1]
|
||||
1 │ //@target: ES6
|
||||
2 │ for (let [v, v] of [[]]) {}
|
||||
· ┬ ┬
|
||||
· │ ╰── It can not be redeclared here
|
||||
· ╰── `v` has already been declared here
|
||||
╰────
|
||||
|
||||
× Identifier `"v"` has already been declared
|
||||
╭─[es6/for-ofStatements/for-of54.ts:1:1]
|
||||
1 │ //@target: ES6
|
||||
2 │ for (let v of []) {
|
||||
· ┬
|
||||
· ╰── `v` has already been declared here
|
||||
3 │ var v = 0;
|
||||
· ┬
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ }
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[es6/functionPropertyAssignments/FunctionPropertyAssignments2_es6.ts:1:1]
|
||||
1 │ // @target: es6
|
||||
|
|
@ -5947,6 +6092,18 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
4 │ let;
|
||||
╰────
|
||||
|
||||
× Identifier `"Point"` has already been declared
|
||||
╭─[internalModules/moduleDeclarations/invalidInstantiatedModule.ts:1:1]
|
||||
1 │ module M {
|
||||
2 │ export class Point { x: number; y: number }
|
||||
· ──┬──
|
||||
· ╰── `Point` has already been declared here
|
||||
3 │ export var Point = 1; // Error
|
||||
· ──┬──
|
||||
· ╰── It can not be redeclared here
|
||||
4 │ }
|
||||
╰────
|
||||
|
||||
× Unexpected token
|
||||
╭─[jsdoc/jsdocDisallowedInTypescript.ts:3:1]
|
||||
3 │ // grammar error from checker
|
||||
|
|
@ -8070,6 +8227,30 @@ Expect to Parse: "salsa/privateIdentifierExpando.ts"
|
|||
10 │ #p
|
||||
╰────
|
||||
|
||||
× Identifier `"orbitol"` has already been declared
|
||||
╭─[salsa/plainJSRedeclare.ts:3:1]
|
||||
3 │ // @filename: plainJSRedeclare.js
|
||||
4 │ const orbitol = 1
|
||||
· ───┬───
|
||||
· ╰── `orbitol` has already been declared here
|
||||
5 │ var orbitol = 1 + false
|
||||
· ───┬───
|
||||
· ╰── It can not be redeclared here
|
||||
6 │ orbitol.toExponential()
|
||||
╰────
|
||||
|
||||
× Identifier `"orbitol"` has already been declared
|
||||
╭─[salsa/plainJSRedeclare2.ts:4:1]
|
||||
4 │ // @filename: plainJSRedeclare.js
|
||||
5 │ const orbitol = 1
|
||||
· ───┬───
|
||||
· ╰── `orbitol` has already been declared here
|
||||
6 │ var orbitol = 1 + false
|
||||
· ───┬───
|
||||
· ╰── It can not be redeclared here
|
||||
7 │ orbitol.toExponential()
|
||||
╰────
|
||||
|
||||
× Automatic Semicolon Insertion
|
||||
╭─[scanner/ecmascript3/scannerES3NumericLiteral3.ts:1:1]
|
||||
1 │ 01.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue