tor-browser

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

bad-range.js (1019B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')||!this.hasOwnProperty('SharedArrayBuffer')||(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('arm64-simulator'))) -- Atomics,SharedArrayBuffer is not enabled unconditionally, ARM64 Simulator cannot emulate atomics
      2 // Copyright (C) 2018 Rick Waldron. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 esid: sec-atomics.load
      7 description: >
      8  Test range checking of Atomics.load on arrays that allow atomic operations
      9 includes: [testAtomics.js, testBigIntTypedArray.js]
     10 features: [ArrayBuffer, Atomics, BigInt, DataView, SharedArrayBuffer, Symbol, TypedArray]
     11 ---*/
     12 
     13 var buffer = new SharedArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 2);
     14 
     15 testWithBigIntTypedArrayConstructors(function(TA) {
     16  let view = new TA(buffer);
     17  testWithAtomicsOutOfBoundsIndices(function(IdxGen) {
     18    assert.throws(RangeError, function() {
     19      Atomics.load(view, IdxGen(view));
     20    });
     21  });
     22 });
     23 
     24 reportCompare(0, 0);