mirror of https://github.com/tc39/test262.git
Merge pull request #1187 from leobalter/follow-up-1050
Remove remaining cases for ...{
This commit is contained in:
commit
1fde1ae287
|
@ -1,36 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
When DestructuringAssignmentTarget is an object literal, it should be parsed
|
||||
parsed as a DestructuringAssignmentPattern and evaluated as a destructuring
|
||||
assignment and object rest desconstruction is allowed in that case.
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [propertyHelper.js]
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
var a, b, c, rest;
|
||||
//- elems
|
||||
{a, b, ...{c, ...rest}}
|
||||
//- vals
|
||||
{a: 1, b: 2, c: 3, d: 4, e: 5}
|
||||
//- body
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
When DestructuringAssignmentTarget is an object literal, it should be parsed
|
||||
parsed as a DestructuringAssignmentPattern and evaluated as a destructuring
|
||||
assignment.
|
||||
template: default
|
||||
esid: pending
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
var a, b, c, d, e;
|
||||
//- elems
|
||||
{a, b, ...{c, e}}
|
||||
//- vals
|
||||
{a: 1, b: 2, c: 3, d: 4, e: 5}
|
||||
//- body
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
assert.sameValue(d, undefined);
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
Rest object contains just source object's own properties
|
||||
template: default
|
||||
esid: pending
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var x, y, z;
|
||||
//- elems
|
||||
{ x, ...{y , z} }
|
||||
//- vals
|
||||
o
|
||||
//- body
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
When DestructuringAssignmentTarget is an object literal, it should be parsed
|
||||
parsed as a DestructuringAssignmentPattern and evaluated as a destructuring
|
||||
assignment.
|
||||
template: default
|
||||
esid: pending
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
var obj = {a: 3, b: 4};
|
||||
//- elems
|
||||
{a, b, ...{c, e}}
|
||||
//- vals
|
||||
{a: 1, b: 2, c: 3, d: 4, e: 5}
|
||||
//- body
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
|
@ -1,34 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
When DestructuringAssignmentTarget is an object literal, it should be parsed
|
||||
parsed as a DestructuringAssignmentPattern and evaluated as a destructuring
|
||||
assignment and object rest desconstruction is allowed in that case.
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [propertyHelper.js]
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- elems
|
||||
{a, b, ...{c, ...rest}}
|
||||
//- vals
|
||||
{a: 1, b: 2, c: 3, d: 4, e: 5}
|
||||
//- body
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
|
||||
/*---
|
||||
desc: >
|
||||
Rest object contains just soruce object's own properties
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [propertyHelper.js]
|
||||
features: [object-rest]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
//- elems
|
||||
{ x, ...{y , z} }
|
||||
//- vals
|
||||
o
|
||||
//- body
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator results in error when there is an getter that throws an exception
|
||||
template: error
|
||||
esid: pending
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- error
|
||||
Test262Error
|
||||
//- args
|
||||
{a: 1, ...{ get foo() { throw new Test262Error(); } }}
|
|
@ -1,39 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator following other arguments
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- args
|
||||
{a: 1, b: 2, ...{c: 3, d: 4}}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator following other arguments with empty object
|
||||
template: default
|
||||
esid: pending
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- args
|
||||
{a: 1, b: 2, ...{}}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
|
@ -1,30 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator following other arguments with null, undefined and empty object
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- args
|
||||
{a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert(compareArray(Object.keys(obj), ["a", "b", "c", "d"]));
|
|
@ -1,20 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Setter are not executed when redefined in Object Spread
|
||||
template: default
|
||||
esid: pending
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- setup
|
||||
let executedSetter = false;
|
||||
|
||||
//- args
|
||||
{set c(v) { executedSetter = true; }, ...{c: 1}}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(obj.c, 1);
|
||||
assert.sameValue(executedSetter, false);
|
||||
assert.sameValue(Object.keys(obj).length, 1);
|
|
@ -1,24 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator results in error when there is an getter that throws an exception
|
||||
template: error
|
||||
esid: pending
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- error
|
||||
Test262Error
|
||||
//- args
|
||||
{...{ get foo() { throw new Test262Error(); } }}
|
|
@ -1,36 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator without other arguments
|
||||
template: default
|
||||
esid: pending
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- args
|
||||
{...{c: 3, d: 4}}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
|
@ -1,25 +0,0 @@
|
|||
// Copyright (C) 2017 Caio Lima. All rights reserved.
|
||||
// This code is governed by the BSD license found in the LICENSE file.
|
||||
/*---
|
||||
desc: Object Spread operator on a single empty object
|
||||
template: default
|
||||
esid: pending
|
||||
info: |
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
features: [object-spread]
|
||||
---*/
|
||||
|
||||
//- args
|
||||
{...{}}
|
||||
//- params
|
||||
obj
|
||||
//- body
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
|
@ -1,39 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-getter-throws.case
|
||||
// - src/spread/error/array.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
[{a: 1, ...{ get foo() { throw new Test262Error(); } }}];
|
||||
});
|
|
@ -1,39 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-getter-throws.case
|
||||
// - src/spread/error/array.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
[{...{ get foo() { throw new Test262Error(); } }}];
|
||||
});
|
|
@ -1,58 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-base.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
|
||||
callCount += 1;
|
||||
}.apply(null, [{a: 1, b: 2, ...{c: 3, d: 4}}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,46 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-empty.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with empty object (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}.apply(null, [{a: 1, b: 2, ...{}}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,49 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null-empty-undefined.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null, undefined and empty object (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert(compareArray(Object.keys(obj), ["a", "b", "c", "d"]));
|
||||
callCount += 1;
|
||||
}.apply(null, [{a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,37 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-setter-redef.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Setter are not executed when redefined in Object Spread (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
---*/
|
||||
let executedSetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.c, 1);
|
||||
assert.sameValue(executedSetter, false);
|
||||
assert.sameValue(Object.keys(obj).length, 1);
|
||||
callCount += 1;
|
||||
}.apply(null, [{set c(v) { executedSetter = true; }, ...{c: 1}}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,55 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-base.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator without other arguments (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}.apply(null, [{...{c: 3, d: 4}}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,44 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-empty.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator on a single empty object (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SpreadElement : ...AssignmentExpression
|
||||
|
||||
1. Let spreadRef be the result of evaluating AssignmentExpression.
|
||||
2. Let spreadObj be ? GetValue(spreadRef).
|
||||
3. Let iterator be ? GetIterator(spreadObj).
|
||||
4. Repeat
|
||||
a. Let next be ? IteratorStep(iterator).
|
||||
b. If next is false, return nextIndex.
|
||||
c. Let nextValue be ? IteratorValue(next).
|
||||
d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)),
|
||||
nextValue).
|
||||
e. Assert: status is true.
|
||||
f. Let nextIndex be nextIndex + 1.
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...{}}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,43 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj-nested-rest.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var a, b, c, rest;
|
||||
|
||||
var result;
|
||||
var vals = {a: 1, b: 2, c: 3, d: 4, e: 5};
|
||||
|
||||
result = {a, b, ...{c, ...rest}} = vals;
|
||||
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
|
@ -1,33 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var a, b, c, d, e;
|
||||
|
||||
var result;
|
||||
var vals = {a: 1, b: 2, c: 3, d: 4, e: 5};
|
||||
|
||||
result = {a, b, ...{c, e}} = vals;
|
||||
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
assert.sameValue(d, undefined);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
|
@ -1,34 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-obj-own-property.case
|
||||
// - src/dstr-assignment/default/assignment-expr.template
|
||||
/*---
|
||||
description: Rest object contains just source object's own properties (AssignmentExpression)
|
||||
esid: sec-variable-statement-runtime-semantics-evaluation
|
||||
es6id: 13.3.2.4
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
VariableDeclaration : BindingPattern Initializer
|
||||
|
||||
1. Let rhs be the result of evaluating Initializer.
|
||||
2. Let rval be GetValue(rhs).
|
||||
3. ReturnIfAbrupt(rval).
|
||||
4. Return the result of performing BindingInitialization for
|
||||
BindingPattern passing rval and undefined as arguments.
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var x, y, z;
|
||||
|
||||
var result;
|
||||
var vals = o;
|
||||
|
||||
result = { x, ...{y , z} } = vals;
|
||||
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
assert.sameValue(result, vals);
|
|
@ -1,37 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-getter-throws.case
|
||||
// - src/spread/error/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
(function() {}({a: 1, ...{ get foo() { throw new Test262Error(); } }}));
|
||||
});
|
|
@ -1,37 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-getter-throws.case
|
||||
// - src/spread/error/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
(function() {}({...{ get foo() { throw new Test262Error(); } }}));
|
||||
});
|
|
@ -1,56 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-base.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...{c: 3, d: 4}}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,44 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-empty.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with empty object (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...{}}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,47 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null-empty-undefined.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null, undefined and empty object (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert(compareArray(Object.keys(obj), ["a", "b", "c", "d"]));
|
||||
callCount += 1;
|
||||
}({a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,35 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-setter-redef.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Setter are not executed when redefined in Object Spread (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
---*/
|
||||
let executedSetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.c, 1);
|
||||
assert.sameValue(executedSetter, false);
|
||||
assert.sameValue(Object.keys(obj).length, 1);
|
||||
callCount += 1;
|
||||
}({set c(v) { executedSetter = true; }, ...{c: 1}}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,53 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-base.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator without other arguments (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}({...{c: 3, d: 4}}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,42 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-empty.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator on a single empty object (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
CallExpression : MemberExpression Arguments
|
||||
|
||||
[...]
|
||||
9. Return EvaluateDirectCall(func, thisValue, Arguments, tailCall).
|
||||
|
||||
12.3.4.3 Runtime Semantics: EvaluateDirectCall
|
||||
|
||||
1. Let argList be ArgumentListEvaluation(arguments).
|
||||
[...]
|
||||
6. Let result be Call(func, thisValue, argList).
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}({...{}}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,36 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-getter-throws.case
|
||||
// - src/spread/error/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
new function() {}({a: 1, ...{ get foo() { throw new Test262Error(); } }});
|
||||
});
|
|
@ -1,36 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-getter-throws.case
|
||||
// - src/spread/error/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
new function() {}({...{ get foo() { throw new Test262Error(); } }});
|
||||
});
|
|
@ -1,55 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-base.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...{c: 3, d: 4}});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,43 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-empty.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with empty object (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...{}});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,46 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null-empty-undefined.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null, undefined and empty object (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert(compareArray(Object.keys(obj), ["a", "b", "c", "d"]));
|
||||
callCount += 1;
|
||||
}({a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,34 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-setter-redef.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Setter are not executed when redefined in Object Spread (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
---*/
|
||||
let executedSetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.c, 1);
|
||||
assert.sameValue(executedSetter, false);
|
||||
assert.sameValue(Object.keys(obj).length, 1);
|
||||
callCount += 1;
|
||||
}({set c(v) { executedSetter = true; }, ...{c: 1}});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,52 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-base.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator without other arguments (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}({...{c: 3, d: 4}});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-empty.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator on a single empty object (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
MemberExpression : new MemberExpression Arguments
|
||||
|
||||
1. Return EvaluateNew(MemberExpression, Arguments).
|
||||
|
||||
12.3.3.1.1 Runtime Semantics: EvaluateNew
|
||||
|
||||
6. If arguments is empty, let argList be an empty List.
|
||||
7. Else,
|
||||
a. Let argList be ArgumentListEvaluation of arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}({...{}});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,44 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-getter-throws.case
|
||||
// - src/spread/error/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({a: 1, ...{ get foo() { throw new Test262Error(); } }});
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
new Test262ChildClass();
|
||||
});
|
|
@ -1,44 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-getter-throws.case
|
||||
// - src/spread/error/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when there is an getter that throws an exception (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...{ get foo() { throw new Test262Error(); } }});
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
new Test262ChildClass();
|
||||
});
|
|
@ -1,62 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-base.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({a: 1, b: 2, ...{c: 3, d: 4}});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,50 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-empty.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with empty object (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({a: 1, b: 2, ...{}});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,53 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null-empty-undefined.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null, undefined and empty object (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [compareArray.js]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 2);
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert(compareArray(Object.keys(obj), ["a", "b", "c", "d"]));
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({a: 1, ...null, b: 2, ...undefined, c: 3, ...{}, ...{...{}}, d: 4});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,41 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-setter-redef.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Setter are not executed when redefined in Object Spread (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
---*/
|
||||
let executedSetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.c, 1);
|
||||
assert.sameValue(executedSetter, false);
|
||||
assert.sameValue(Object.keys(obj).length, 1);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({set c(v) { executedSetter = true; }, ...{c: 1}});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-base.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator without other arguments (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.c, 3);
|
||||
assert.sameValue(obj.d, 4);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...{c: 3, d: 4}});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,48 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-empty.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator on a single empty object (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
features: [object-spread]
|
||||
flags: [generated]
|
||||
info: |
|
||||
SuperCall : super Arguments
|
||||
|
||||
1. Let newTarget be GetNewTarget().
|
||||
2. If newTarget is undefined, throw a ReferenceError exception.
|
||||
3. Let func be GetSuperConstructor().
|
||||
4. ReturnIfAbrupt(func).
|
||||
5. Let argList be ArgumentListEvaluation of Arguments.
|
||||
[...]
|
||||
|
||||
Pending Runtime Semantics: PropertyDefinitionEvaluation
|
||||
|
||||
PropertyDefinition:...AssignmentExpression
|
||||
|
||||
1. Let exprValue be the result of evaluating AssignmentExpression.
|
||||
2. Let fromValue be GetValue(exprValue).
|
||||
3. ReturnIfAbrupt(fromValue).
|
||||
4. Let excludedNames be a new empty List.
|
||||
5. Return CopyDataProperties(object, fromValue, excludedNames).
|
||||
|
||||
---*/
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...{}});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (const {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (const {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (const { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,56 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (const {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,66 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (const {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,57 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-const.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (const { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (let {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (let {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (let { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,57 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (let {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (let {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-let.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (let { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (var {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (var {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function fn() {
|
||||
for await (var { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,54 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (var {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (var {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-func-var.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function fn() {
|
||||
for await (var { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (const {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (const {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (const { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,56 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (const {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,66 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (const {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,57 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-const.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (const { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (let {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (let {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (let { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,57 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (let {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,67 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (let {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,58 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-let.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (let { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (var {a, b, ...{c, e}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,69 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var-async.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [{a: 1, b: 2, c: 3, d: 4, e: 5}];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (var {a, b, ...{c, ...rest}} of asyncIter) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,60 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var-async.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( ForDeclaration of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForDeclaration, Statement, keyResult,
|
||||
lexicalBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
[...]
|
||||
iii. Else,
|
||||
1. Assert: lhsKind is lexicalBinding.
|
||||
2. Assert: lhs is a ForDeclaration.
|
||||
3. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and iterationEnv as arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
var asyncIter = (async function*() {
|
||||
yield* [o];
|
||||
})();
|
||||
|
||||
async function *fn() {
|
||||
for await (var { x, ...{y , z} } of asyncIter) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
|
@ -1,54 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-nested-obj.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var obj = {a: 3, b: 4};
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (var {a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,64 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-nested-rest.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (var {a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,55 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-binding-for-await/obj-ptrn-rest-obj-own-property.case
|
||||
// - src/dstr-binding-for-await/default/for-await-of-async-gen-var.template
|
||||
/*---
|
||||
description: Rest object contains just soruce object's own properties (for-await-of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
features: [object-rest, destructuring-binding, async-iteration]
|
||||
flags: [generated, async]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for await ( var ForBinding of AssignmentExpression ) Statement
|
||||
|
||||
[...]
|
||||
2. Return ? ForIn/OfBodyEvaluation(ForBinding, Statement, keyResult,
|
||||
varBinding, labelSet, async).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. Let destructuring be IsDestructuring of lhs.
|
||||
[...]
|
||||
6. Repeat
|
||||
[...]
|
||||
j. If destructuring is false, then
|
||||
[...]
|
||||
k. Else
|
||||
i. If lhsKind is assignment, then
|
||||
[...]
|
||||
ii. Else if lhsKind is varBinding, then
|
||||
1. Assert: lhs is a ForBinding.
|
||||
2. Let status be the result of performing BindingInitialization
|
||||
for lhs passing nextValue and undefined as the arguments.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var iterCount = 0;
|
||||
|
||||
async function *fn() {
|
||||
for await (var { x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
|
||||
iterCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
fn().next()
|
||||
.then(() => assert.sameValue(iterCount, 1, 'iteration occurred as expected'), $DONE)
|
||||
.then($DONE, $DONE);
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj-nested-rest.case
|
||||
// - src/dstr-assignment/default/for-of.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment and object rest desconstruction is allowed in that case. (For..of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
es6id: 13.7.5.11
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
includes: [propertyHelper.js]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var a, b, c, rest;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
for ({a, b, ...{c, ...rest}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
|
||||
assert.sameValue(rest.d, 4);
|
||||
assert.sameValue(rest.e, 5);
|
||||
|
||||
verifyEnumerable(rest, "d");
|
||||
verifyWritable(rest, "d");
|
||||
verifyConfigurable(rest, "d");
|
||||
|
||||
verifyEnumerable(rest, "e");
|
||||
verifyWritable(rest, "e");
|
||||
verifyConfigurable(rest, "e");
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
|
||||
assert.sameValue(counter, 1);
|
|
@ -1,42 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-nested-obj.case
|
||||
// - src/dstr-assignment/default/for-of.template
|
||||
/*---
|
||||
description: When DestructuringAssignmentTarget is an object literal, it should be parsed parsed as a DestructuringAssignmentPattern and evaluated as a destructuring assignment. (For..of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
es6id: 13.7.5.11
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var a, b, c, d, e;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
for ({a, b, ...{c, e}} of [{a: 1, b: 2, c: 3, d: 4, e: 5}]) {
|
||||
assert.sameValue(a, 1);
|
||||
assert.sameValue(b, 2);
|
||||
assert.sameValue(c, 3);
|
||||
assert.sameValue(e, 5);
|
||||
assert.sameValue(d, undefined);
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
|
||||
assert.sameValue(counter, 1);
|
|
@ -1,43 +0,0 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/dstr-assignment/obj-rest-obj-own-property.case
|
||||
// - src/dstr-assignment/default/for-of.template
|
||||
/*---
|
||||
description: Rest object contains just source object's own properties (For..of statement)
|
||||
esid: sec-for-in-and-for-of-statements-runtime-semantics-labelledevaluation
|
||||
es6id: 13.7.5.11
|
||||
features: [object-rest, destructuring-binding]
|
||||
flags: [generated]
|
||||
info: |
|
||||
IterationStatement :
|
||||
for ( LeftHandSideExpression of AssignmentExpression ) Statement
|
||||
|
||||
1. Let keyResult be the result of performing ? ForIn/OfHeadEvaluation(« »,
|
||||
AssignmentExpression, iterate).
|
||||
2. Return ? ForIn/OfBodyEvaluation(LeftHandSideExpression, Statement,
|
||||
keyResult, assignment, labelSet).
|
||||
|
||||
13.7.5.13 Runtime Semantics: ForIn/OfBodyEvaluation
|
||||
|
||||
[...]
|
||||
4. If destructuring is true and if lhsKind is assignment, then
|
||||
a. Assert: lhs is a LeftHandSideExpression.
|
||||
b. Let assignmentPattern be the parse of the source text corresponding to
|
||||
lhs using AssignmentPattern as the goal symbol.
|
||||
[...]
|
||||
---*/
|
||||
var o = Object.create({ x: 1, y: 2 });
|
||||
o.z = 3;
|
||||
|
||||
var x, y, z;
|
||||
|
||||
var counter = 0;
|
||||
|
||||
for ({ x, ...{y , z} } of [o]) {
|
||||
assert.sameValue(x, 1);
|
||||
assert.sameValue(y, undefined);
|
||||
assert.sameValue(z, 3);
|
||||
|
||||
counter += 1;
|
||||
}
|
||||
|
||||
assert.sameValue(counter, 1);
|
Loading…
Reference in New Issue