Skip to content
Snippets Groups Projects
Commit a1faccdd authored by André Bargull's avatar André Bargull
Browse files

Fix various test bugs

- "CannotSuspendMainAgent" feature was changed to "CanBlockIsFalse" flag
- Move annex-b tests into annex-b directory
- Update variable names in nonshared-int-views.js tests
- Move getReport() call in nan-for-timeout.js to avoid iloop
- Update BigInt constructor to match new semantics (tc39/proposal-bigint#138)
parent c55d2ab7
No related branches found
No related tags found
No related merge requests found
Showing
with 31 additions and 10 deletions
...@@ -154,4 +154,3 @@ WeakSet ...@@ -154,4 +154,3 @@ WeakSet
# object, go here. # object, go here.
IsHTMLDDA IsHTMLDDA
CannotSuspendMainAgent
...@@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") { ...@@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") {
} }
testWithTypedArrayConstructors(function(TA) { testWithTypedArrayConstructors(function(TA) {
assert.throws(TypeError, (() => Atomics.store(new TA(ab), 0, 0))); assert.throws(TypeError, (() => Atomics.store(new TA(buffer), 0, 0)));
}, views); }, views);
...@@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") { ...@@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") {
} }
testWithTypedArrayConstructors(function(TA) { testWithTypedArrayConstructors(function(TA) {
assert.throws(TypeError, (() => Atomics.sub(new TA(ab), 0, 0))); assert.throws(TypeError, (() => Atomics.sub(new TA(buffer), 0, 0)));
}, views); }, views);
...@@ -38,5 +38,5 @@ var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEME ...@@ -38,5 +38,5 @@ var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEME
$262.agent.broadcast(int32Array.buffer); $262.agent.broadcast(int32Array.buffer);
$262.agent.sleep(500); // Ample time $262.agent.sleep(500); // Ample time
assert.sameValue(getReport(), null);
assert.sameValue(Atomics.wake(int32Array, 0), 1); assert.sameValue(Atomics.wake(int32Array, 0), 1);
assert.sameValue(getReport(), "ok");
...@@ -27,10 +27,32 @@ assert.sameValue( ...@@ -27,10 +27,32 @@ assert.sameValue(
"BigInt(-Number.MAX_SAFE_INTEGER) === -9007199254740991n" "BigInt(-Number.MAX_SAFE_INTEGER) === -9007199254740991n"
); );
assert.throws(RangeError, function() { assert.sameValue(
BigInt(Number.MAX_SAFE_INTEGER + 1); BigInt(Number.MAX_SAFE_INTEGER + 1), 9007199254740992n,
}, "BigInt(Number.MAX_SAFE_INTEGER + 1) throws RangeError"); "BigInt(Number.MAX_SAFE_INTEGER + 1) === 9007199254740992n"
);
assert.sameValue(
BigInt(-Number.MAX_SAFE_INTEGER - 1), -9007199254740992n,
"BigInt(-Number.MAX_SAFE_INTEGER - 1) === -9007199254740992n"
);
assert.sameValue(
BigInt(Number.MAX_SAFE_INTEGER + 2), 9007199254740992n,
"BigInt(Number.MAX_SAFE_INTEGER + 2) === 9007199254740992n"
);
assert.throws(RangeError, function() { assert.sameValue(
BigInt(-Number.MAX_SAFE_INTEGER - 1); BigInt(-Number.MAX_SAFE_INTEGER - 2), -9007199254740992n,
}, "BigInt(-Number.MAX_SAFE_INTEGER - 1) throws RangeError"); "BigInt(-Number.MAX_SAFE_INTEGER - 2) === -9007199254740992n"
);
assert.sameValue(
BigInt(Number.MAX_SAFE_INTEGER + 3), 9007199254740994n,
"BigInt(Number.MAX_SAFE_INTEGER + 3) === 9007199254740994n"
);
assert.sameValue(
BigInt(-Number.MAX_SAFE_INTEGER - 3), -9007199254740994n,
"BigInt(-Number.MAX_SAFE_INTEGER - 3) === -9007199254740994n"
);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment