mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Add for-of tests with bogus initializers (#2182)
This commit is contained in:
parent
8cc85b875d
commit
465d0b587e
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (const [x] = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (const {x} = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (let [x] = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (let {x} = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (var [x] = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (var {x} = 1 of []) {}
|
||||||
|
}
|
20
test/language/statements/for-await-of/head-const-init.js
Normal file
20
test/language/statements/for-await-of/head-const-init.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (const x = 1 of []) {}
|
||||||
|
}
|
20
test/language/statements/for-await-of/head-let-init.js
Normal file
20
test/language/statements/for-await-of/head-let-init.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (let x = 1 of []) {}
|
||||||
|
}
|
20
test/language/statements/for-await-of/head-var-init.js
Normal file
20
test/language/statements/for-await-of/head-var-init.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for await (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
features: [async-iteration]
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
async function fn() {
|
||||||
|
for await (var x = 1 of []) {}
|
||||||
|
}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (const [x] = 1 of []) {}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (const {x} = 1 of []) {}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (let [x] = 1 of []) {}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (let {x} = 1 of []) {}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (var [x] = 1 of []) {}
|
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (var {x} = 1 of []) {}
|
17
test/language/statements/for-of/head-const-init.js
Normal file
17
test/language/statements/for-of/head-const-init.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (const x = 1 of []) {}
|
17
test/language/statements/for-of/head-let-init.js
Normal file
17
test/language/statements/for-of/head-let-init.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForDeclaration position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (ForDeclaration of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (let x = 1 of []) {}
|
17
test/language/statements/for-of/head-var-init.js
Normal file
17
test/language/statements/for-of/head-var-init.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
// Copyright (C) 2019 Aleksey Shvayka. All rights reserved.
|
||||||
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
/*---
|
||||||
|
esid: sec-iteration-statements
|
||||||
|
description: >
|
||||||
|
Initializer is not allowed in head's ForBinding position.
|
||||||
|
info: |
|
||||||
|
IterationStatement:
|
||||||
|
for (var ForBinding of AssignmentExpression) Statement
|
||||||
|
negative:
|
||||||
|
phase: parse
|
||||||
|
type: SyntaxError
|
||||||
|
---*/
|
||||||
|
|
||||||
|
$DONOTEVALUATE();
|
||||||
|
|
||||||
|
for (var x = 1 of []) {}
|
Loading…
x
Reference in New Issue
Block a user