mirror of https://github.com/tc39/test262.git
parent
16e66ece0c
commit
6ef9cef4a0
|
@ -0,0 +1,38 @@
|
|||
// 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
|
||||
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(); } }}];
|
||||
});
|
|
@ -0,0 +1,38 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-unresolvable.case
|
||||
// - src/spread/error/array.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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(ReferenceError, function() {
|
||||
[{a: 0, ...unresolvableReference}];
|
||||
});
|
|
@ -0,0 +1,38 @@
|
|||
// 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
|
||||
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(); } }}];
|
||||
});
|
|
@ -0,0 +1,38 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-unresolvable.case
|
||||
// - src/spread/error/array.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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(ReferenceError, function() {
|
||||
[{...unresolvableReference}];
|
||||
});
|
|
@ -0,0 +1,57 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,45 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,66 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-ident.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other properties (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
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, ...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,48 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null value (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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, ...null}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-undefined.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with undefined (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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, ...undefined}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,57 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-descriptor.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Spread operation with getter results in data property descriptor (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {
|
||||
get a() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(obj, "a").value, 42);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, c: 4, d: 5}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,39 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-init.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Getter in object literal is not evaluated (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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 o = {a: 2, b: 3};
|
||||
let executedGetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(executedGetter, false)
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, get c() { executedGetter = true; }}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-manipulate-outter-obj-in-getter.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Getter manipulates outter object before it's spread operation (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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 o = { a: 0, b: 1 };
|
||||
var cthulhu = { get x() {
|
||||
delete o.a;
|
||||
o.b = 42;
|
||||
o.c = "ni";
|
||||
}};
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("a"), false);
|
||||
assert.sameValue(obj.b, 42);
|
||||
assert.sameValue(obj.c, "ni");
|
||||
assert(obj.hasOwnProperty("x"));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...cthulhu, ...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread-getter.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Multiple Object Spread usage calls getter multiple times (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let getterCallCount = 0;
|
||||
let o = {
|
||||
get a() {
|
||||
return ++getterCallCount;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, c: 4, d: 5, a: 42, ...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Multiple Object Spread operation (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
|
||||
let o = {a: 2, b: 3};
|
||||
let o2 = {c: 4, d: 5};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, ...o2}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-null.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Null Object Spread is ignored (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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, [{...null}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-override-immutable.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread overriding immutable properties (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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.
|
||||
---*/
|
||||
|
||||
let o = {b: 2};
|
||||
Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 3)
|
||||
assert.sameValue(obj.b, 2);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, a: 3}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-overrides-prev-properties.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread properties overrides previous definitions (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
assert.sameValue(o.a, 2);
|
||||
assert.sameValue(o.b, 3);
|
||||
callCount += 1;
|
||||
}.apply(null, [{a: 1, b: 7, ...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,36 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-skip-non-enumerable.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread doesn't copy non-enumerable properties (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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 o = {};
|
||||
Object.defineProperty(o, "b", {value: 3, enumerable: false});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("b"), false)
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-spread-order.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Spread operation follows [[OwnPropertyKeys]] order (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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 calls = [];
|
||||
var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
|
||||
Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
|
||||
Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-symbol-property.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Spread operation where source object contains Symbol properties (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let symbol = Symbol('foo');
|
||||
let o = {};
|
||||
o[symbol] = 1;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj[symbol], 1);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, c: 4, d: 5}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-undefined.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Undefined Object Spread is ignored (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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, [{...undefined}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,55 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-with-overrides.case
|
||||
// - src/spread/default/array.template
|
||||
/*---
|
||||
description: Object Spread properties being overriden (Array initializer)
|
||||
esid: sec-runtime-semantics-arrayaccumulation
|
||||
es6id: 12.2.5.2
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3, c: 4, e: undefined, f: null, g: false};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 7);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert(obj.hasOwnProperty("e"));
|
||||
assert.sameValue(obj.f, null);
|
||||
assert.sameValue(obj.g, false);
|
||||
assert.sameValue(obj.h, -0);
|
||||
assert.sameValue(obj.i.toString(), "Symbol(foo)");
|
||||
assert(Object.is(obj.j, o));
|
||||
assert.sameValue(Object.keys(obj).length, 10);
|
||||
callCount += 1;
|
||||
}.apply(null, [{...o, a: 1, b: 7, d: 5, h: -0, i: Symbol("foo"), j: o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,54 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,43 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,56 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-ident.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
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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, [{...o}]));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,36 @@
|
|||
// 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
|
||||
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(); } }}));
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-unresolvable.case
|
||||
// - src/spread/error/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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(ReferenceError, function() {
|
||||
(function() {}({a: 0, ...unresolvableReference}));
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
// 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
|
||||
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(); } }}));
|
||||
});
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-unresolvable.case
|
||||
// - src/spread/error/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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(ReferenceError, function() {
|
||||
(function() {}({...unresolvableReference}));
|
||||
});
|
|
@ -0,0 +1,55 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,43 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,64 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-ident.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other properties (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,46 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null value (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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, ...null}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-undefined.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with undefined (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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, ...undefined}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,55 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-descriptor.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Spread operation with getter results in data property descriptor (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {
|
||||
get a() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(obj, "a").value, 42);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,37 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-init.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Getter in object literal is not evaluated (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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 o = {a: 2, b: 3};
|
||||
let executedGetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(executedGetter, false)
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o, get c() { executedGetter = true; }}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-manipulate-outter-obj-in-getter.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Getter manipulates outter object before it's spread operation (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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 o = { a: 0, b: 1 };
|
||||
var cthulhu = { get x() {
|
||||
delete o.a;
|
||||
o.b = 42;
|
||||
o.c = "ni";
|
||||
}};
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("a"), false);
|
||||
assert.sameValue(obj.b, 42);
|
||||
assert.sameValue(obj.c, "ni");
|
||||
assert(obj.hasOwnProperty("x"));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...cthulhu, ...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread-getter.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Multiple Object Spread usage calls getter multiple times (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let getterCallCount = 0;
|
||||
let o = {
|
||||
get a() {
|
||||
return ++getterCallCount;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5, a: 42, ...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Multiple Object Spread operation (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
|
||||
let o = {a: 2, b: 3};
|
||||
let o2 = {c: 4, d: 5};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
callCount += 1;
|
||||
}({...o, ...o2}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-null.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Null Object Spread is ignored (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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;
|
||||
}({...null}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,45 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-override-immutable.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread overriding immutable properties (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let o = {b: 2};
|
||||
Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 3)
|
||||
assert.sameValue(obj.b, 2);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
callCount += 1;
|
||||
}({...o, a: 3}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-overrides-prev-properties.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread properties overrides previous definitions (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
assert.sameValue(o.a, 2);
|
||||
assert.sameValue(o.b, 3);
|
||||
callCount += 1;
|
||||
}({a: 1, b: 7, ...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,34 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-skip-non-enumerable.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread doesn't copy non-enumerable properties (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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 o = {};
|
||||
Object.defineProperty(o, "b", {value: 3, enumerable: false});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("b"), false)
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}({...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-spread-order.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Spread operation follows [[OwnPropertyKeys]] order (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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 calls = [];
|
||||
var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
|
||||
Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
|
||||
Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-symbol-property.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Spread operation where source object contains Symbol properties (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let symbol = Symbol('foo');
|
||||
let o = {};
|
||||
o[symbol] = 1;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj[symbol], 1);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,41 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-undefined.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Undefined Object Spread is ignored (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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;
|
||||
}({...undefined}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-with-overrides.case
|
||||
// - src/spread/default/call-expr.template
|
||||
/*---
|
||||
description: Object Spread properties being overriden (CallExpression)
|
||||
esid: sec-function-calls-runtime-semantics-evaluation
|
||||
es6id: 12.3.4.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3, c: 4, e: undefined, f: null, g: false};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
(function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 7);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert(obj.hasOwnProperty("e"));
|
||||
assert.sameValue(obj.f, null);
|
||||
assert.sameValue(obj.g, false);
|
||||
assert.sameValue(obj.h, -0);
|
||||
assert.sameValue(obj.i.toString(), "Symbol(foo)");
|
||||
assert(Object.is(obj.j, o));
|
||||
assert.sameValue(Object.keys(obj).length, 10);
|
||||
callCount += 1;
|
||||
}({...o, a: 1, b: 7, d: 5, h: -0, i: Symbol("foo"), j: o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,52 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,41 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-ident.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
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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;
|
||||
}({...o}));
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,35 @@
|
|||
// 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
|
||||
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(); } }});
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-unresolvable.case
|
||||
// - src/spread/error/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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(ReferenceError, function() {
|
||||
new function() {}({a: 0, ...unresolvableReference});
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// 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
|
||||
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(); } }});
|
||||
});
|
|
@ -0,0 +1,35 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-unresolvable.case
|
||||
// - src/spread/error/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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(ReferenceError, function() {
|
||||
new function() {}({...unresolvableReference});
|
||||
});
|
|
@ -0,0 +1,54 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,42 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,63 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-ident.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other properties (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
verifyEnumerable(obj, "c");
|
||||
verifyWritable(obj, "c");
|
||||
verifyConfigurable(obj, "c");
|
||||
|
||||
verifyEnumerable(obj, "d");
|
||||
verifyWritable(obj, "d");
|
||||
verifyConfigurable(obj, "d");
|
||||
callCount += 1;
|
||||
}({a: 1, b: 2, ...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,45 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null value (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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, ...null});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,42 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-undefined.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with undefined (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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, ...undefined});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,54 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-descriptor.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Spread operation with getter results in data property descriptor (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {
|
||||
get a() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(obj, "a").value, 42);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,36 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-init.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Getter in object literal is not evaluated (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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 o = {a: 2, b: 3};
|
||||
let executedGetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(executedGetter, false)
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o, get c() { executedGetter = true; }});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-manipulate-outter-obj-in-getter.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Getter manipulates outter object before it's spread operation (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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 o = { a: 0, b: 1 };
|
||||
var cthulhu = { get x() {
|
||||
delete o.a;
|
||||
o.b = 42;
|
||||
o.c = "ni";
|
||||
}};
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("a"), false);
|
||||
assert.sameValue(obj.b, 42);
|
||||
assert.sameValue(obj.c, "ni");
|
||||
assert(obj.hasOwnProperty("x"));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...cthulhu, ...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,50 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread-getter.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Multiple Object Spread usage calls getter multiple times (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let getterCallCount = 0;
|
||||
let o = {
|
||||
get a() {
|
||||
return ++getterCallCount;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5, a: 42, ...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,48 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Multiple Object Spread operation (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
|
||||
let o = {a: 2, b: 3};
|
||||
let o2 = {c: 4, d: 5};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
callCount += 1;
|
||||
}({...o, ...o2});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-null.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Null Object Spread is ignored (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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;
|
||||
}({...null});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,44 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-override-immutable.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread overriding immutable properties (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let o = {b: 2};
|
||||
Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 3)
|
||||
assert.sameValue(obj.b, 2);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
callCount += 1;
|
||||
}({...o, a: 3});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,46 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-overrides-prev-properties.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread properties overrides previous definitions (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
assert.sameValue(o.a, 2);
|
||||
assert.sameValue(o.b, 3);
|
||||
callCount += 1;
|
||||
}({a: 1, b: 7, ...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,33 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,34 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-skip-non-enumerable.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread doesn't copy non-enumerable properties (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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 o = {};
|
||||
Object.defineProperty(o, "b", {value: 3, enumerable: false});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("b"), false)
|
||||
assert.sameValue(Object.keys(obj).length, 0);
|
||||
callCount += 1;
|
||||
}({...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-spread-order.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Spread operation follows [[OwnPropertyKeys]] order (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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 calls = [];
|
||||
var o = { get z() { calls.push('z') }, get a() { calls.push('a') } };
|
||||
Object.defineProperty(o, 1, { get: () => { calls.push(1) }, enumerable: true });
|
||||
Object.defineProperty(o, Symbol('foo'), { get: () => { calls.push("Symbol(foo)") }, enumerable: true });
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert(compareArray(calls, [1, 'z', 'a', "Symbol(foo)"]));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}({...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-symbol-property.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Spread operation where source object contains Symbol properties (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let symbol = Symbol('foo');
|
||||
let o = {};
|
||||
o[symbol] = 1;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj[symbol], 1);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
callCount += 1;
|
||||
}({...o, c: 4, d: 5});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,40 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-undefined.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Undefined Object Spread is ignored (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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;
|
||||
}({...undefined});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,52 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-with-overrides.case
|
||||
// - src/spread/default/member-expr.template
|
||||
/*---
|
||||
description: Object Spread properties being overriden (`new` operator)
|
||||
esid: sec-new-operator-runtime-semantics-evaluation
|
||||
es6id: 12.3.3.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3, c: 4, e: undefined, f: null, g: false};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
new function(obj) {
|
||||
assert.sameValue(obj.a, 1);
|
||||
assert.sameValue(obj.b, 7);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert(obj.hasOwnProperty("e"));
|
||||
assert.sameValue(obj.f, null);
|
||||
assert.sameValue(obj.g, false);
|
||||
assert.sameValue(obj.h, -0);
|
||||
assert.sameValue(obj.i.toString(), "Symbol(foo)");
|
||||
assert(Object.is(obj.j, o));
|
||||
assert.sameValue(Object.keys(obj).length, 10);
|
||||
callCount += 1;
|
||||
}({...o, a: 1, b: 7, d: 5, h: -0, i: Symbol("foo"), j: o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,51 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,40 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-obj-ident.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
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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;
|
||||
}({...o});
|
||||
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,43 @@
|
|||
// 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
|
||||
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();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-err-obj-unresolvable.case
|
||||
// - src/spread/error/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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: 0, ...unresolvableReference});
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new Test262ChildClass();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// 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
|
||||
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();
|
||||
});
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/sngl-err-obj-unresolvable.case
|
||||
// - src/spread/error/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator results in error when using an unresolvable reference (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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({...unresolvableReference});
|
||||
}
|
||||
}
|
||||
|
||||
assert.throws(ReferenceError, function() {
|
||||
new Test262ChildClass();
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,49 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,70 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-ident.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other properties (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {c: 3, d: 4};
|
||||
|
||||
|
||||
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, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
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, ...o});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,52 @@
|
|||
// 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
|
||||
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);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-null.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with null value (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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, ...null});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,49 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/mult-obj-undefined.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread operator following other arguments with undefined (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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, ...undefined});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,61 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-descriptor.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Spread operation with getter results in data property descriptor (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {
|
||||
get a() {
|
||||
return 42;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(Object.getOwnPropertyDescriptor(obj, "a").value, 42);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...o, c: 4, d: 5});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,43 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-getter-init.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Getter in object literal is not evaluated (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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 o = {a: 2, b: 3};
|
||||
let executedGetter = false;
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(executedGetter, false)
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...o, get c() { executedGetter = true; }});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,57 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-manipulate-outter-obj-in-getter.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Getter manipulates outter object before it's spread operation (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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 o = { a: 0, b: 1 };
|
||||
var cthulhu = { get x() {
|
||||
delete o.a;
|
||||
o.b = 42;
|
||||
o.c = "ni";
|
||||
}};
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.hasOwnProperty("a"), false);
|
||||
assert.sameValue(obj.b, 42);
|
||||
assert.sameValue(obj.c, "ni");
|
||||
assert(obj.hasOwnProperty("x"));
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...cthulhu, ...o});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,57 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread-getter.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Multiple Object Spread usage calls getter multiple times (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let getterCallCount = 0;
|
||||
let o = {
|
||||
get a() {
|
||||
return ++getterCallCount;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 3);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...o, c: 4, d: 5, a: 42, ...o});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,55 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-mult-spread.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Multiple Object Spread operation (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
|
||||
let o = {a: 2, b: 3};
|
||||
let o2 = {c: 4, d: 5};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(obj.c, 4);
|
||||
assert.sameValue(obj.d, 5);
|
||||
assert.sameValue(Object.keys(obj).length, 4);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...o, ...o2});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,47 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-null.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Null Object Spread is ignored (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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({...null});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,51 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-override-immutable.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread overriding immutable properties (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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.
|
||||
[...]
|
||||
---*/
|
||||
|
||||
let o = {b: 2};
|
||||
Object.defineProperty(o, "a", {value: 1, enumerable: true, writable: false, configurable: true});
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 3)
|
||||
assert.sameValue(obj.b, 2);
|
||||
|
||||
verifyEnumerable(obj, "a");
|
||||
verifyWritable(obj, "a");
|
||||
verifyConfigurable(obj, "a");
|
||||
|
||||
verifyEnumerable(obj, "b");
|
||||
verifyWritable(obj, "b");
|
||||
verifyConfigurable(obj, "b");
|
||||
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({...o, a: 3});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,53 @@
|
|||
// This file was procedurally generated from the following sources:
|
||||
// - src/spread/obj-overrides-prev-properties.case
|
||||
// - src/spread/default/super-call.template
|
||||
/*---
|
||||
description: Object Spread properties overrides previous definitions (SuperCall)
|
||||
esid: sec-super-keyword-runtime-semantics-evaluation
|
||||
es6id: 12.3.5.1
|
||||
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).
|
||||
|
||||
---*/
|
||||
let o = {a: 2, b: 3};
|
||||
|
||||
|
||||
var callCount = 0;
|
||||
|
||||
class Test262ParentClass {
|
||||
constructor(obj) {
|
||||
assert.sameValue(obj.a, 2);
|
||||
assert.sameValue(obj.b, 3);
|
||||
assert.sameValue(Object.keys(obj).length, 2);
|
||||
assert.sameValue(o.a, 2);
|
||||
assert.sameValue(o.b, 3);
|
||||
callCount += 1;
|
||||
}
|
||||
}
|
||||
|
||||
class Test262ChildClass extends Test262ParentClass {
|
||||
constructor() {
|
||||
super({a: 1, b: 7, ...o});
|
||||
}
|
||||
}
|
||||
|
||||
new Test262ChildClass();
|
||||
assert.sameValue(callCount, 1);
|
|
@ -0,0 +1,40 @@
|
|||
// 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
|
||||
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);
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue