diff --git a/test/built-ins/Atomics/wait/did-timeout.js b/test/built-ins/Atomics/wait/did-timeout.js index b642ee8e1c..3e904a78a0 100644 --- a/test/built-ins/Atomics/wait/did-timeout.js +++ b/test/built-ins/Atomics/wait/did-timeout.js @@ -8,26 +8,26 @@ description: > includes: [atomicsHelper.js] ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab, id) { +$262.agent.receiveBroadcast(function (sab, id) { var ia = new Int32Array(sab); var then = Date.now(); - $.agent.report(Atomics.wait(ia, 0, 0, 500)); // Timeout 500ms - $.agent.report(Date.now() - then); - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 500)); // Timeout 500ms + $262.agent.report(Date.now() - then); + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); +$262.agent.broadcast(ia.buffer); assert.sameValue(getReport(), "timed-out"); assert.sameValue(Math.abs((getReport()|0) - 500) < $ATOMICS_MAX_TIME_EPSILON, true); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wait/good-views.js b/test/built-ins/Atomics/wait/good-views.js index 9776b67b80..72bd26b3ec 100644 --- a/test/built-ins/Atomics/wait/good-views.js +++ b/test/built-ins/Atomics/wait/good-views.js @@ -10,7 +10,7 @@ description: > // Let's assume 'wait' is not allowed on the main thread, // even in the shell. -$.agent.start( +$262.agent.start( ` var sab = new SharedArrayBuffer(1024); var ab = new ArrayBuffer(16); @@ -25,8 +25,8 @@ var good_indices = [ (view) => 0/-1, // -0 var view = new Int32Array(sab, 32, 20); view[0] = 0; -$.agent.report("A " + Atomics.wait(view, 0, 0, 0)) -$.agent.report("B " + Atomics.wait(view, 0, 37, 0)); +$262.agent.report("A " + Atomics.wait(view, 0, 0, 0)) +$262.agent.report("B " + Atomics.wait(view, 0, 37, 0)); // In-bounds boundary cases for indexing for ( let IdxGen of good_indices ) { @@ -35,11 +35,11 @@ for ( let IdxGen of good_indices ) { // Atomics.store() computes an index from Idx in the same way as other // Atomics operations, not quite like view[Idx]. Atomics.store(view, Idx, 37); - $.agent.report("C " + Atomics.wait(view, Idx, 0)); + $262.agent.report("C " + Atomics.wait(view, Idx, 0)); } -$.agent.report("done"); -$.agent.leaving(); +$262.agent.report("done"); +$262.agent.leaving(); `) assert.sameValue(getReport(), "A timed-out"); @@ -50,7 +50,7 @@ while ((r = getReport()) != "done") function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wait/nan-timeout.js b/test/built-ins/Atomics/wait/nan-timeout.js index 1e3f6e4aa2..4060346d99 100644 --- a/test/built-ins/Atomics/wait/nan-timeout.js +++ b/test/built-ins/Atomics/wait/nan-timeout.js @@ -6,26 +6,26 @@ description: > Test that Atomics.wait does not time out with a NaN timeout ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab, id) { +$262.agent.receiveBroadcast(function (sab, id) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, NaN)); // NaN => Infinity - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, NaN)); // NaN => Infinity + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Ample time -assert.sameValue($.agent.getReport(), null); +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Ample time +assert.sameValue($262.agent.getReport(), null); Atomics.wake(ia, 0); assert.sameValue(getReport(), "ok"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wait/negative-timeout.js b/test/built-ins/Atomics/wait/negative-timeout.js index 521c224408..388d3a96e2 100644 --- a/test/built-ins/Atomics/wait/negative-timeout.js +++ b/test/built-ins/Atomics/wait/negative-timeout.js @@ -6,23 +6,23 @@ description: > Test that Atomics.wait times out with a negative timeout ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab, id) { +$262.agent.receiveBroadcast(function (sab, id) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, -5)); // -5 => 0 - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, -5)); // -5 => 0 + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); +$262.agent.broadcast(ia.buffer); assert.sameValue(getReport(), "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wait/no-spurious-wakeup.js b/test/built-ins/Atomics/wait/no-spurious-wakeup.js index a8cd0cb2e2..011d2604f7 100644 --- a/test/built-ins/Atomics/wait/no-spurious-wakeup.js +++ b/test/built-ins/Atomics/wait/no-spurious-wakeup.js @@ -8,30 +8,30 @@ description: > includes: [atomicsHelper.js] ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab, id) { +$262.agent.receiveBroadcast(function (sab, id) { var ia = new Int32Array(sab); var then = Date.now(); Atomics.wait(ia, 0, 0); var diff = Date.now() - then; // Should be about 1000 ms - $.agent.report(diff); - $.agent.leaving(); + $262.agent.report(diff); + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agent a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agent a chance to wait Atomics.store(ia, 0, 1); // Change the value, should not wake the agent -$.agent.sleep(500); // Wait some more so that we can tell +$262.agent.sleep(500); // Wait some more so that we can tell Atomics.wake(ia, 0); // Really wake it up assert.sameValue(Math.abs((getReport()|0) - 1000) < $ATOMICS_MAX_TIME_EPSILON, true); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wait/was-woken.js b/test/built-ins/Atomics/wait/was-woken.js index b424aec5a8..84850b1f35 100644 --- a/test/built-ins/Atomics/wait/was-woken.js +++ b/test/built-ins/Atomics/wait/was-woken.js @@ -6,26 +6,26 @@ description: > Test that Atomics.wait returns the right result when it was awoken. ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab, id) { +$262.agent.receiveBroadcast(function (sab, id) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0)); // No timeout => Infinity - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0)); // No timeout => Infinity + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agent a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agent a chance to wait Atomics.wake(ia, 0); assert.sameValue(getReport(), "ok"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-all-on-loc.js b/test/built-ins/Atomics/wake/wake-all-on-loc.js index e403df1527..dbb4a151e7 100644 --- a/test/built-ins/Atomics/wake/wake-all-on-loc.js +++ b/test/built-ins/Atomics/wake/wake-all-on-loc.js @@ -8,29 +8,29 @@ description: > ---*/ for ( var i=0 ; i < 3 ; i++ ) { -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report("A " + Atomics.wait(ia, 0, 0)); - $.agent.leaving(); + $262.agent.report("A " + Atomics.wait(ia, 0, 0)); + $262.agent.leaving(); }) `); } -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report("B " + Atomics.wait(ia, 1, 0, 1000)); // We will timeout eventually - $.agent.leaving(); + $262.agent.report("B " + Atomics.wait(ia, 1, 0, 1000)); // We will timeout eventually + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(2*Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agents a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agents a chance to wait assert.sameValue(Atomics.wake(ia, 0), 3); // Wake all on location 0 var rs = [getReport(), getReport(), getReport(), getReport()]; // Do not sort the array -- B should timeout much after the others are woken @@ -41,7 +41,7 @@ assert.sameValue(rs[3], "B timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-all.js b/test/built-ins/Atomics/wake/wake-all.js index d08d49be01..141e35cb4a 100644 --- a/test/built-ins/Atomics/wake/wake-all.js +++ b/test/built-ins/Atomics/wake/wake-all.js @@ -7,20 +7,20 @@ description: > ---*/ for ( var i=0 ; i < 3 ; i++ ) { -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually + $262.agent.leaving(); }) `); } var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agents a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agents a chance to wait assert.sameValue(Atomics.wake(ia, 0), 3); // Wake all var rs = [getReport(), getReport(), getReport()]; rs.sort(); @@ -30,7 +30,7 @@ assert.sameValue(rs[2], "ok"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-in-order.js b/test/built-ins/Atomics/wake/wake-in-order.js index 92025633f4..fb42dd98a0 100644 --- a/test/built-ins/Atomics/wake/wake-in-order.js +++ b/test/built-ins/Atomics/wake/wake-in-order.js @@ -11,24 +11,24 @@ description: > // one by one and observe the wakeup order. for ( var i=0 ; i < 3 ; i++ ) { -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); while (Atomics.load(ia, ${i+1}) == 0); - $.agent.report(${i} + Atomics.wait(ia, 0, 0)); - $.agent.leaving(); + $262.agent.report(${i} + Atomics.wait(ia, 0, 0)); + $262.agent.leaving(); }) `); } var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT*4)); -$.agent.broadcast(ia.buffer); +$262.agent.broadcast(ia.buffer); // Make them sleep in order 0 1 2 on ia[0] for ( var i=0 ; i < 3 ; i++ ) { Atomics.store(ia, i+1, 1); - $.agent.sleep(500); + $262.agent.sleep(500); } // Wake them up one at a time and check the order is 0 1 2 @@ -39,8 +39,8 @@ for ( var i=0 ; i < 3 ; i++ ) { function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-nan.js b/test/built-ins/Atomics/wake/wake-nan.js index 945f503ffb..343614fb0a 100644 --- a/test/built-ins/Atomics/wake/wake-nan.js +++ b/test/built-ins/Atomics/wake/wake-nan.js @@ -6,25 +6,25 @@ description: > Test that Atomics.wake wakes zero waiters if the count is NaN ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agent a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agent a chance to wait assert.sameValue(Atomics.wake(ia, 0, NaN), 0); // Don't actually wake it assert.sameValue(getReport(), "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-negative.js b/test/built-ins/Atomics/wake/wake-negative.js index 56755aece7..4b6ad7baa0 100644 --- a/test/built-ins/Atomics/wake/wake-negative.js +++ b/test/built-ins/Atomics/wake/wake-negative.js @@ -6,25 +6,25 @@ description: > Test that Atomics.wake wakes zero waiters if the count is negative ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agent a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agent a chance to wait assert.sameValue(Atomics.wake(ia, 0, -1), 0); // Don't actually wake it assert.sameValue(getReport(), "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-one.js b/test/built-ins/Atomics/wake/wake-one.js index 1b4ab094bb..30348640ba 100644 --- a/test/built-ins/Atomics/wake/wake-one.js +++ b/test/built-ins/Atomics/wake/wake-one.js @@ -6,28 +6,28 @@ description: > Test that Atomics.wake wakes one waiter if that's what the count is. ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually + $262.agent.leaving(); }) `); -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agents a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agents a chance to wait assert.sameValue(Atomics.wake(ia, 0, 1), 1); // Wake one var rs = [getReport(), getReport()]; rs.sort(); @@ -36,7 +36,7 @@ assert.sameValue(rs[1], "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-two.js b/test/built-ins/Atomics/wake/wake-two.js index b7d970f27c..29cc7bd037 100644 --- a/test/built-ins/Atomics/wake/wake-two.js +++ b/test/built-ins/Atomics/wake/wake-two.js @@ -7,20 +7,20 @@ description: > ---*/ for ( var i=0 ; i < 3 ; i++ ) { -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We may timeout eventually + $262.agent.leaving(); }) `); } var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agents a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agents a chance to wait assert.sameValue(Atomics.wake(ia, 0, 2), 2); // Wake two var rs = [getReport(), getReport(), getReport()]; rs.sort(); @@ -30,7 +30,7 @@ assert.sameValue(rs[2], "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/Atomics/wake/wake-zero.js b/test/built-ins/Atomics/wake/wake-zero.js index 6b00dd2a4c..c4b17ebc3e 100644 --- a/test/built-ins/Atomics/wake/wake-zero.js +++ b/test/built-ins/Atomics/wake/wake-zero.js @@ -6,25 +6,25 @@ description: > Test that Atomics.wake wakes zero waiters if that's what the count is. ---*/ -$.agent.start( +$262.agent.start( ` -$.agent.receiveBroadcast(function (sab) { +$262.agent.receiveBroadcast(function (sab) { var ia = new Int32Array(sab); - $.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually - $.agent.leaving(); + $262.agent.report(Atomics.wait(ia, 0, 0, 1000)); // We will timeout eventually + $262.agent.leaving(); }) `); var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT)); -$.agent.broadcast(ia.buffer); -$.agent.sleep(500); // Give the agent a chance to wait +$262.agent.broadcast(ia.buffer); +$262.agent.sleep(500); // Give the agent a chance to wait assert.sameValue(Atomics.wake(ia, 0, 0), 0); // Don't actually wake it assert.sameValue(getReport(), "timed-out"); function getReport() { var r; - while ((r = $.agent.getReport()) == null) - $.agent.sleep(100); + while ((r = $262.agent.getReport()) == null) + $262.agent.sleep(100); return r; } diff --git a/test/built-ins/DataView/proto-from-ctor-realm-sab.js b/test/built-ins/DataView/proto-from-ctor-realm-sab.js index 81166659c3..f161a30581 100644 --- a/test/built-ins/DataView/proto-from-ctor-realm-sab.js +++ b/test/built-ins/DataView/proto-from-ctor-realm-sab.js @@ -23,7 +23,7 @@ info: | features: [Reflect, SharedArrayBuffer] ---*/ -var other = $.createRealm().global; +var other = $262.createRealm().global; var C = new other.Function(); C.prototype = null; var buffer = new SharedArrayBuffer(0); diff --git a/test/built-ins/SharedArrayBuffer/proto-from-ctor-realm.js b/test/built-ins/SharedArrayBuffer/proto-from-ctor-realm.js index 9b5195ebab..72ad0e4b71 100644 --- a/test/built-ins/SharedArrayBuffer/proto-from-ctor-realm.js +++ b/test/built-ins/SharedArrayBuffer/proto-from-ctor-realm.js @@ -20,7 +20,7 @@ info: | features: [Reflect] ---*/ -var other = $.createRealm().global; +var other = $262.createRealm().global; var C = new other.Function(); C.prototype = null; diff --git a/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm-sab.js b/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm-sab.js index c7dbc656a9..a9f052fb9d 100644 --- a/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm-sab.js +++ b/test/built-ins/TypedArrays/buffer-arg-proto-from-ctor-realm-sab.js @@ -28,7 +28,7 @@ features: [SharedArrayBuffer] features: [Reflect] ---*/ -var other = $.createRealm().global; +var other = $262.createRealm().global; var C = new other.Function(); C.prototype = null;