Merge branch 'bocoup/for-restrictions'

This commit is contained in:
Gorkem Yakin 2016-02-25 14:22:09 -08:00
commit 5a77ac86a9
57 changed files with 727 additions and 0 deletions

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
do label1: label2: function f() {} while (false)

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may not contain duplicate entries
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains any
duplicate entries.
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (const [x, x] in {}) {}

View File

@ -0,0 +1,15 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
negative: SyntaxError
info: |
It is a Syntax Error if any element of the BoundNames of ForDeclaration
also occurs in the VarDeclaredNames of Statement.
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (const x in {}) {
var x;
}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The declaration may not contain a binding for `let`
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains "let".
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
flags: [noStrict]
---*/
for (const let in {}) {}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may not contain duplicate entries
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains any
duplicate entries.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
for (let [x, x] in {}) {}

View File

@ -0,0 +1,15 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
negative: SyntaxError
info: |
It is a Syntax Error if any element of the BoundNames of ForDeclaration
also occurs in the VarDeclaredNames of Statement.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
for (let x in {}) {
var x;
}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The declaration may not contain a binding for `let`
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains "let".
flags: [noStrict]
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (let let in {}) {}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Head's LeftHandSideExpression must be a simple assignment target
info: >
It is a Syntax Error if IsValidSimpleAssignmentTarget of
LeftHandSideExpression is false.
It is a Syntax Error if the LeftHandSideExpression is
CoverParenthesizedExpressionAndArrowParameterList : ( Expression ) and
Expression derives a production that would produce a Syntax Error according
to these rules if that production is substituted for
LeftHandSideExpression. This rule is recursively applied.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ((this) in {}) {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Head's AssignmentExpression may be CoverParenthesizedExpressionAndArrowParameterList
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
var x;
for ((x) in { attr: null }) {
assert.sameValue(x, 'attr');
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,16 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Invalid destructuring assignment pattern (array literal)
info: >
It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral
or an ArrayLiteral and if the lexical token sequence matched by
LeftHandSideExpression cannot be parsed with no tokens left over using
AssignmentPattern as the goal symbol.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ([(x, y)] in {}) {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Invalid destructuring assignment pattern (object literal)
info: >
It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral
or an ArrayLiteral and if the lexical token sequence matched by
LeftHandSideExpression cannot be parsed with no tokens left over using
AssignmentPattern as the goal symbol.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ({ m() {} } in {}) {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Head's AssignmentExpression may be a MemberExpression
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
var x = {};
for (x.y in { attr: null }) {
assert.sameValue(x.y, 'attr');
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Head's LeftHandSideExpression must be a simple assignment target
info: >
It is a Syntax Error if IsValidSimpleAssignmentTarget of
LeftHandSideExpression is false.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for (this in {}) {}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may contain duplicate entries
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
for (var [x, x] in { ab: null }) {
assert.sameValue(x, 'b');
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may re-declare variables declared in the head
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
for (var x in { attr: null }) {
var x;
assert.sameValue(x, 'attr');
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's bound names may include "let"
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
flags: [noStrict]
---*/
var iterCount = 0;
for (var let in { attr: null }) {
assert.sameValue(let, 'attr');
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (const x in {}) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (let x in {}) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (x in {}) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (var x in {}) label1: label2: function f() {}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may not contain duplicate entries
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains any
duplicate entries.
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (const [x, x] of []) {}

View File

@ -0,0 +1,15 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
negative: SyntaxError
info: |
It is a Syntax Error if any element of the BoundNames of ForDeclaration
also occurs in the VarDeclaredNames of Statement.
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (const x of []) {
var x;
}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The declaration may not contain a binding for `let`
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains "let".
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
flags: [noStrict]
---*/
for (const let of []) {}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may not contain duplicate entries
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains any
duplicate entries.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
for (let [x, x] of []) {}

View File

@ -0,0 +1,15 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
negative: SyntaxError
info: |
It is a Syntax Error if any element of the BoundNames of ForDeclaration
also occurs in the VarDeclaredNames of Statement.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
for (let x of []) {
var x;
}

View File

@ -0,0 +1,13 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The declaration may not contain a binding for `let`
negative: SyntaxError
info: |
It is a Syntax Error if the BoundNames of ForDeclaration contains "let".
flags: [noStrict]
esid: sec-for-in-and-for-of-statements
es6id: 13.7.5
---*/
for (let let of []) {}

View File

@ -0,0 +1,20 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Head's LeftHandSideExpression must be a simple assignment target
info: >
It is a Syntax Error if IsValidSimpleAssignmentTarget of
LeftHandSideExpression is false.
It is a Syntax Error if the LeftHandSideExpression is
CoverParenthesizedExpressionAndArrowParameterList : ( Expression ) and
Expression derives a production that would produce a Syntax Error according
to these rules if that production is substituted for
LeftHandSideExpression. This rule is recursively applied.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ((this) of []) {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Head's AssignmentExpression may be CoverParenthesizedExpressionAndArrowParameterList
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
var x;
for ((x) of [23]) {
assert.sameValue(x, 23);
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,16 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Invalid destructuring assignment pattern (array literal)
info: >
It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral
or an ArrayLiteral and if the lexical token sequence matched by
LeftHandSideExpression cannot be parsed with no tokens left over using
AssignmentPattern as the goal symbol.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ([(x, y)] of []) {}

View File

@ -0,0 +1,16 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Invalid destructuring assignment pattern (object literal)
info: >
It is a Syntax Error if LeftHandSideExpression is either an ObjectLiteral
or an ArrayLiteral and if the lexical token sequence matched by
LeftHandSideExpression cannot be parsed with no tokens left over using
AssignmentPattern as the goal symbol.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for ({ m() {} } of []) {}

View File

@ -0,0 +1,19 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Head's AssignmentExpression may be a MemberExpression
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
var x = {};
for (x.y of [23]) {
assert.sameValue(x.y, 23);
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Head's LeftHandSideExpression must be a simple assignment target
info: >
It is a Syntax Error if IsValidSimpleAssignmentTarget of
LeftHandSideExpression is false.
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
negative: SyntaxError
---*/
for (this of []) {}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's declaration may contain duplicate entries
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
for (var [x, x] of [[1, 2]]) {
assert.sameValue(x, 2);
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may re-declare variables declared in the head
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
---*/
var iterCount = 0;
for (var x of [99]) {
var x;
assert.sameValue(x, 99);
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The head's bound names may include "let"
esid: sec-for-in-and-for-of-statements-static-semantics-early-errors
es6id: 13.7.5
flags: [noStrict]
---*/
var iterCount = 0;
for (var let of [23]) {
assert.sameValue(let, 23);
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (const x of []) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (let x of []) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (x of []) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (var x of []) label1: label2: function f() {}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
It is a Syntax Error if any element of the BoundNames of LexicalDeclaration
also occurs in the VarDeclaredNames of Statement.
negative: SyntaxError
esid: sec-for-statement
es6id: 13.7.4
---*/
for (const x; false; ) {
var x;
}

View File

@ -0,0 +1,18 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may not re-declare variables declared in the head
info: |
IterationStatement :
for ( LexicalDeclaration Expressionopt ; Expressionopt ) Statement
It is a Syntax Error if any element of the BoundNames of LexicalDeclaration
also occurs in the VarDeclaredNames of Statement.
negative: SyntaxError
esid: sec-for-statement
es6id: 13.7.4
---*/
for (let x; false; ) {
var x;
}

View File

@ -0,0 +1,17 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: The body may re-declare variables declared in the head
esid: sec-for-statement
es6id: 13.7.4
---*/
var iterCount = 0;
var first = true;
for (var x; first; first = false) {
var x;
iterCount += 1;
}
assert.sameValue(iterCount, 1);

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (const x; false; ) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for ( ; false; ) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (let x; false; ) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
for (var x; false; ) label1: label2: function f() {}

View File

@ -0,0 +1,14 @@
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: It is a Syntax Error if IsLabelledFunction(Statement) is true.
negative: SyntaxError
esid: sec-semantics-static-semantics-early-errors
es6id: 13.7.1.1
info: >
Although Annex B describes an extension which permits labelled function
declarations outside of strict mode, this early error is applied regardless
of the language mode.
---*/
while (false) label1: label2: function f() {}