mirror of https://github.com/tc39/test262.git
parent
c472aeea4b
commit
bc433f1e1c
|
@ -39,5 +39,5 @@ assert.throws(RangeError, function() {
|
|||
}, '`Atomics.waitAsync(i64a, -1, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.waitAsync(i64a, -300, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i64a, -300, poisoned, poisoned)` throws RangeError');
|
||||
}, '`Atomics.waitAsync(i64a, -300, poisoned, poisoned)` throws RangeError');
|
||||
|
||||
|
|
|
@ -32,15 +32,15 @@ const poisoned = {
|
|||
};
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i64a, Infinity, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i64a, Infinity, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i64a, Infinity, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i64a, Infinity, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i64a, -1, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i64a, -1, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i64a, -1, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i64a, -1, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i64a, 4, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i64a, 4, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i64a, 4, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i64a, 4, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i64a, 200, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i64a, 200, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i64a, 200, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i64a, 200, poisoned, poisoned)` throws RangeError');
|
||||
|
||||
|
|
|
@ -44,12 +44,12 @@ $262.agent.start(`
|
|||
let status2 = '';
|
||||
|
||||
try {
|
||||
Atomics.wait(i64a, 0, 0n, poisonedValueOf);
|
||||
Atomics.waitAsync(i64a, 0, 0n, poisonedValueOf);
|
||||
} catch (error) {
|
||||
status1 = 'poisonedValueOf';
|
||||
}
|
||||
try {
|
||||
Atomics.wait(i64a, 0, 0n, poisonedToPrimitive);
|
||||
Atomics.waitAsync(i64a, 0, 0n, poisonedToPrimitive);
|
||||
} catch (error) {
|
||||
status2 = 'poisonedToPrimitive';
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ $262.agent.safeBroadcastAsync(i64a, RUNNING, 1n).then(async agentCount => {
|
|||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'poisonedValueOf',
|
||||
'Atomics.wait(i64a, 0, 0n, poisonedValueOf) throws'
|
||||
'Atomics.waitAsync(i64a, 0, 0n, poisonedValueOf) throws'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'poisonedToPrimitive',
|
||||
'Atomics.wait(i64a, 0, 0n, poisonedToPrimitive) throws'
|
||||
'Atomics.waitAsync(i64a, 0, 0n, poisonedToPrimitive) throws'
|
||||
);
|
||||
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
|
|
@ -34,9 +34,9 @@ const poisonedToPrimitive = {
|
|||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wait(i64a, 0, 0n, poisonedValueOf);
|
||||
}, '`Atomics.wait(i64a, 0, 0n, poisonedValueOf)` throws Test262Error');
|
||||
Atomics.waitAsync(i64a, 0, 0n, poisonedValueOf);
|
||||
}, '`Atomics.waitAsync(i64a, 0, 0n, poisonedValueOf)` throws Test262Error');
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wait(i64a, 0, 0n, poisonedToPrimitive);
|
||||
}, '`Atomics.wait(i64a, 0, 0n, poisonedToPrimitive)` throws Test262Error');
|
||||
Atomics.waitAsync(i64a, 0, 0n, poisonedToPrimitive);
|
||||
}, '`Atomics.waitAsync(i64a, 0, 0n, poisonedToPrimitive)` throws Test262Error');
|
||||
|
|
|
@ -55,13 +55,13 @@ $262.agent.safeBroadcastAsync(i64a, RUNNING, 1n).then(async agentCount => {
|
|||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'A TypeError',
|
||||
'Atomics.wait(i64a, 0, 0n, Symbol("1")) throws TypeError'
|
||||
'Atomics.waitAsync(i64a, 0, 0n, Symbol("1")) throws TypeError'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'B TypeError',
|
||||
'Atomics.wait(i64a, 0, 0n, Symbol("2")) throws TypeError'
|
||||
'Atomics.waitAsync(i64a, 0, 0n, Symbol("2")) throws TypeError'
|
||||
);
|
||||
|
||||
assert.sameValue(Atomics.notify(i64a, 0), 0, 'Atomics.notify(i64a, 0) returns 0');
|
||||
|
|
|
@ -39,4 +39,4 @@ assert.throws(RangeError, function() {
|
|||
}, '`Atomics.waitAsync(i32a, -1, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.waitAsync(i32a, -300, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i32a, -300, poisoned, poisoned)` throws RangeError');
|
||||
}, '`Atomics.waitAsync(i32a, -300, poisoned, poisoned)` throws RangeError');
|
||||
|
|
|
@ -32,14 +32,14 @@ const poisoned = {
|
|||
};
|
||||
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i32a, Infinity, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i32a, Infinity, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i32a, Infinity, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i32a, Infinity, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i32a, -1, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i32a, -1, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i32a, -1, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i32a, -1, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i32a, 4, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i32a, 4, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i32a, 4, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i32a, 4, poisoned, poisoned)` throws RangeError');
|
||||
assert.throws(RangeError, function() {
|
||||
Atomics.wait(i32a, 200, poisoned, poisoned);
|
||||
}, '`Atomics.wait(i32a, 200, poisoned, poisoned)` throws RangeError');
|
||||
Atomics.waitAsync(i32a, 200, poisoned, poisoned);
|
||||
}, '`Atomics.waitAsync(i32a, 200, poisoned, poisoned)` throws RangeError');
|
||||
|
|
|
@ -46,12 +46,12 @@ $262.agent.start(`
|
|||
let status2 = '';
|
||||
|
||||
try {
|
||||
Atomics.wait(i32a, 0, 0, poisonedValueOf);
|
||||
Atomics.waitAsync(i32a, 0, 0, poisonedValueOf);
|
||||
} catch (error) {
|
||||
status1 = 'poisonedValueOf';
|
||||
}
|
||||
try {
|
||||
Atomics.wait(i32a, 0, 0, poisonedToPrimitive);
|
||||
Atomics.waitAsync(i32a, 0, 0, poisonedToPrimitive);
|
||||
} catch (error) {
|
||||
status2 = 'poisonedToPrimitive';
|
||||
}
|
||||
|
@ -73,13 +73,13 @@ $262.agent.safeBroadcastAsync(i32a, RUNNING, 1).then(async (agentCount) => {
|
|||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'poisonedValueOf',
|
||||
'Atomics.wait(i32a, 0, 0, poisonedValueOf) throws'
|
||||
'Atomics.waitAsync(i32a, 0, 0, poisonedValueOf) throws'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'poisonedToPrimitive',
|
||||
'Atomics.wait(i32a, 0, 0, poisonedToPrimitive) throws'
|
||||
'Atomics.waitAsync(i32a, 0, 0, poisonedToPrimitive) throws'
|
||||
);
|
||||
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
|
|
@ -38,9 +38,9 @@ const poisonedToPrimitive = {
|
|||
};
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wait(i32a, 0, 0, poisonedValueOf);
|
||||
}, '`Atomics.wait(i32a, 0, 0, poisonedValueOf)` throws Test262Error');
|
||||
Atomics.waitAsync(i32a, 0, 0, poisonedValueOf);
|
||||
}, '`Atomics.waitAsync(i32a, 0, 0, poisonedValueOf)` throws Test262Error');
|
||||
|
||||
assert.throws(Test262Error, function() {
|
||||
Atomics.wait(i32a, 0, 0, poisonedToPrimitive);
|
||||
}, '`Atomics.wait(i32a, 0, 0, poisonedToPrimitive)` throws Test262Error');
|
||||
Atomics.waitAsync(i32a, 0, 0, poisonedToPrimitive);
|
||||
}, '`Atomics.waitAsync(i32a, 0, 0, poisonedToPrimitive)` throws Test262Error');
|
||||
|
|
|
@ -60,13 +60,13 @@ $262.agent.safeBroadcastAsync(i32a, RUNNING, 1).then(async (agentCount) => {
|
|||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'A TypeError',
|
||||
'Atomics.wait(i32a, 0, 0, Symbol("1")) throws TypeError'
|
||||
'Atomics.waitAsync(i32a, 0, 0, Symbol("1")) throws TypeError'
|
||||
);
|
||||
|
||||
assert.sameValue(
|
||||
await $262.agent.getReportAsync(),
|
||||
'B TypeError',
|
||||
'Atomics.wait(i32a, 0, 0, Symbol("2")) throws TypeError'
|
||||
'Atomics.waitAsync(i32a, 0, 0, Symbol("2")) throws TypeError'
|
||||
);
|
||||
|
||||
assert.sameValue(Atomics.notify(i32a, 0), 0, 'Atomics.notify(i32a, 0) returns 0');
|
||||
|
|
|
@ -45,6 +45,6 @@ const nonSharedArrayTypes = [
|
|||
for (const nonSharedArrayType of nonSharedArrayTypes) {
|
||||
const typedArray = new nonSharedArrayType(new SharedArrayBuffer(8));
|
||||
assert.throws(TypeError, function() {
|
||||
Atomics.wait(typedArray, 0, value, 0);
|
||||
Atomics.waitAsync(typedArray, 0, value, 0);
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue