spread-err-sngl-err-unresolvable.js (1525B)
1 // This file was procedurally generated from the following sources: 2 // - src/spread/sngl-err-unresolvable.case 3 // - src/spread/error/array.template 4 /*--- 5 description: Spread operator applied to the only argument when reference is unresolvable (Array initializer) 6 esid: sec-runtime-semantics-arrayaccumulation 7 flags: [generated] 8 info: | 9 SpreadElement : ...AssignmentExpression 10 11 1. Let spreadRef be the result of evaluating AssignmentExpression. 12 2. Let spreadObj be ? GetValue(spreadRef). 13 3. Let iterator be ? GetIterator(spreadObj). 14 4. Repeat 15 a. Let next be ? IteratorStep(iterator). 16 b. If next is false, return nextIndex. 17 c. Let nextValue be ? IteratorValue(next). 18 d. Let status be CreateDataProperty(array, ToString(ToUint32(nextIndex)), 19 nextValue). 20 e. Assert: status is true. 21 f. Let nextIndex be nextIndex + 1. 22 23 12.3.6.1 Runtime Semantics: ArgumentListEvaluation 24 25 ArgumentList : ... AssignmentExpression 26 27 1. Let list be an empty List. 28 2. Let spreadRef be the result of evaluating AssignmentExpression. 29 3. Let spreadObj be GetValue(spreadRef). 30 4. Let iterator be GetIterator(spreadObj). 31 5. ReturnIfAbrupt(iterator). 32 33 6.2.3.1 GetValue (V) 34 35 1. ReturnIfAbrupt(V). 36 2. If Type(V) is not Reference, return V. 37 3. Let base be GetBase(V). 38 4. If IsUnresolvableReference(V), throw a ReferenceError exception. 39 ---*/ 40 41 assert.throws(ReferenceError, function() { 42 [...unresolvableReference]; 43 }); 44 45 reportCompare(0, 0);