tor-browser

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

non-shared-bufferdata-non-shared-int-views-throws.js (692B)


      1 // |reftest| skip-if(!this.hasOwnProperty('Atomics')) -- Atomics is not enabled unconditionally
      2 // Copyright (C) 2020 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.notify
      7 description: >
      8  Atomics.notify throws on non-shared integer TypedArrays
      9 features: [ArrayBuffer, Atomics, BigInt, TypedArray]
     10 ---*/
     11 
     12 const nonsab = new ArrayBuffer(BigInt64Array.BYTES_PER_ELEMENT * 8);
     13 
     14 const poisoned = {
     15  valueOf() {
     16    throw new Test262Error('should not evaluate this code');
     17  }
     18 };
     19 
     20 assert.throws(TypeError, function() {
     21  Atomics.notify(new BigUint64Array(nonsab), poisoned, poisoned);
     22 });
     23 
     24 reportCompare(0, 0);