mirror of https://github.com/tc39/test262.git
Merge pull request #541 from bocoup/statement-decl
Add syntax tests for declaration restrictions
This commit is contained in:
commit
ba26b7f2dc
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-do-while-statement
|
||||||
|
es6id: 13.7.2
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do class C {} while (false)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-do-while-statement
|
||||||
|
es6id: 13.7.2
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do const x = null; while (false)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-do-while-statement
|
||||||
|
es6id: 13.7.2
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do function f() {} while (false)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-do-while-statement
|
||||||
|
es6id: 13.7.2
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do function* g() {} while (false)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-do-while-statement
|
||||||
|
es6id: 13.7.2
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
do let x; while (false)
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in {}) class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in {}) const y = null;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Function declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in {}) function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in {}) function* g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x in {}) let y;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) const y = null;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Function declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) function* g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-for-in-and-for-of-statements
|
||||||
|
es6id: 13.7.5
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for (var x of []) let y;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-for-statement
|
||||||
|
es6id: 13.7.4
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for ( ; false; ) class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-for-statement
|
||||||
|
es6id: 13.7.4
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for ( ; false; ) const x = null;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Function declaration not allowed in statement position
|
||||||
|
esid: sec-for-statement
|
||||||
|
es6id: 13.7.4
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for ( ; false; ) function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-for-statement
|
||||||
|
es6id: 13.7.4
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for ( ; false; ) function* g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-for-statement
|
||||||
|
es6id: 13.7.4
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
for ( ; false; ) let x;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) class C {} else class D {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) class C {} else ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) const x = null; else const y = null;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) const x = null; else ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) const x = null;
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: AnnexB extension not honored in strict mode (IfStatement with a declaration in both statement positions in the global scope)
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
flags: [onlyStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
info: >
|
||||||
|
The following rules for IfStatement augment those in 13.6:
|
||||||
|
|
||||||
|
IfStatement[Yield, Return]:
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
|
||||||
|
if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
|
||||||
|
|
||||||
|
The above rules are only applied when parsing code that is not strict mode code.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function f() {} else function _f() {}
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: AnnexB extension not honored in strict mode (IfStatement with a declaration in the first statement position in the global scope)
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
flags: [onlyStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
info: >
|
||||||
|
The following rules for IfStatement augment those in 13.6:
|
||||||
|
|
||||||
|
IfStatement[Yield, Return]:
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
|
||||||
|
if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
|
||||||
|
|
||||||
|
The above rules are only applied when parsing code that is not strict mode code.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function f() {} else ;
|
|
@ -0,0 +1,21 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: AnnexB extension not honored in strict mode (IfStatement without an else clause in the global scope)
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
flags: [onlyStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
info: >
|
||||||
|
The following rules for IfStatement augment those in 13.6:
|
||||||
|
|
||||||
|
IfStatement[Yield, Return]:
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
|
||||||
|
if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
|
||||||
|
|
||||||
|
The above rules are only applied when parsing code that is not strict mode code.
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function* g() { } else function* _g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function* g() { } else ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) function* g() { }
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) let x; else let y;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) let x; else ;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (true) let x;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) ; else class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) ; else const x = null;
|
|
@ -0,0 +1,25 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: AnnexB extension not honored in strict mode (IfStatement with a declaration in the second statement position in the global scope)
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
flags: [onlyStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
info: >
|
||||||
|
The following rules for IfStatement augment those in 13.6:
|
||||||
|
|
||||||
|
IfStatement[Yield, Return]:
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else Statement[?Yield, ?Return]
|
||||||
|
if ( Expression[In, ?Yield] ) Statement[?Yield, ?Return] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield] else FunctionDeclaration[?Yield]
|
||||||
|
if ( Expression[In, ?Yield] ) FunctionDeclaration[?Yield]
|
||||||
|
|
||||||
|
B.3.3.2 Changes to GlobalDeclarationInstantiation
|
||||||
|
|
||||||
|
1. 1. Let strict be IsStrict of script
|
||||||
|
2. If strict is *false*, then
|
||||||
|
[...]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) ; else function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) ; else function* g() { }
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-if-statement
|
||||||
|
es6id: 13.6
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
if (false) ; else let x;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-labelled-statements
|
||||||
|
es6id: 13.13
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-labelled-statements
|
||||||
|
es6id: 13.13
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: const x = null;
|
|
@ -1,12 +1,13 @@
|
||||||
// Copyright (C) 2011 the V8 project authors. All rights reserved.
|
// Copyright (C) 2011 the V8 project authors. All rights reserved.
|
||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
/*---
|
/*---
|
||||||
es6id: 13.1
|
esid: sec-labelled-statements
|
||||||
|
es6id: 13.13
|
||||||
description: >
|
description: >
|
||||||
function declarations in statement position in strict mode:
|
function declarations in statement position in strict mode:
|
||||||
label: Statement
|
label: Statement
|
||||||
flags: [onlyStrict]
|
flags: [onlyStrict]
|
||||||
negative: SyntaxError
|
negative: SyntaxError
|
||||||
---*/
|
---*/
|
||||||
label: function g() {}
|
|
||||||
|
|
||||||
|
label: function g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-labelled-statements
|
||||||
|
es6id: 13.13
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: function* g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-labelled-statements
|
||||||
|
es6id: 13.13
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
label: let x;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-while-statement
|
||||||
|
es6id: 13.7.3
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) class C {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-while-statement
|
||||||
|
es6id: 13.7.3
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) const x = null;
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Function declaration not allowed in statement position
|
||||||
|
esid: sec-while-statement
|
||||||
|
es6id: 13.7.3
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) function f() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-while-statement
|
||||||
|
es6id: 13.7.3
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) function* g() {}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-while-statement
|
||||||
|
es6id: 13.7.3
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
while (false) let x;
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Class declaration not allowed in statement position
|
||||||
|
esid: sec-with-statement
|
||||||
|
es6id: 13.11
|
||||||
|
flags: [noStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) class C {}
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (const) not allowed in statement position
|
||||||
|
esid: sec-with-statement
|
||||||
|
es6id: 13.11
|
||||||
|
flags: [noStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) const x = null;
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Function declaration not allowed in statement position
|
||||||
|
esid: sec-with-statement
|
||||||
|
es6id: 13.11
|
||||||
|
flags: [noStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) function f() {}
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Generator declaration not allowed in statement position
|
||||||
|
esid: sec-with-statement
|
||||||
|
es6id: 13.11
|
||||||
|
flags: [noStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) function* g() {}
|
|
@ -0,0 +1,11 @@
|
||||||
|
// Copyright (C) 2016 the V8 project authors. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
description: Lexical declaration (let) not allowed in statement position
|
||||||
|
esid: sec-with-statement
|
||||||
|
es6id: 13.11
|
||||||
|
flags: [noStrict]
|
||||||
|
negative: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
with ({}) let x;
|
Loading…
Reference in New Issue