mirror of
https://github.com/tc39/test262.git
synced 2025-07-26 23:44:27 +02:00
fixup from pr feedback
This commit is contained in:
parent
0059b4783d
commit
9d909ed681
@ -24,10 +24,13 @@ $262.agent.receiveBroadcast(function (sab, id) {
|
|||||||
var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
var ia = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
||||||
|
|
||||||
$262.agent.broadcast(ia.buffer);
|
$262.agent.broadcast(ia.buffer);
|
||||||
|
|
||||||
assert.sameValue(getReport(), "timed-out");
|
assert.sameValue(getReport(), "timed-out");
|
||||||
assert.sameValue((getReport() | 0) >= 500 - $ATOMICS_MAX_TIME_EPSILON, true);
|
assert.sameValue((getReport() | 0) >= 500 - $ATOMICS_MAX_TIME_EPSILON, true);
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
|
||||||
|
>>>>>>> fixup from pr feedback
|
||||||
function getReport() {
|
function getReport() {
|
||||||
var r;
|
var r;
|
||||||
while ((r = $262.agent.getReport()) == null)
|
while ((r = $262.agent.getReport()) == null)
|
||||||
|
@ -28,5 +28,3 @@ function getReport() {
|
|||||||
$262.agent.sleep(100);
|
$262.agent.sleep(100);
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
assert.sameValue(Atomics.wake(ia, 0), 0);
|
|
||||||
|
@ -33,18 +33,19 @@ $262.agent.start(
|
|||||||
$262.agent.receiveBroadcast(function (sab) {
|
$262.agent.receiveBroadcast(function (sab) {
|
||||||
|
|
||||||
var int32Array = new Int32Array(sab);
|
var int32Array = new Int32Array(sab);
|
||||||
|
|
||||||
var poisoned = {
|
var poisoned = {
|
||||||
valueOf: false,
|
valueOf: false,
|
||||||
toString: false
|
toString: false
|
||||||
};
|
};
|
||||||
|
var err;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Atomics.wait(int32Array, 0, 0, poisoned);
|
Atomics.wait(int32Array, 0, 0, poisoned);
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
$262.agent.report(e.name);
|
err = e.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$262.agent.report(err);
|
||||||
$262.agent.leaving();
|
$262.agent.leaving();
|
||||||
})
|
})
|
||||||
`);
|
`);
|
||||||
@ -54,8 +55,6 @@ var int32Array = new Int32Array(sab);
|
|||||||
|
|
||||||
$262.agent.broadcast(int32Array.buffer);
|
$262.agent.broadcast(int32Array.buffer);
|
||||||
|
|
||||||
$262.agent.sleep(150);
|
|
||||||
|
|
||||||
assert.sameValue(getReport(), 'TypeError');
|
assert.sameValue(getReport(), 'TypeError');
|
||||||
|
|
||||||
assert.sameValue(Atomics.wake(int32Array, 0), 0);
|
assert.sameValue(Atomics.wake(int32Array, 0), 0);
|
||||||
|
@ -27,13 +27,15 @@ $262.agent.start(
|
|||||||
$262.agent.receiveBroadcast(function (sab) {
|
$262.agent.receiveBroadcast(function (sab) {
|
||||||
|
|
||||||
var int32Array = new Int32Array(sab);
|
var int32Array = new Int32Array(sab);
|
||||||
|
var err;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Atomics.wait(int32Array, 0, 0, Symbol('foo'));
|
Atomics.wait(int32Array, 0, 0, Symbol('foo'));
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
$262.agent.report(e.name);
|
err = e.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$262.agent.report(err);
|
||||||
$262.agent.leaving();
|
$262.agent.leaving();
|
||||||
})
|
})
|
||||||
`);
|
`);
|
||||||
@ -43,8 +45,4 @@ var int32Array = new Int32Array(sab);
|
|||||||
|
|
||||||
$262.agent.broadcast(int32Array.buffer);
|
$262.agent.broadcast(int32Array.buffer);
|
||||||
|
|
||||||
$262.agent.sleep(150);
|
|
||||||
|
|
||||||
assert.sameValue(getReport(), 'TypeError');
|
assert.sameValue(getReport(), 'TypeError');
|
||||||
|
|
||||||
assert.sameValue(Atomics.wake(int32Array, 0), 0);
|
|
||||||
|
@ -38,7 +38,7 @@ var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEME
|
|||||||
|
|
||||||
$262.agent.broadcast(int32Array.buffer);
|
$262.agent.broadcast(int32Array.buffer);
|
||||||
|
|
||||||
$262.agent.sleep(150);
|
$262.agent.sleep(2);
|
||||||
|
|
||||||
var r1 = getReport();
|
var r1 = getReport();
|
||||||
var r2 = getReport();
|
var r2 = getReport();
|
||||||
|
@ -17,8 +17,9 @@ features: [ Atomics, SharedArrayBuffer, TypedArray ]
|
|||||||
|
|
||||||
function getReport() {
|
function getReport() {
|
||||||
var r;
|
var r;
|
||||||
while ((r = $262.agent.getReport()) == null)
|
while ((r = $262.agent.getReport()) == null) {
|
||||||
$262.agent.sleep(100);
|
$262.agent.sleep(100);
|
||||||
|
}
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user