| // Copyright (C) 2016 the V8 project authors. All rights reserved. | |
| // This code is governed by the BSD license found in the LICENSE file. | |
| /*--- | |
| path: language/expressions/array/spread- | |
| name: Array initializer | |
| esid: sec-runtime-semantics-arrayaccumulation | |
| 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. | |
| ---*/ | |
| var callCount = 0; | |
| (function(/*{ params }*/) { | |
| /*{ body }*/ | |
| callCount += 1; | |
| }.apply(null, [/*{ args }*/])); | |
| assert.sameValue(callCount, 1); |