Skip to content
Snippets Groups Projects
Commit 20c38d33 authored by Leo Balter's avatar Leo Balter Committed by Rick Waldron
Browse files

Expand tests for duplicate lexical names of vardeclarednames in the same statementlist

parent 3703d2ba
No related branches found
No related tags found
No related merge requests found
Showing
with 282 additions and 38 deletions
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-2-to-
name: VariableDeclaration in a BlockStatement inside a 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.
Static Semantics: VarDeclaredNames
Block : { }
1. Return a new empty List.
StatementList : StatementList StatementListItem
1. Let names be VarDeclaredNames of StatementList.
2. Append to names the elements of the VarDeclaredNames of StatementListItem.
3. Return names.
StatementListItem : Declaration
1. Return a new empty List.
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ /*{ body }*/ { var f; } }
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to-
name: VariableDeclaration in a BlockStatement inside a 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.
Static Semantics: VarDeclaredNames
Block : { }
1. Return a new empty List.
StatementList : StatementList StatementListItem
1. Let names be VarDeclaredNames of StatementList.
2. Append to names the elements of the VarDeclaredNames of StatementListItem.
3. Return names.
StatementListItem : Declaration
1. Return a new empty List.
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ { var f; } /*{ body }*/ }
// 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-2-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: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ /*{ body }*/; var f; }
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to-
name: VariableDeclaration in BlockStatement inside a function
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: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
function x() {
{ /*{ body }*/; var f; }
}
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to-
name: VariableDeclaration in a BlockStatement inside a 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.
Static Semantics: VarDeclaredNames
Block : { }
1. Return a new empty List.
StatementList : StatementList StatementListItem
1. Let names be VarDeclaredNames of StatementList.
2. Append to names the elements of the VarDeclaredNames of StatementListItem.
3. Return names.
StatementListItem : Declaration
1. Return a new empty List.
---*/
{ { var f; } /*{ body }*/ }
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to-
name: VariableDeclaration in BlockStatement inside a function
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.
---*/
function x() {
{ var f; /*{ body }*/ }
}
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-2-to-
name: VariableDeclaration in a BlockStatement inside a 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.
Static Semantics: VarDeclaredNames
Block : { }
1. Return a new empty List.
StatementList : StatementList StatementListItem
1. Let names be VarDeclaredNames of StatementList.
2. Append to names the elements of the VarDeclaredNames of StatementListItem.
3. Return names.
StatementListItem : Declaration
1. Return a new empty List.
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ /*{ body }*/; { var f; } }
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/inner-block-var-declaration-attempt-to-
name: VariableDeclaration in a BlockStatement inside a 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.
Static Semantics: VarDeclaredNames
Block : { }
1. Return a new empty List.
StatementList : StatementList StatementListItem
1. Let names be VarDeclaredNames of StatementList.
2. Append to names the elements of the VarDeclaredNames of StatementListItem.
3. Return names.
StatementListItem : Declaration
1. Return a new empty List.
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ { var f; } /*{ body }*/; }
// 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-2-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: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ /*{ body }*/; var f; }
// Copyright (C) 2018 Leo Balter. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
path: language/block-scope/syntax/redeclaration/fn-scope-var-declaration-attempt-to-
name: VariableDeclaration in BlockStatement inside a function
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: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
function x() {
{ /*{ body }*/; var f; }
}
......@@ -11,6 +11,5 @@ negative:
$DONOTEVALUATE();
var a;
throw NotEarlyError;
for (a = 0 in {});
for (a = 0 in {});
......@@ -10,6 +10,6 @@ negative:
---*/
$DONOTEVALUATE();
throw NotEarlyError;
for (const a = 0 in {});
......@@ -10,6 +10,6 @@ negative:
---*/
$DONOTEVALUATE();
throw NotEarlyError;
for (let a = 0 in {});
......@@ -11,6 +11,5 @@ flags: [onlyStrict]
---*/
$DONOTEVALUATE();
throw NotEarlyError;
for (var a = 0 in {});
for (var a = 0 in {});
......@@ -10,6 +10,5 @@ negative:
---*/
$DONOTEVALUATE();
throw NotEarlyError;
for (var [a] = 0 in {});
for (var [a] = 0 in {});
......@@ -10,6 +10,6 @@ negative:
---*/
$DONOTEVALUATE();
throw NotEarlyError;
for (var {a} = 0 in {});
// Copyright (C) 2011 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.3.3
description: >
redeclaration within block:
attempt to redeclare let binding with function declaration
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ let f; function f() {} }
// Copyright (C) 2011 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
es6id: B.3.3
description: >
redeclaration within block:
attempt to redeclare let binding with var
negative:
phase: parse
type: SyntaxError
---*/
$DONOTEVALUATE();
{ let f; var f; }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment