Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lexical redeclarations in block- and switch-statements #1023

Merged
merged 4 commits into from
May 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }
Original file line number Diff line number Diff line change
@@ -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 }*/ }