spread-sngl-obj-ident.js (1726B)
1 // This file was procedurally generated from the following sources: 2 // - src/spread/sngl-obj-ident.case 3 // - src/spread/default/array.template 4 /*--- 5 description: Object Spread operator without other arguments (Array initializer) 6 esid: sec-runtime-semantics-arrayaccumulation 7 features: [object-spread] 8 flags: [generated] 9 includes: [propertyHelper.js] 10 info: | 11 SpreadElement : ...AssignmentExpression 12 13 1. Let spreadRef be the result of evaluating AssignmentExpression. 14 2. Let spreadObj be ? GetValue(spreadRef). 15 3. Let iterator be ? GetIterator(spreadObj). 16 4. Repeat 17 a. Let next be ? IteratorStep(iterator). 18 b. If next is false, return nextIndex. 19 c. Let nextValue be ? IteratorValue(next). 20 d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)), 21 nextValue). 22 e. Assert: status is true. 23 f. Let nextIndex be nextIndex + 1. 24 25 Pending Runtime Semantics: PropertyDefinitionEvaluation 26 27 PropertyDefinition:...AssignmentExpression 28 29 1. Let exprValue be the result of evaluating AssignmentExpression. 30 2. Let fromValue be GetValue(exprValue). 31 3. ReturnIfAbrupt(fromValue). 32 4. Let excludedNames be a new empty List. 33 5. Return CopyDataProperties(object, fromValue, excludedNames). 34 35 ---*/ 36 let o = {c: 3, d: 4}; 37 38 39 var callCount = 0; 40 41 (function(obj) { 42 assert.sameValue(Object.keys(obj).length, 2); 43 44 verifyProperty(obj, "c", { 45 enumerable: true, 46 writable: true, 47 configurable: true, 48 value: 3 49 }); 50 51 verifyProperty(obj, "d", { 52 enumerable: true, 53 writable: true, 54 configurable: true, 55 value: 4 56 }); 57 callCount += 1; 58 }.apply(null, [{...o}])); 59 60 assert.sameValue(callCount, 1); 61 62 reportCompare(0, 0);