tor-browser

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

non-shared-bufferdata.js (745B)


      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.add
      7 description: >
      8  Atomics.add will operate on TA when TA.buffer is not a SharedArrayBuffer
      9 includes: [testTypedArray.js]
     10 features: [ArrayBuffer, Atomics, TypedArray]
     11 ---*/
     12 testWithAtomicsFriendlyTypedArrayConstructors(TA => {
     13  const view = new TA(
     14    new ArrayBuffer(TA.BYTES_PER_ELEMENT * 4)
     15  );
     16 
     17  assert.sameValue(Atomics.add(view, 0, 1), 0, 'Atomics.add(view, 0, 1) returns 0');
     18  assert.sameValue(Atomics.load(view, 0), 1, 'Atomics.load(view, 0) returns 1');
     19 });
     20 
     21 reportCompare(0, 0);