does-not-invoke-array-setters.js (1060B)
1 // |reftest| async 2 // Copyright (C) 2015 André Bargull. All rights reserved. 3 // This code is governed by the BSD license found in the LICENSE file. 4 5 /*--- 6 es6id: 25.4.4.1.1 7 description: > 8 Indexed setter properties on Array.prototype are not invoked. 9 info: | 10 Runtime Semantics: PerformPromiseAll( iteratorRecord, constructor, resultCapability) 11 12 ... 13 4. Let remainingElementsCount be a new Record { [[value]]: 1 }. 14 ... 15 6.d ... 16 ii. Set remainingElementsCount.[[value]] to remainingElementsCount.[[value]] − 1. 17 iii. If remainingElementsCount.[[value]] is 0, 18 1. Let valuesArray be CreateArrayFromList(values). 19 ... 20 ... 21 22 7.3.16 CreateArrayFromList (elements) 23 ... 24 4. For each element e of elements 25 a. Let status be CreateDataProperty(array, ToString(n), e). 26 b. Assert: status is true. 27 ... 28 flags: [async] 29 ---*/ 30 31 Object.defineProperty(Array.prototype, 0, { 32 set: function() { 33 throw new Test262Error("Setter on Array.prototype called"); 34 } 35 }); 36 37 Promise.all([42]).then(function() { 38 $DONE(); 39 }, $DONE);