tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

set-expand.js (619B)


      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: Set entry insertaion during traversal using for..of
      6 info: |
      7    New entries inserted into a Set instance during traversal should be
      8    visited.
      9 es6id: 13.6.4
     10 features: [Set]
     11 ---*/
     12 
     13 var set = new Set();
     14 var iterationCount = 0;
     15 
     16 var first = 0;
     17 var second = 1;
     18 
     19 set.add(0);
     20 
     21 for (var x of set) {
     22  assert.sameValue(x, first);
     23 
     24  first = second;
     25  second = null;
     26 
     27  set.add(1);
     28 
     29  iterationCount += 1;
     30 }
     31 
     32 assert.sameValue(iterationCount, 2);
     33 
     34 reportCompare(0, 0);