diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..4a06bf44b8 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +{ async function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..5327ac0fbe --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +{ async function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..0fd13ee658 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ class f {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..0c9d092a8e --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ const f = 0; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..bf954a75e7 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +{ function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..f991d228a8 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..592556b0f9 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ let f; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..50f548934e --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ var f; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..57a185a7cc --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +switch (0) { case 1: async function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..6d67152339 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +switch (0) { case 1: async function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..0e8888e4b8 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: class f {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..9829abbf68 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: const f = 0; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..7ad3eede2a --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [onlyStrict] +---*/ + +switch (0) { case 1: function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..5fb499613f --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..f11a6dc158 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: let f; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..dd83e6bcd2 --- /dev/null +++ b/src/declarations/redeclare-allow-sloppy-function/switch-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: var f; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..2349e07a3d --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +{ async function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..ed2adc2d6c --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +{ async function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..4cadafbd71 --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ class f {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..711fdf4225 --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ const f = 0; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..9e8ee15f50 --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..f4a49b40c1 --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..57f5bebe99 --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ let f; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..cdb73b1e4a --- /dev/null +++ b/src/declarations/redeclare-allow-var/block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +---*/ + +{ var f; /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..6317cd26f0 --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +switch (0) { case 1: async function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..7b8c6b0b92 --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +switch (0) { case 1: async function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..2462d78ede --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: class f {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..8361a53a78 --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: const f = 0; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..12da4af5c2 --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..029076ae5b --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..18fb61d17e --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: let f; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..462c5647c0 --- /dev/null +++ b/src/declarations/redeclare-allow-var/switch-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,15 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +---*/ + +switch (0) { case 1: var f; default: /*{ body }*/ } diff --git a/src/declarations/redeclare-with-async-function-declaration.case b/src/declarations/redeclare-with-async-function-declaration.case new file mode 100644 index 0000000000..cf74b701d3 --- /dev/null +++ b/src/declarations/redeclare-with-async-function-declaration.case @@ -0,0 +1,12 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with AsyncFunctionDeclaration +template: redeclare +flags: [async-functions] +---*/ + +//- body + async function f() {} diff --git a/src/declarations/redeclare-with-async-generator-declaration.case b/src/declarations/redeclare-with-async-generator-declaration.case new file mode 100644 index 0000000000..7f2638d2a1 --- /dev/null +++ b/src/declarations/redeclare-with-async-generator-declaration.case @@ -0,0 +1,12 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with AsyncGeneratorDeclaration +template: redeclare +flags: [async-iteration] +---*/ + +//- body + async function* f() {} diff --git a/src/declarations/redeclare-with-class-declaration.case b/src/declarations/redeclare-with-class-declaration.case new file mode 100644 index 0000000000..96d73ad4fe --- /dev/null +++ b/src/declarations/redeclare-with-class-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with ClassDeclaration +template: redeclare +---*/ + +//- body + class f {}; diff --git a/src/declarations/redeclare-with-const-declaration.case b/src/declarations/redeclare-with-const-declaration.case new file mode 100644 index 0000000000..0ca9e32c84 --- /dev/null +++ b/src/declarations/redeclare-with-const-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with const-LexicalDeclaration +template: redeclare +---*/ + +//- body + const f = 0; diff --git a/src/declarations/redeclare-with-function-declaration.case b/src/declarations/redeclare-with-function-declaration.case new file mode 100644 index 0000000000..2924d17d9d --- /dev/null +++ b/src/declarations/redeclare-with-function-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with FunctionDeclaration +template: redeclare-allow-sloppy-function +---*/ + +//- body + function f() {} diff --git a/src/declarations/redeclare-with-generator-declaration.case b/src/declarations/redeclare-with-generator-declaration.case new file mode 100644 index 0000000000..91b8398bc7 --- /dev/null +++ b/src/declarations/redeclare-with-generator-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with GeneratorDeclaration +template: redeclare +---*/ + +//- body + function* f() {} diff --git a/src/declarations/redeclare-with-let-declaration.case b/src/declarations/redeclare-with-let-declaration.case new file mode 100644 index 0000000000..f20d89ec39 --- /dev/null +++ b/src/declarations/redeclare-with-let-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with let-LexicalDeclaration +template: redeclare +---*/ + +//- body + let f; diff --git a/src/declarations/redeclare-with-var-declaration.case b/src/declarations/redeclare-with-var-declaration.case new file mode 100644 index 0000000000..e4c493e805 --- /dev/null +++ b/src/declarations/redeclare-with-var-declaration.case @@ -0,0 +1,11 @@ +// Copyright (C) André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +desc: > + redeclaration with VariableDeclaration +template: redeclare-allow-var +---*/ + +//- body + var f; diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..4a06bf44b8 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +{ async function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..5327ac0fbe --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +{ async function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..0fd13ee658 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ class f {} /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..0c9d092a8e --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ const f = 0; /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..f163125379 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ function f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..f991d228a8 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ function* f() {} /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..592556b0f9 --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if the LexicallyDeclaredNames of StatementList contains + any duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +{ let f; /*{ body }*/ } diff --git a/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..50f548934e --- /dev/null +++ b/src/declarations/redeclare/block-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/block-scope/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in BlockStatement +esid: sec-block-static-semantics-early-errors +info: | + Block : { StatementList } + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + StatementList also occurs in the VarDeclaredNames of StatementList. +negative: + phase: early + type: SyntaxError +---*/ + +{ var f; /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-async-function-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-async-function-declaration.template new file mode 100644 index 0000000000..57a185a7cc --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-async-function-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-function-declaration-attempt-to- +name: AsyncFunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-functions] +---*/ + +switch (0) { case 1: async function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-async-generator-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-async-generator-declaration.template new file mode 100644 index 0000000000..6d67152339 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-async-generator-declaration.template @@ -0,0 +1,19 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/async-generator-declaration-attempt-to- +name: AsyncGeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +flags: [async-iteration] +---*/ + +switch (0) { case 1: async function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-class-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-class-declaration.template new file mode 100644 index 0000000000..0e8888e4b8 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-class-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/class-declaration-attempt-to- +name: ClassDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: class f {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-const-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-const-declaration.template new file mode 100644 index 0000000000..9829abbf68 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-const-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/const-declaration-attempt-to- +name: LexicalDeclaration (const) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: const f = 0; default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-function-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-function-declaration.template new file mode 100644 index 0000000000..25e21f00b0 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-function-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/function-declaration-attempt-to- +name: FunctionDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: function f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-generator-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-generator-declaration.template new file mode 100644 index 0000000000..5fb499613f --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-generator-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/generator-declaration-attempt-to- +name: GeneratorDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: function* f() {} default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-let-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-let-declaration.template new file mode 100644 index 0000000000..f11a6dc158 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-let-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/let-declaration-attempt-to- +name: LexicalDeclaration (let) in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if the LexicallyDeclaredNames of CaseBlock contains any + duplicate entries. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: let f; default: /*{ body }*/ } diff --git a/src/declarations/redeclare/switch-attempt-to-redeclare-var-declaration.template b/src/declarations/redeclare/switch-attempt-to-redeclare-var-declaration.template new file mode 100644 index 0000000000..dd83e6bcd2 --- /dev/null +++ b/src/declarations/redeclare/switch-attempt-to-redeclare-var-declaration.template @@ -0,0 +1,18 @@ +// Copyright (C) 2017 André Bargull. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +path: language/statements/switch/syntax/redeclaration/var-declaration-attempt-to- +name: VariableDeclaration in SwitchStatement +esid: sec-switch-statement-static-semantics-early-errors +info: | + SwitchStatement : switch ( Expression ) CaseBlock + + It is a Syntax Error if any element of the LexicallyDeclaredNames of + CaseBlock also occurs in the VarDeclaredNames of CaseBlock. +negative: + phase: early + type: SyntaxError +---*/ + +switch (0) { case 1: var f; default: /*{ body }*/ }