From a1faccdd411192f6dd1a694507eb872f1bbe6516 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bargull?= Date: Tue, 24 Apr 2018 09:52:35 -0700 Subject: [PATCH] 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) --- features.txt | 1 - .../eval-code/direct/block-decl-nostrict.js | 0 .../direct/switch-case-decl-nostrict.js | 0 .../direct/switch-dflt-decl-nostrict.js | 0 .../function-code/block-decl-nostrict.js | 0 .../switch-case-decl-nostrict.js | 0 .../switch-dflt-decl-nostrict.js | 0 .../Atomics/store/nonshared-int-views.js | 2 +- .../Atomics/sub/nonshared-int-views.js | 2 +- .../built-ins/Atomics/wait/nan-for-timeout.js | 2 +- test/built-ins/BigInt/constructor-integer.js | 34 +++++++++++++++---- 11 files changed, 31 insertions(+), 10 deletions(-) rename test/{ => annexB}/language/eval-code/direct/block-decl-nostrict.js (100%) rename test/{ => annexB}/language/eval-code/direct/switch-case-decl-nostrict.js (100%) rename test/{ => annexB}/language/eval-code/direct/switch-dflt-decl-nostrict.js (100%) rename test/{ => annexB}/language/function-code/block-decl-nostrict.js (100%) rename test/{ => annexB}/language/function-code/switch-case-decl-nostrict.js (100%) rename test/{ => annexB}/language/function-code/switch-dflt-decl-nostrict.js (100%) diff --git a/features.txt b/features.txt index deafacba9b..160fe784a4 100644 --- a/features.txt +++ b/features.txt @@ -154,4 +154,3 @@ WeakSet # object, go here. IsHTMLDDA -CannotSuspendMainAgent diff --git a/test/language/eval-code/direct/block-decl-nostrict.js b/test/annexB/language/eval-code/direct/block-decl-nostrict.js similarity index 100% rename from test/language/eval-code/direct/block-decl-nostrict.js rename to test/annexB/language/eval-code/direct/block-decl-nostrict.js diff --git a/test/language/eval-code/direct/switch-case-decl-nostrict.js b/test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js similarity index 100% rename from test/language/eval-code/direct/switch-case-decl-nostrict.js rename to test/annexB/language/eval-code/direct/switch-case-decl-nostrict.js diff --git a/test/language/eval-code/direct/switch-dflt-decl-nostrict.js b/test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js similarity index 100% rename from test/language/eval-code/direct/switch-dflt-decl-nostrict.js rename to test/annexB/language/eval-code/direct/switch-dflt-decl-nostrict.js diff --git a/test/language/function-code/block-decl-nostrict.js b/test/annexB/language/function-code/block-decl-nostrict.js similarity index 100% rename from test/language/function-code/block-decl-nostrict.js rename to test/annexB/language/function-code/block-decl-nostrict.js diff --git a/test/language/function-code/switch-case-decl-nostrict.js b/test/annexB/language/function-code/switch-case-decl-nostrict.js similarity index 100% rename from test/language/function-code/switch-case-decl-nostrict.js rename to test/annexB/language/function-code/switch-case-decl-nostrict.js diff --git a/test/language/function-code/switch-dflt-decl-nostrict.js b/test/annexB/language/function-code/switch-dflt-decl-nostrict.js similarity index 100% rename from test/language/function-code/switch-dflt-decl-nostrict.js rename to test/annexB/language/function-code/switch-dflt-decl-nostrict.js diff --git a/test/built-ins/Atomics/store/nonshared-int-views.js b/test/built-ins/Atomics/store/nonshared-int-views.js index d6bda379c1..2f0d698bb4 100644 --- a/test/built-ins/Atomics/store/nonshared-int-views.js +++ b/test/built-ins/Atomics/store/nonshared-int-views.js @@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") { } testWithTypedArrayConstructors(function(TA) { - assert.throws(TypeError, (() => Atomics.store(new TA(ab), 0, 0))); + assert.throws(TypeError, (() => Atomics.store(new TA(buffer), 0, 0))); }, views); diff --git a/test/built-ins/Atomics/sub/nonshared-int-views.js b/test/built-ins/Atomics/sub/nonshared-int-views.js index 8644c98e53..3352ad9453 100644 --- a/test/built-ins/Atomics/sub/nonshared-int-views.js +++ b/test/built-ins/Atomics/sub/nonshared-int-views.js @@ -18,5 +18,5 @@ if (typeof BigInt !== "undefined") { } testWithTypedArrayConstructors(function(TA) { - assert.throws(TypeError, (() => Atomics.sub(new TA(ab), 0, 0))); + assert.throws(TypeError, (() => Atomics.sub(new TA(buffer), 0, 0))); }, views); diff --git a/test/built-ins/Atomics/wait/nan-for-timeout.js b/test/built-ins/Atomics/wait/nan-for-timeout.js index bfc3bd4825..a9026163bc 100644 --- a/test/built-ins/Atomics/wait/nan-for-timeout.js +++ b/test/built-ins/Atomics/wait/nan-for-timeout.js @@ -38,5 +38,5 @@ var int32Array = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEME $262.agent.broadcast(int32Array.buffer); $262.agent.sleep(500); // Ample time -assert.sameValue(getReport(), null); assert.sameValue(Atomics.wake(int32Array, 0), 1); +assert.sameValue(getReport(), "ok"); diff --git a/test/built-ins/BigInt/constructor-integer.js b/test/built-ins/BigInt/constructor-integer.js index b416e43ecc..a54d84b7a4 100644 --- a/test/built-ins/BigInt/constructor-integer.js +++ b/test/built-ins/BigInt/constructor-integer.js @@ -27,10 +27,32 @@ assert.sameValue( "BigInt(-Number.MAX_SAFE_INTEGER) === -9007199254740991n" ); -assert.throws(RangeError, function() { - BigInt(Number.MAX_SAFE_INTEGER + 1); -}, "BigInt(Number.MAX_SAFE_INTEGER + 1) throws RangeError"); +assert.sameValue( + BigInt(Number.MAX_SAFE_INTEGER + 1), 9007199254740992n, + "BigInt(Number.MAX_SAFE_INTEGER + 1) === 9007199254740992n" +); -assert.throws(RangeError, function() { - BigInt(-Number.MAX_SAFE_INTEGER - 1); -}, "BigInt(-Number.MAX_SAFE_INTEGER - 1) throws RangeError"); +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.sameValue( + BigInt(-Number.MAX_SAFE_INTEGER - 2), -9007199254740992n, + "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" +);