tor-browser

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

non-shared-int-views.js (1408B)


      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) 2017 Mozilla Corporation.  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  Test Atomics.notify on non-shared integer TypedArrays
      9 features: [Atomics, SharedArrayBuffer, TypedArray]
     10 ---*/
     11 
     12 const sab = new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT * 4);
     13 
     14 const poisoned = {
     15  valueOf: function() {
     16    throw new Test262Error('should not evaluate this code');
     17  }
     18 };
     19 
     20 assert.throws(TypeError, function() {
     21  Atomics.notify(new Int16Array(sab), poisoned, poisoned);
     22 });
     23 
     24 assert.throws(TypeError, function() {
     25  Atomics.notify(new Int8Array(sab), poisoned, poisoned);
     26 });
     27 
     28 assert.throws(TypeError, function() {
     29  Atomics.notify(new Uint32Array(sab),  poisoned, poisoned);
     30 });
     31 
     32 assert.throws(TypeError, function() {
     33  Atomics.notify(new Uint16Array(sab), poisoned, poisoned);
     34 });
     35 
     36 assert.throws(TypeError, function() {
     37  Atomics.notify(new Uint8Array(sab), poisoned, poisoned);
     38 });
     39 
     40 assert.throws(TypeError, function() {
     41  Atomics.notify(new Uint8ClampedArray(sab), poisoned, poisoned);
     42 });
     43 
     44 reportCompare(0, 0);