tor-browser

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

float32array-mutate.js (796B)


      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 es6id: 13.6.4
      5 description: Float32Array mutation during traversal using for..of
      6 info: |
      7    Float32Array instances should be able to be traversed using a `for..of`
      8    loop, and dynamic changes to their contents should be reflected in the
      9    iterated values.
     10 features: [TypedArray]
     11 ---*/
     12 
     13 var iterationCount = 0;
     14 var array = new Float32Array([3, 2, 4, 1]);
     15 
     16 var first = 3;
     17 var second = 64;
     18 var third = 4;
     19 var fourth = 1;
     20 
     21 for (var x of array) {
     22  assert.sameValue(x, first);
     23 
     24  first = second;
     25  second = third;
     26  third = fourth;
     27  fourth = null;
     28 
     29  array[1] = 64;
     30 
     31  iterationCount += 1;
     32 }
     33 
     34 assert.sameValue(iterationCount, 4);
     35 
     36 reportCompare(0, 0);