array-contract.js (519B)
1 // Copyright (C) 2015 the V8 project authors. All rights reserved. 2 // This code is governed by the BSD license found in the LICENSE file. 3 4 /*--- 5 description: Array entry removal during traversal using for..of 6 info: | 7 Entries removed from an Array instance during traversal should not be 8 visited. 9 es6id: 13.6.4 10 ---*/ 11 12 var array = [0, 1]; 13 var iterationCount = 0; 14 15 for (var x of array) { 16 assert.sameValue(x, 0); 17 array.pop(); 18 iterationCount += 1; 19 } 20 21 assert.sameValue(iterationCount, 1); 22 23 reportCompare(0, 0);