summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:43:14 +0000
commit8dd16259287f58f9273002717ec4d27e97127719 (patch)
tree3863e62a53829a84037444beab3abd4ed9dfc7d0 /js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set
parentReleasing progress-linux version 126.0.1-1~progress7.99u1. (diff)
downloadfirefox-8dd16259287f58f9273002717ec4d27e97127719.tar.xz
firefox-8dd16259287f58f9273002717ec4d27e97127719.zip
Merging upstream version 127.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set')
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js2
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js2
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js14
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js2
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js2
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js2
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js3
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js3
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js3
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js40
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js347
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js1
-rw-r--r--js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js13
25 files changed, 334 insertions, 112 deletions
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js
index 5b8dd12f01..6e6ec71a53 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/key-is-not-numeric-index-set-throws.js
@@ -34,7 +34,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(Test262Error, function() {
sample.test262 = 1;
- }, '`sample.test262 = 1` throws Test262Error');
+ });
assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`');
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js
index 104c5a8509..ecfdccbed8 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/null-tobigint.js
@@ -56,7 +56,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
typedArray[0] = null;
- }, '`typedArray[0] = null` throws TypeError');
+ });
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js
index b7724a0aed..93e6324a44 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/number-tobigint.js
@@ -56,31 +56,31 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
typedArray[0] = 1;
- }, '`typedArray[0] = 1` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = Math.pow(2, 63);
- }, '`typedArray[0] = Math.pow(2, 63)` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = +0;
- }, '`typedArray[0] = +0` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = -0;
- }, '`typedArray[0] = -0` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = Infinity;
- }, '`typedArray[0] = Infinity` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = -Infinity;
- }, '`typedArray[0] = -Infinity` throws TypeError');
+ });
assert.throws(TypeError, function() {
typedArray[0] = NaN;
- }, '`typedArray[0] = NaN` throws TypeError');
+ });
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js
index f0646cc025..898edef334 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/string-nan-tobigint.js
@@ -60,7 +60,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(SyntaxError, function() {
typedArray[0] = "definately not a number";
- }, '`typedArray[0] = "definately not a number"` throws SyntaxError');
+ });
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js
index 6b5618b568..76dbf5ded1 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/symbol-tobigint.js
@@ -58,7 +58,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
typedArray[0] = s;
- }, '`typedArray[0] = s` throws TypeError');
+ });
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js
index a2152d98f2..b0f99816e4 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/BigInt/undefined-tobigint.js
@@ -57,7 +57,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
typedArray[0] = undefined;
- }, '`typedArray[0] = undefined` throws TypeError');
+ });
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js
index d2355a13c4..5ee59a7075 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/bigint-tonumber.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2018 Valerie Young. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@@ -55,7 +56,7 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(TypeError, function() {
typedArray[0] = 1n;
- }, '`typedArray[0] = 1n` throws TypeError');
+ });
});
reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js
index b97ef770e1..079f249552 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation-consistent-nan.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js
index 786b0c4bec..896863d4d1 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/conversion-operation.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js
index 81a22ef437..733061e5cf 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-not-numeric-index.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js
index 183070c85b..da083b6c8b 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-key-is-symbol.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js
index 5e6269b2e9..133f1aa0fa 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer-realm.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js
index 705b22dca5..f34756f129 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/detached-buffer.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@@ -51,7 +52,7 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(Test262Error, function() {
sample['0'] = obj;
- }, '`sample[\'0\'] = obj` throws Test262Error');
+ });
});
reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js
index 66cf4571ec..b530dd0da6 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/indexed-value.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js
index c171aa1a3c..0b388babb5 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-minus-zero.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js
index 72d1f7769a..65a8eead9c 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-canonical-index.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js
index a13b9cfe79..2d3957b4b1 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-integer.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js
index 13360bfa55..ae41a4ab80 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index-set-throws.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@@ -34,7 +35,7 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(Test262Error, function() {
sample.test262 = 1;
- }, '`sample.test262 = 1` throws Test262Error');
+ });
assert.sameValue(sample.test262, undefined, 'The value of sample.test262 is expected to equal `undefined`');
});
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js
index 9db75bd292..bb25303fc9 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-not-numeric-index.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js
index 5470398b71..9fa3d49a53 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-out-of-bounds.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js
index fe624e4725..8f1313b9fd 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/key-is-symbol.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js
new file mode 100644
index 0000000000..62268e26b6
--- /dev/null
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/resized-out-of-bounds-to-in-bounds-index.js
@@ -0,0 +1,40 @@
+// |reftest| shell-option(--enable-arraybuffer-resizable) skip-if(!ArrayBuffer.prototype.resize||!xulRuntime.shell) -- resizable-arraybuffer is not enabled unconditionally, requires shell-options
+// Copyright (C) 2024 André Bargull. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-typedarraysetelement
+description: >
+ Index is validated after converting the right-hand side operand.
+info: |
+ TypedArraySetElement ( O, index, value )
+ ...
+ 2. Otherwise, let numValue be ? ToNumber(value).
+ 3. If IsValidIntegerIndex(O, index) is true, then
+ ...
+
+features: [TypedArray, resizable-arraybuffer]
+---*/
+
+let rab = new ArrayBuffer(0, {maxByteLength: 1});
+let ta = new Int8Array(rab);
+
+// Index is initially out-of-bounds.
+let index = 0;
+
+let value = {
+ valueOf() {
+ // Make `index` an in-bounds access.
+ rab.resize(1);
+ return 100;
+ }
+};
+
+assert.sameValue(ta.length, 0);
+
+ta[index] = value;
+
+assert.sameValue(ta.length, 1);
+assert.sameValue(ta[0], 100);
+
+reportCompare(0, 0);
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js
index c32f046213..c888512cb3 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/shell.js
@@ -53,7 +53,22 @@ var byteConversionValues = {
-4294967296, // - ( 2 ** 32 )
Infinity,
-Infinity,
- 0
+ 0,
+ 2049, // an integer which rounds down under ties-to-even when cast to float16
+ 2051, // an integer which rounds up under ties-to-even when cast to float16
+ 0.00006103515625, // smallest normal float16
+ 0.00006097555160522461, // largest subnormal float16
+ 5.960464477539063e-8, // smallest float16
+ 2.9802322387695312e-8, // largest double which rounds to 0 when cast to float16
+ 2.980232238769532e-8, // smallest double which does not round to 0 when cast to float16
+ 8.940696716308594e-8, // a double which rounds up to a subnormal under ties-to-even when cast to float16
+ 1.4901161193847656e-7, // a double which rounds down to a subnormal under ties-to-even when cast to float16
+ 1.490116119384766e-7, // the next double above the one on the previous line one
+ 65504, // max finite float16
+ 65520, // smallest double which rounds to infinity when cast to float16
+ 65519.99999999999, // largest double which does not round to infinity when cast to float16
+ 0.000061005353927612305, // smallest double which rounds to a non-subnormal when cast to float16
+ 0.0000610053539276123 // largest double which rounds to a subnormal when cast to float16
],
expected: {
@@ -98,7 +113,22 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 1, // 2049
+ 3, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ -32, // 65504
+ -16, // 65520
+ -17, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Uint8: [
127, // 127
@@ -141,7 +171,22 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 1, // 2049
+ 3, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ 224, // 65504
+ 240, // 65520
+ 239, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Uint8Clamped: [
127, // 127
@@ -184,7 +229,22 @@ var byteConversionValues = {
0, // -4294967296
255, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 255, // 2049
+ 255, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ 255, // 65504
+ 255, // 65520
+ 255, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Int16: [
127, // 127
@@ -227,7 +287,22 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ -32, // 65504
+ -16, // 65520
+ -17, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Uint16: [
127, // 127
@@ -270,7 +345,22 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ 65504, // 65504
+ 65520, // 65520
+ 65519, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Int32: [
127, // 127
@@ -313,7 +403,22 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ 65504, // 65504
+ 65520, // 65520
+ 65519, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Uint32: [
127, // 127
@@ -356,93 +461,138 @@ var byteConversionValues = {
0, // -4294967296
0, // Infinity
0, // -Infinity
- 0
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0, // 0.00006103515625
+ 0, // 0.00006097555160522461
+ 0, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 0, // 2.980232238769532e-8
+ 0, // 8.940696716308594e-8
+ 0, // 1.4901161193847656e-7
+ 0, // 1.490116119384766e-7
+ 65504, // 65504
+ 65520, // 65520
+ 65519, // 65519.99999999999
+ 0, // 0.000061005353927612305
+ 0 // 0.0000610053539276123
],
Float16: [
- 127, // 127
- 128, // 128
- 32768, // 32767
- 32768, // 32768
- Infinity, // 2147483647
- Infinity, // 2147483648
- 255, // 255
- 256, // 256
- Infinity, // 65535
- Infinity, // 65536
- Infinity, // 4294967295
- Infinity, // 4294967296
- Infinity, // 9007199254740991
- Infinity, // 9007199254740992
- 1.099609375, // 1.1
- 0.0999755859375, // 0.1
- 0.5, // 0.5
- 0.5, // 0.50000001,
- 0.60009765625, // 0.6
- 0.7001953125, // 0.7
- NaN, // undefined
- -1, // -1
- -0, // -0
- -0.0999755859375, // -0.1
- -1.099609375, // -1.1
- NaN, // NaN
- -127, // -127
- -128, // -128
- -32768, // -32767
- -32768, // -32768
- -Infinity, // -2147483647
- -Infinity, // -2147483648
- -255, // -255
- -256, // -256
- -Infinity, // -65535
- -Infinity, // -65536
- -Infinity, // -4294967295
- -Infinity, // -4294967296
- Infinity, // Infinity
- -Infinity, // -Infinity
- 0
+ 127, // 127
+ 128, // 128
+ 32768, // 32767
+ 32768, // 32768
+ Infinity, // 2147483647
+ Infinity, // 2147483648
+ 255, // 255
+ 256, // 256
+ Infinity, // 65535
+ Infinity, // 65536
+ Infinity, // 4294967295
+ Infinity, // 4294967296
+ Infinity, // 9007199254740991
+ Infinity, // 9007199254740992
+ 1.099609375, // 1.1
+ 0.0999755859375, // 0.1
+ 0.5, // 0.5
+ 0.5, // 0.50000001,
+ 0.60009765625, // 0.6
+ 0.7001953125, // 0.7
+ NaN, // undefined
+ -1, // -1
+ -0, // -0
+ -0.0999755859375, // -0.1
+ -1.099609375, // -1.1
+ NaN, // NaN
+ -127, // -127
+ -128, // -128
+ -32768, // -32767
+ -32768, // -32768
+ -Infinity, // -2147483647
+ -Infinity, // -2147483648
+ -255, // -255
+ -256, // -256
+ -Infinity, // -65535
+ -Infinity, // -65536
+ -Infinity, // -4294967295
+ -Infinity, // -4294967296
+ Infinity, // Infinity
+ -Infinity, // -Infinity
+ 0, // 0
+ 2048, // 2049
+ 2052, // 2051
+ 0.00006103515625, // 0.00006103515625
+ 0.00006097555160522461, // 0.00006097555160522461
+ 5.960464477539063e-8, // 5.960464477539063e-8
+ 0, // 2.9802322387695312e-8
+ 5.960464477539063e-8, // 2.980232238769532e-8
+ 1.1920928955078125e-7, // 8.940696716308594e-8
+ 1.1920928955078125e-7, // 1.4901161193847656e-7
+ 1.7881393432617188e-7, // 1.490116119384766e-7
+ 65504, // 65504
+ Infinity, // 65520
+ 65504, // 65519.99999999999
+ 0.00006103515625, // 0.000061005353927612305
+ 0.00006097555160522461 // 0.0000610053539276123
],
Float32: [
- 127, // 127
- 128, // 128
- 32767, // 32767
- 32768, // 32768
- 2147483648, // 2147483647
- 2147483648, // 2147483648
- 255, // 255
- 256, // 256
- 65535, // 65535
- 65536, // 65536
- 4294967296, // 4294967295
- 4294967296, // 4294967296
- 9007199254740992, // 9007199254740991
- 9007199254740992, // 9007199254740992
- 1.100000023841858, // 1.1
- 0.10000000149011612, // 0.1
- 0.5, // 0.5
- 0.5, // 0.50000001,
- 0.6000000238418579, // 0.6
- 0.699999988079071, // 0.7
- NaN, // undefined
- -1, // -1
- -0, // -0
- -0.10000000149011612, // -0.1
- -1.100000023841858, // -1.1
- NaN, // NaN
- -127, // -127
- -128, // -128
- -32767, // -32767
- -32768, // -32768
- -2147483648, // -2147483647
- -2147483648, // -2147483648
- -255, // -255
- -256, // -256
- -65535, // -65535
- -65536, // -65536
- -4294967296, // -4294967295
- -4294967296, // -4294967296
- Infinity, // Infinity
- -Infinity, // -Infinity
- 0
+ 127, // 127
+ 128, // 128
+ 32767, // 32767
+ 32768, // 32768
+ 2147483648, // 2147483647
+ 2147483648, // 2147483648
+ 255, // 255
+ 256, // 256
+ 65535, // 65535
+ 65536, // 65536
+ 4294967296, // 4294967295
+ 4294967296, // 4294967296
+ 9007199254740992, // 9007199254740991
+ 9007199254740992, // 9007199254740992
+ 1.100000023841858, // 1.1
+ 0.10000000149011612, // 0.1
+ 0.5, // 0.5
+ 0.5, // 0.50000001,
+ 0.6000000238418579, // 0.6
+ 0.699999988079071, // 0.7
+ NaN, // undefined
+ -1, // -1
+ -0, // -0
+ -0.10000000149011612, // -0.1
+ -1.100000023841858, // -1.1
+ NaN, // NaN
+ -127, // -127
+ -128, // -128
+ -32767, // -32767
+ -32768, // -32768
+ -2147483648, // -2147483647
+ -2147483648, // -2147483648
+ -255, // -255
+ -256, // -256
+ -65535, // -65535
+ -65536, // -65536
+ -4294967296, // -4294967295
+ -4294967296, // -4294967296
+ Infinity, // Infinity
+ -Infinity, // -Infinity
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0.00006103515625, // 0.00006103515625
+ 0.00006097555160522461, // 0.00006097555160522461
+ 5.960464477539063e-8, // 5.960464477539063e-8
+ 2.9802322387695312e-8, // 2.9802322387695312e-8
+ 2.9802322387695312e-8, // 2.980232238769532e-8
+ 8.940696716308594e-8, // 8.940696716308594e-8
+ 1.4901161193847656e-7, // 1.4901161193847656e-7
+ 1.4901161193847656e-7, // 1.490116119384766e-7
+ 65504, // 65504
+ 65520, // 65520
+ 65520, // 65519.99999999999
+ 0.000061005353927612305, // 0.000061005353927612305
+ 0.000061005353927612305 // 0.0000610053539276123
],
Float64: [
127, // 127
@@ -485,7 +635,22 @@ var byteConversionValues = {
-4294967296, // -4294967296
Infinity, // Infinity
-Infinity, // -Infinity
- 0
+ 0, // 0
+ 2049, // 2049
+ 2051, // 2051
+ 0.00006103515625, // 0.00006103515625
+ 0.00006097555160522461, // 0.00006097555160522461
+ 5.960464477539063e-8, // 5.960464477539063e-8
+ 2.9802322387695312e-8, // 2.9802322387695312e-8
+ 2.980232238769532e-8, // 2.980232238769532e-8
+ 8.940696716308594e-8, // 8.940696716308594e-8
+ 1.4901161193847656e-7, // 1.4901161193847656e-7
+ 1.490116119384766e-7, // 1.490116119384766e-7
+ 65504, // 65504
+ 65520, // 65520
+ 65519.99999999999, // 65519.99999999999
+ 0.000061005353927612305, // 0.000061005353927612305
+ 0.0000610053539276123 // 0.0000610053539276123
]
}
};
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js
index bdb3a74ae9..b1e0131ab5 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-detached-buffer.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2017 Mozilla Corporation. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
diff --git a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js
index 08f17de272..5991c52715 100644
--- a/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js
+++ b/js/src/tests/test262/built-ins/TypedArrayConstructors/internals/Set/tonumber-value-throws.js
@@ -1,3 +1,4 @@
+// |reftest| shell-option(--enable-float16array)
// Copyright (C) 2016 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
@@ -37,27 +38,27 @@ testWithTypedArrayConstructors(function(TA) {
assert.throws(Test262Error, function() {
sample["0"] = obj;
- }, '`sample["0"] = obj` throws Test262Error');
+ });
assert.throws(Test262Error, function() {
sample["1.1"] = obj;
- }, '`sample["1.1"] = obj` throws Test262Error');
+ });
assert.throws(Test262Error, function() {
sample["-0"] = obj;
- }, '`sample["-0"] = obj` throws Test262Error');
+ });
assert.throws(Test262Error, function() {
sample["-1"] = obj;
- }, '`sample["-1"] = obj` throws Test262Error');
+ });
assert.throws(Test262Error, function() {
sample["1"] = obj;
- }, '`sample["1"] = obj` throws Test262Error');
+ });
assert.throws(Test262Error, function() {
sample["2"] = obj;
- }, '`sample["2"] = obj` throws Test262Error');
+ });
});
reportCompare(0, 0);