diff --git a/harness/testTypedArray.js b/harness/testTypedArray.js index 2699214ca358f7eadab04d1085d57234d604d937..7f777b56cac291eae0e703aaed2e6f1009ad3e2a 100644 --- a/harness/testTypedArray.js +++ b/harness/testTypedArray.js @@ -20,11 +20,22 @@ var typedArrayConstructors = [ Uint8ClampedArray ]; +var numericTypedArrayConstructors = typedArrayConstructors.slice(); + +if (typeof BigInt !== "undefined") { + typedArrayConstructors.push(BigInt64Array); + typedArrayConstructors.push(BigUint64Array); +} + /** * The %TypedArray% intrinsic constructor function. */ var TypedArray = Object.getPrototypeOf(Int8Array); +function convertToBigInt(x) { + return (Array.isArray(x)) ? x.map(convertToBigInt) : BigInt(x); +} + /** * Callback for testing a typed array constructor. * @@ -41,9 +52,14 @@ var TypedArray = Object.getPrototypeOf(Int8Array); function testWithTypedArrayConstructors(f, selected) { var constructors = selected || typedArrayConstructors; for (var i = 0; i < constructors.length; ++i) { + var N = function(x) { return x; }; var constructor = constructors[i]; + if (constructor.name == "BigInt64Array" || + constructor.name == "BigUint64Array") { + N = convertToBigInt; + } try { - f(constructor); + f(constructor, N); } catch (e) { e.message += " (Testing with " + constructor.name + ".)"; throw e; @@ -75,5 +91,5 @@ function testTypedArrayConversions(byteConversionValues, fn) { } fn(TA, value, exp, initial); }); - }); + }, numericTypedArrayConstructors); } diff --git a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js index 1cd62be5666d4dc5ce744785f1ce811755df59c7..50f6de2c3f726fc82e79b026499babc68fbed91b 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-end.js @@ -26,51 +26,51 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, null), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, null), + N([0, 1, 2, 3]) ), 'null value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, NaN), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, NaN), + N([0, 1, 2, 3]) ), 'NaN value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, false), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, false), + N([0, 1, 2, 3]) ), 'false value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, true), - [0, 0, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, true), + N([0, 0, 2, 3]) ), 'true value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, '-2'), - [0, 0, 1, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, '-2'), + N([0, 0, 1, 3]) ), 'string "-2" value coerced to integer -2' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, -2.5), - [0, 0, 1, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, -2.5), + N([0, 0, 1, 3]) ), 'float -2.5 value coerced to integer -2' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js index 96819e39530c0ccf3e1b1343db8f83e5003a61db..1fecbd46daef38bf7a6d7b97e5291a7e30143713 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-start.js @@ -25,67 +25,67 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, undefined), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1, undefined), + N([0, 0, 1, 2]) ), 'undefined value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, false), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1, false), + N([0, 0, 1, 2]) ), 'false value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, NaN), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1, NaN), + N([0, 0, 1, 2]) ), 'NaN value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, null), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1, null), + N([0, 0, 1, 2]) ), 'null value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, true), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, true), + N([1, 2, 3, 3]) ), 'true value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, '1'), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, '1'), + N([1, 2, 3, 3]) ), 'string "1" value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0.5), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0.5), + N([0, 0, 1, 2]) ), '0.5 float value coerced to integer 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1.5), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1.5), + N([1, 2, 3, 3]) ), '1.5 float value coerced to integer 1' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js index 8d0c2816d4ace0f1922a4bb044062cdd68ff48c8..f49d147b2675b7983eb9d860f2375cc6e92e37ce 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/coerced-values-target.js @@ -25,67 +25,67 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(undefined, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(undefined, 1), + N([1, 2, 3, 3]) ), 'undefined value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(false, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(false, 1), + N([1, 2, 3, 3]) ), 'false value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(NaN, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(NaN, 1), + N([1, 2, 3, 3]) ), 'NaN value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(null, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(null, 1), + N([1, 2, 3, 3]) ), 'null value coerced to 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(true, 0), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(true, 0), + N([0, 0, 1, 2]) ), 'true value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin('1', 0), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin('1', 0), + N([0, 0, 1, 2]) ), 'string "1" value coerced to 1' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0.5, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0.5, 1), + N([1, 2, 3, 3]) ), '0.5 float value coerced to integer 0' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1.5, 0), - [0, 0, 1, 2] + new TA(N([0, 1, 2, 3])).copyWithin(1.5, 0), + N([0, 0, 1, 2]) ), '1.5 float value coerced to integer 1' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-end.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-end.js index 96c9823f8a1ece0befa30ef6a89d0348beaa1279..4d1bb72cfeda155edf19417113906ebb559757a0 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-end.js @@ -28,67 +28,67 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1, -1), - [1, 2, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1, -1), + N([1, 2, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1, -1) -> [1, 2, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(2, 0, -1), - [0, 1, 0, 1, 2] + new TA(N([0, 1, 2, 3, 4])).copyWithin(2, 0, -1), + N([0, 1, 0, 1, 2]) ), '[0, 1, 2, 3, 4].copyWithin(2, 0, -1) -> [0, 1, 0, 1, 2]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(1, 2, -2), - [0, 2, 2, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(1, 2, -2), + N([0, 2, 2, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(1, 2, -2) -> [0, 2, 2, 3, 4]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, -2, -1), - [2, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, -2, -1), + N([2, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, -2, -1) -> [2, 1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(2, -2, -1), - [0, 1, 3, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(2, -2, -1), + N([0, 1, 3, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(2, -2, 1) -> [0, 1, 3, 3, 4]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-3, -2, -1), - [0, 2, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(-3, -2, -1), + N([0, 2, 2, 3]) ), '[0, 1, 2, 3].copyWithin(-3, -2, -1) -> [0, 2, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-2, -3, -1), - [0, 1, 2, 2, 3] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-2, -3, -1), + N([0, 1, 2, 2, 3]) ), '[0, 1, 2, 3, 4].copyWithin(-2, -3, -1) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-5, -2, -1), - [3, 1, 2, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-5, -2, -1), + N([3, 1, 2, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(-5, -2, -1) -> [3, 1, 2, 3, 4]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js index 7c55118aa109e641acc854084db6d62c9661b673..25ddbcf728fd54628f8b8d7667d44c35535edeac 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-end.js @@ -28,83 +28,83 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, 1, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, 1, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(0, 1, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, -2, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, -2, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, -2, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, -2, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, -2, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(0, -2, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, -9, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, -9, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, -9, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, -9, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, -9, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(0, -9, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-3, -2, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(-3, -2, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(-3, -2, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(-3, -2, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(-3, -2, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(-3, -2, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-7, -8, -9), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(-7, -8, -9), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(-7, -8, -9) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(-7, -8, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(-7, -8, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(-7, -8, -Infinity) -> [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js index 4fdc4eb12a3d75952c3e53502d1130f46da1e367..b439a5d2be8e0b788f470d24232e0b517e52ccb8 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-start.js @@ -26,67 +26,67 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3]).copyWithin(0, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5]).copyWithin(0, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(2, -10), - [0, 1, 0, 1, 2] + new TA(N([0, 1, 2, 3, 4])).copyWithin(2, -10), + N([0, 1, 0, 1, 2]) ), '[0, 1, 2, 3, 4]).copyWithin(2, -2) -> [0, 1, 0, 1, 2]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(2, -Infinity), - [1, 2, 1, 2, 3] + new TA(N([1, 2, 3, 4, 5])).copyWithin(2, -Infinity), + N([1, 2, 1, 2, 3]) ), '[1, 2, 3, 4, 5]).copyWithin(2, -Infinity) -> [1, 2, 1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(10, -10), - [0, 1, 2, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(10, -10), + N([0, 1, 2, 3, 4]) ), '[0, 1, 2, 3, 4]).copyWithin(10, -10) -> [0, 1, 2, 3, 4]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(10, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(10, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5]).copyWithin(10, -Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-9, -10), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(-9, -10), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(-9, -10) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(-9, -Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(-9, -Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(-9, -Infinity) -> [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js index dc46906d3d45e3689221109dce5adfa656860e50..da99b0918dce77c8fa55e4b8c4f4bb4f57db5ca6 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-out-of-bounds-target.js @@ -26,35 +26,35 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-10, 0), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(-10, 0), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(-10, 0) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(-Infinity, 0), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(-Infinity, 0), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(-Infinity, 0) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-10, 2), - [2, 3, 4, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-10, 2), + N([2, 3, 4, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(-10, 2) -> [2, 3, 4, 3, 4]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(-Infinity, 2), - [3, 4, 5, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(-Infinity, 2), + N([3, 4, 5, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(-Infinity, 2) -> [3, 4, 5, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-start.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-start.js index df73879d438336bf6209cc86a38d174052e4f765..a5c12e04d3b2718177521a98da6c238b39edb7f1 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-start.js @@ -26,51 +26,51 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, -1), - [3, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, -1), + N([3, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, -1) -> [3, 1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(2, -2), - [0, 1, 3, 4, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(2, -2), + N([0, 1, 3, 4, 4]) ), '[0, 1, 2, 3, 4].copyWithin(2, -2) -> [0, 1, 3, 4, 4]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(1, -2), - [0, 3, 4, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(1, -2), + N([0, 3, 4, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(1, -2) -> [0, 3, 4, 3, 4]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-1, -2), - [0, 1, 2, 2] + new TA(N([0, 1, 2, 3])).copyWithin(-1, -2), + N([0, 1, 2, 2]) ), '[0, 1, 2, 3].copyWithin(-1, -2) -> [ 0, 1, 2, 2 ]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-2, -3), - [0, 1, 2, 2, 3] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-2, -3), + N([0, 1, 2, 2, 3]) ), '[0, 1, 2, 3, 4].copyWithin(-2, -3) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-5, -2), - [3, 4, 2, 3, 4] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-5, -2), + N([3, 4, 2, 3, 4]) ), '[0, 1, 2, 3, 4].copyWithin(-5, -2) -> [3, 4, 2, 3, 4]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/negative-target.js b/test/built-ins/TypedArray/prototype/copyWithin/negative-target.js index dfc252b1e4a0fdbfde2504afcb5f92fd0b94d08b..18760a102c23792f51d2d436bea5581f559088c1 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/negative-target.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/negative-target.js @@ -26,27 +26,27 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-1, 0), - [0, 1, 2, 0] + new TA(N([0, 1, 2, 3])).copyWithin(-1, 0), + N([0, 1, 2, 0]) ), '[0, 1, 2, 3].copyWithin(-1, 0) -> [0, 1, 2, 0]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4]).copyWithin(-2, 2), - [0, 1, 2, 2, 3] + new TA(N([0, 1, 2, 3, 4])).copyWithin(-2, 2), + N([0, 1, 2, 2, 3]) ), '[0, 1, 2, 3, 4].copyWithin(-2, 2) -> [0, 1, 2, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(-1, 2), - [0, 1, 2, 2] + new TA(N([0, 1, 2, 3])).copyWithin(-1, 2), + N([0, 1, 2, 2]) ), '[0, 1, 2, 3].copyWithin(-1, 2) -> [0, 1, 2, 2]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js index 9767106c0fa7409145c3fd44ebd2759497ddee42..ace11ebb5a44fbb3f034fc853900aa7ca7a04199 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-end.js @@ -19,35 +19,35 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1, 6), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1, 6), + N([1, 2, 3, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1, 6) -> [1, 2, 3, 3]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, 1, Infinity), - [2, 3, 4, 5, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, 1, Infinity), + N([2, 3, 4, 5, 5]) ), '[1, 2, 3, 4, 5].copyWithin(0, 1, Infinity) -> [2, 3, 4, 5, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(1, 3, 6), - [0, 3, 4, 5, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(1, 3, 6), + N([0, 3, 4, 5, 4, 5]) ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 6) -> [0, 3, 4, 5, 4, 5]' ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(1, 3, Infinity), - [1, 4, 5, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(1, 3, Infinity), + N([1, 4, 5, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(1, 3, Infinity) -> [1, 4, 5, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js index f1cc0504a1fb3918676969f20a8e81ed31b66fa8..878009f36cde6547f6f7ff356a19beff984e57fe 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-out-of-bounds-target-and-start.js @@ -19,55 +19,55 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(6, 0), - [0, 1, 2, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(6, 0), + N([0, 1, 2, 3, 4, 5]) ) ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(Infinity, 0), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(Infinity, 0), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(Infinity, 0) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(0, 6), - [0, 1, 2, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(0, 6), + N([0, 1, 2, 3, 4, 5]) ) ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(0, Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(0, Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(0, Infinity) -> [1, 2, 3, 4, 5]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(6, 6), - [0, 1, 2, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(6, 6), + N([0, 1, 2, 3, 4, 5]) ) ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(10, 10), - [0, 1, 2, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(10, 10), + N([0, 1, 2, 3, 4, 5]) ) ); assert( compareArray( - new TA([1, 2, 3, 4, 5]).copyWithin(Infinity, Infinity), - [1, 2, 3, 4, 5] + new TA(N([1, 2, 3, 4, 5])).copyWithin(Infinity, Infinity), + N([1, 2, 3, 4, 5]) ), '[1, 2, 3, 4, 5].copyWithin(Infinity, Infinity) -> [1, 2, 3, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js index 4dec6eff807fa45ef33ee9accb311cc3288679b3..261223948d8956802dc630cb1b508db5a1956814 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-and-start.js @@ -19,32 +19,32 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([1, 2, 3, 4, 5, 6]).copyWithin(0, 0), - [1, 2, 3, 4, 5, 6] + new TA(N([1, 2, 3, 4, 5, 6])).copyWithin(0, 0), + N([1, 2, 3, 4, 5, 6]) ) ); assert( compareArray( - new TA([1, 2, 3, 4, 5, 6]).copyWithin(0, 2), - [3, 4, 5, 6, 5, 6] + new TA(N([1, 2, 3, 4, 5, 6])).copyWithin(0, 2), + N([3, 4, 5, 6, 5, 6]) ) ); assert( compareArray( - new TA([1, 2, 3, 4, 5, 6]).copyWithin(3, 0), - [1, 2, 3, 1, 2, 3] + new TA(N([1, 2, 3, 4, 5, 6])).copyWithin(3, 0), + N([1, 2, 3, 1, 2, 3]) ) ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(1, 4), - [0, 4, 5, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(1, 4), + N([0, 4, 5, 3, 4, 5]) ) ); }); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js index c8cd09f17a7258a4d4ce258ec30fc30c5485c929..bbb794cc052d9ba1344fe91855cb320b8c46a21f 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/non-negative-target-start-and-end.js @@ -19,27 +19,27 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 0, 0), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 0, 0), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, 0, 0) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 0, 2), - [0, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 0, 2), + N([0, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, 0, 2) -> [0, 1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1, 2), - [1, 1, 2, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1, 2), + N([1, 1, 2, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1, 2) -> [1, 1, 2, 3]' ); @@ -57,16 +57,16 @@ testWithTypedArrayConstructors(function(TA) { */ assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(1, 0, 2), - [0, 0, 1, 3] + new TA(N([0, 1, 2, 3])).copyWithin(1, 0, 2), + N([0, 0, 1, 3]) ), '[0, 1, 2, 3].copyWithin(1, 0, 2) -> [0, 0, 1, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3, 4, 5]).copyWithin(1, 3, 5), - [0, 3, 4, 3, 4, 5] + new TA(N([0, 1, 2, 3, 4, 5])).copyWithin(1, 3, 5), + N([0, 3, 4, 3, 4, 5]) ), '[0, 1, 2, 3, 4, 5].copyWithin(1, 3, 5) -> [0, 3, 4, 3, 4, 5]' ); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/return-this.js b/test/built-ins/TypedArray/prototype/copyWithin/return-this.js index c6ab41ced41c0bdde23df087c305a72fc67b47ca..cf34d65830504622c318091f56220fac1d26aca9 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/return-this.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/return-this.js @@ -24,13 +24,13 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(); var result1 = sample1.copyWithin(0, 0); assert.sameValue(result1, sample1); - var sample2 = new TA([1, 2, 3]); + var sample2 = new TA(N([1, 2, 3])); var result2 = sample2.copyWithin(1, 0); assert.sameValue(result2, sample2); diff --git a/test/built-ins/TypedArray/prototype/copyWithin/undefined-end.js b/test/built-ins/TypedArray/prototype/copyWithin/undefined-end.js index bd011026fabecd4d022d83224e76aa99266c9a6d..4f00f0f333ae9f548b1c764bc7d110fa73705af9 100644 --- a/test/built-ins/TypedArray/prototype/copyWithin/undefined-end.js +++ b/test/built-ins/TypedArray/prototype/copyWithin/undefined-end.js @@ -26,19 +26,19 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1, undefined), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1, undefined), + N([1, 2, 3, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1, undefined) -> [1, 2, 3]' ); assert( compareArray( - new TA([0, 1, 2, 3]).copyWithin(0, 1), - [1, 2, 3, 3] + new TA(N([0, 1, 2, 3])).copyWithin(0, 1), + N([1, 2, 3, 3]) ), '[0, 1, 2, 3].copyWithin(0, 1) -> [1, 2, 3, 3]' ); diff --git a/test/built-ins/TypedArray/prototype/entries/iter-prototype.js b/test/built-ins/TypedArray/prototype/entries/iter-prototype.js index f8635fe5774bcf4990d041bcfa4474f336440acc..bc16cf1f3f2d357518b8c2d5f7f3467108f39819 100644 --- a/test/built-ins/TypedArray/prototype/entries/iter-prototype.js +++ b/test/built-ins/TypedArray/prototype/entries/iter-prototype.js @@ -17,8 +17,8 @@ features: [Symbol.iterator, TypedArray] var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]()); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 42, 64]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 42, 64])); var iter = sample.entries(); assert.sameValue(Object.getPrototypeOf(iter), ArrayIteratorProto); diff --git a/test/built-ins/TypedArray/prototype/entries/return-itor.js b/test/built-ins/TypedArray/prototype/entries/return-itor.js index a69d4404e24e4552e65cf572a997c49378bbf737..d7db93696a9b8586941921069a724fb8e00c2c28 100644 --- a/test/built-ins/TypedArray/prototype/entries/return-itor.js +++ b/test/built-ins/TypedArray/prototype/entries/return-itor.js @@ -13,22 +13,22 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -var sample = new Int8Array([0, 42, 64]); +var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, N) { + var typedArray = new TA(N(sample)); var itor = typedArray.entries(); var next = itor.next(); - assert(compareArray(next.value, [0, 0])); + assert(compareArray(next.value, [0, N(0)])); assert.sameValue(next.done, false); next = itor.next(); - assert(compareArray(next.value, [1, 42])); + assert(compareArray(next.value, [1, N(42)])); assert.sameValue(next.done, false); next = itor.next(); - assert(compareArray(next.value, [2, 64])); + assert(compareArray(next.value, [2, N(64)])); assert.sameValue(next.done, false); next = itor.next(); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js index 548fa2602a6b54e02caedacfc4395c3d6e59f9cc..703db4713bb849f6c2beb361e7317b10dd8a46bd 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-with-thisarg.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; @@ -40,17 +40,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js index 5c3a74689004cccfc514f9c00b610c247db5bb06..033e54eacc522b0d33671c5ef0fda6dfdd741014 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-arguments-without-thisarg.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -38,17 +38,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js b/test/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js index cfd6aa77eea78ae0cedc84cb8e0c54f8f90d5699..3631c549e714b96e13dd50399e93fb473dc4020d 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-no-interaction-over-non-integer.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -36,6 +36,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - key"); assert.sameValue(results[1][1], 1, "results[1][1] - key"); - assert.sameValue(results[0][0], 7, "results[0][0] - value"); - assert.sameValue(results[1][0], 8, "results[1][0] - value"); + assert.sameValue(results[0][0], N(7), "results[0][0] - value"); + assert.sameValue(results[1][0], N(8), "results[1][0] - value"); }); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js index 5eeb597c999f2721dfa4465003f90e9c130f4957..c882314fe2d1c706cf6ff80663c9a5fee17ec23f 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-return-does-not-change-instance.js @@ -25,14 +25,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); sample.every(function() { return 43; }); - assert.sameValue(sample[0], 40, "[0] == 40"); - assert.sameValue(sample[1], 41, "[1] == 41"); - assert.sameValue(sample[2], 42, "[2] == 42"); + assert.sameValue(sample[0], N(40), "[0] == 40"); + assert.sameValue(sample[1], N(41), "[1] == 41"); + assert.sameValue(sample[2], N(42), "[2] == 42"); }); diff --git a/test/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js index 3b8f537e14479bfb88a86d11f79ede648d875192..290a3fd6947dab9738dfbd4ceae674b3eb97e6c6 100644 --- a/test/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js +++ b/test/built-ins/TypedArray/prototype/every/callbackfn-set-value-during-interaction.js @@ -25,24 +25,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.every(function(val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); @@ -52,7 +52,7 @@ testWithTypedArrayConstructors(function(TA) { return true; }); - assert.sameValue(sample[0], 7, "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js index e7bbae8fcd601843197ae45c33ca008429607ce1..7101f75c640709878f7f9aa33027b336d9682151 100644 --- a/test/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/every/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var calls = 0; Object.defineProperty(TA.prototype, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/every/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/every/values-are-not-cached.js index d9afa33bb702665d207766ddebf2c17e25fbccec..e9cec7b7fa074d8d052a8a546b75ca24bbd1a811 100644 --- a/test/built-ins/TypedArray/prototype/every/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/every/values-are-not-cached.js @@ -26,16 +26,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.every(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); return true; }); diff --git a/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js b/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js index 352a91d1a70c8f976815a5597083856ece1b3fd7..1fb4c00de9fb24665b6ddb9b8852f948b9a0e809 100644 --- a/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js +++ b/test/built-ins/TypedArray/prototype/fill/coerced-indexes.js @@ -31,74 +31,74 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( - compareArray(new TA([0, 0]).fill(1, undefined), [1, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), undefined), N([1, 1])), '`undefined` start coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, undefined), [1, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, undefined), N([1, 1])), 'If end is undefined, let relativeEnd be len' ); assert( - compareArray(new TA([0, 0]).fill(1, null), [1, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), null), N([1, 1])), '`null` start coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, null), [0, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, null), N([0, 0])), '`null` end coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, true), [0, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), true), N([0, 1])), '`true` start coerced to 1' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, true), [1, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, true), N([1, 0])), '`true` end coerced to 1' ); assert( - compareArray(new TA([0, 0]).fill(1, false), [1, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), false), N([1, 1])), '`false` start coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, false), [0, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, false), N([0, 0])), '`false` end coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, NaN), [1, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), NaN), N([1, 1])), '`NaN` start coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, NaN), [0, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, NaN), N([0, 0])), '`NaN` end coerced to 0' ); assert( - compareArray(new TA([0, 0]).fill(1, '1'), [0, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), '1'), N([0, 1])), 'string start coerced' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, '1'), [1, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, '1'), N([1, 0])), 'string end coerced' ); assert( - compareArray(new TA([0, 0]).fill(1, 1.5), [0, 1]), + compareArray(new TA(N([0, 0])).fill(N(1), 1.5), N([0, 1])), 'start as a float number coerced' ); assert( - compareArray(new TA([0, 0]).fill(1, 0, 1.5), [1, 0]), + compareArray(new TA(N([0, 0])).fill(N(1), 0, 1.5), N([1, 0])), 'end as a float number coerced' ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js b/test/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js index f5e1bd6b7e9de3451cbef8d994506f3331f8fa6e..4237c8061b0a575381ddab914be04388d2ef9b36 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-conversion-once.js @@ -14,14 +14,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); var n = 1; - sample.fill({ valueOf() { return n++; } }); + sample.fill({ valueOf() { return N(n++); } }); assert.sameValue(n, 2, "additional unexpected ToNumber() calls"); - assert.sameValue(sample[0], 1, "incorrect ToNumber result in index 0"); - assert.sameValue(sample[1], 1, "incorrect ToNumber result in index 1"); + assert.sameValue(sample[0], N(1), "incorrect ToNumber result in index 0"); + assert.sameValue(sample[1], N(1), "incorrect ToNumber result in index 1"); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js b/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js index 8db9082d484594fb68cdd1a8fe7b0f2b9d522e9c..836a0986fcc083c24750ca093d0f89b93af4474d 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-custom-start-and-end.js @@ -33,10 +33,10 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { - assert(compareArray(new TA([0, 0, 0]).fill(8, 1, 2), [0, 8, 0])); - assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -3, 4), [0, 0, 8, 8, 0])); - assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -2, -1), [0, 0, 0, 8, 0])); - assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, -1, -3), [0, 0, 0, 0, 0])); - assert(compareArray(new TA([0, 0, 0, 0, 0]).fill(8, 1, 3), [0, 8, 8, 0, 0])); +testWithTypedArrayConstructors(function(TA, N) { + assert(compareArray(new TA(N([0, 0, 0])).fill(N(8), 1, 2), N([0, 8, 0]))); + assert(compareArray(new TA(N([0, 0, 0, 0, 0])).fill(N(8), -3, 4), N([0, 0, 8, 8, 0]))); + assert(compareArray(new TA(N([0, 0, 0, 0, 0])).fill(N(8), -2, -1), N([0, 0, 0, 8, 0]))); + assert(compareArray(new TA(N([0, 0, 0, 0, 0])).fill(N(8), -1, -3), N([0, 0, 0, 0, 0]))); + assert(compareArray(new TA(N([0, 0, 0, 0, 0])).fill(N(8), 1, 3), N([0, 8, 8, 0, 0]))); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js b/test/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js index 1d8cd4b6a5ba6bbc8847f1d00afed1bac2c802ed..0b935fd4413e6b8465c60ff54bbac194a4e4afe5 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-non-numeric.js @@ -37,41 +37,43 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42]); - sample.fill(null); - assert.sameValue(sample[0], 0, "null => 0"); + if (numericTypedArrayConstructors.includes(TA)) { + sample = new TA(N([42])); + sample.fill(null); + assert.sameValue(sample[0], 0, "null => 0"); + } - sample = new TA([42]); + sample = new TA(N([42])); sample.fill(false); - assert.sameValue(sample[0], 0, "false => 0"); + assert.sameValue(sample[0], N(0), "false => 0"); - sample = new TA([42]); + sample = new TA(N([42])); sample.fill(true); - assert.sameValue(sample[0], 1, "true => 1"); + assert.sameValue(sample[0], N(1), "true => 1"); - sample = new TA([42]); + sample = new TA(N([42])); sample.fill("7"); - assert.sameValue(sample[0], 7, "string conversion"); + assert.sameValue(sample[0], N(7), "string conversion"); - sample = new TA([42]); + sample = new TA(N([42])); sample.fill({ toString: function() { - return 1; + return "1"; }, valueOf: function() { - return 7; + return N(7); } }); - assert.sameValue(sample[0], 7, "object valueOf conversion before toString"); + assert.sameValue(sample[0], N(7), "object valueOf conversion before toString"); - sample = new TA([42]); + sample = new TA(N([42])); sample.fill({ toString: function() { - return 7; + return "7"; } }); - assert.sameValue(sample[0], 7, "object toString when valueOf is absent"); + assert.sameValue(sample[0], N(7), "object toString when valueOf is absent"); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js index fe0b82d755240f6b1168367ee30aa0d69203b1a8..786169b34fd493d4596f29daab0196841bceb8da 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-end.js @@ -30,24 +30,24 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( - compareArray(new TA([0, 0, 0]).fill(8, 0, 1), [8, 0, 0]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 0, 1), N([8, 0, 0])), "Fill elements from custom end position" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, 0, -1), [8, 8, 0]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 0, -1), N([8, 8, 0])), "negative end sets final position to max((length + relativeEnd), 0)" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, 0, 5), [8, 8, 8]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 0, 5), N([8, 8, 8])), "end position is never higher than of length" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, 0, -4), [0, 0, 0]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 0, -4), N([0, 0, 0])), "end position is 0 when (len + relativeEnd) < 0" ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js index 68ca82f00374969aac8af461fc30de26b603e437..4a9f38799f2b42f9be8290a19d9a426285a43ba9 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values-relative-start.js @@ -28,24 +28,24 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( - compareArray(new TA([0, 0, 0]).fill(8, 1), [0, 8, 8]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 1), N([0, 8, 8])), "Fill elements from custom start position" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, 4), [0, 0, 0]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), 4), N([0, 0, 0])), "start position is never higher than length" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, -1), [0, 0, 8]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), -1), N([0, 0, 8])), "start < 0 sets initial position to max((len + relativeStart), 0)" ); assert( - compareArray(new TA([0, 0, 0]).fill(8, -5), [8, 8, 8]), + compareArray(new TA(N([0, 0, 0])).fill(N(8), -5), N([8, 8, 8])), "start position is 0 when (len + relativeStart) < 0" ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/fill-values.js b/test/built-ins/TypedArray/prototype/fill/fill-values.js index 70da31da6ad3fa759d925f84488f86bd2455d389..0f3ceddf5e98891373b88e5400f1af1bc132f61f 100644 --- a/test/built-ins/TypedArray/prototype/fill/fill-values.js +++ b/test/built-ins/TypedArray/prototype/fill/fill-values.js @@ -28,17 +28,17 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { assert( compareArray( - new TA().fill(8), + new TA().fill(N(8)), [] ), "does not fill an empty instance" ); assert( - compareArray(new TA([0, 0, 0]).fill(8), [8, 8, 8]), + compareArray(new TA(N([0, 0, 0])).fill(N(8)), N([8, 8, 8])), "Default start and end indexes are 0 and this.length" ); }); diff --git a/test/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js b/test/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js index d3d9723d257fc513484df2fbaa11e82b898dd48f..b0432cb2a08fd28a2548d68029903aba7438eca7 100644 --- a/test/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js +++ b/test/built-ins/TypedArray/prototype/fill/get-length-ignores-length-prop.js @@ -34,7 +34,7 @@ Object.defineProperty(TypedArray.prototype, "length", { } }); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { Object.defineProperty(TA.prototype, "length", { get: function() { throw new Test262Error(); @@ -48,5 +48,5 @@ testWithTypedArrayConstructors(function(TA) { } }); - assert.sameValue(sample.fill(1, 0), sample); + assert.sameValue(sample.fill(N(1), 0), sample); }); diff --git a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js index 7a90c2888fc2dcbcd4dde3d7f0dafdcd0029b7ff..f50c840d7a1605ebd3dda1a3883d40ae6edd6c51 100644 --- a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js +++ b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-end.js @@ -35,9 +35,9 @@ var end = { } }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(); assert.throws(Test262Error, function() { - sample.fill(1, 0, end); + sample.fill(N(1), 0, end); }); }); diff --git a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js index d57b5189c771afa83974b10bedda958efc5d65e5..207b67a7e9309666d06680cc1a0707dcb142647d 100644 --- a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js +++ b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-set-value.js @@ -37,8 +37,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); var obj = { valueOf: function() { throw new Test262Error(); diff --git a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js index 5e4ac67a141140205a33cc16db5521b3cb4ffd6d..6f3dc40700c6ffb74b3959e2ae5902a22f588034 100644 --- a/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js +++ b/test/built-ins/TypedArray/prototype/fill/return-abrupt-from-start.js @@ -34,9 +34,9 @@ var start = { } }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(); assert.throws(Test262Error, function() { - sample.fill(1, start); + sample.fill(N(1), start); }); }); diff --git a/test/built-ins/TypedArray/prototype/fill/return-this.js b/test/built-ins/TypedArray/prototype/fill/return-this.js index 38c91d71a2519e3b7a1eae5b288e7d37045c5657..b920053a5acd070af0b37f2f6c970f10bb0873f9 100644 --- a/test/built-ins/TypedArray/prototype/fill/return-this.js +++ b/test/built-ins/TypedArray/prototype/fill/return-this.js @@ -9,13 +9,13 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(); - var result1 = sample1.fill(1); + var result1 = sample1.fill(N(1)); assert.sameValue(result1, sample1); var sample2 = new TA(42); - var result2 = sample2.fill(7); + var result2 = sample2.fill(N(7)); assert.sameValue(result2, sample2); }); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js index ea90d12a05b1f0ef60fa47196924eaa2f4d7b168..d16a5e361e8cb667dee588c6485129fe1c5afde4 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-with-thisarg.js @@ -16,8 +16,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; @@ -30,17 +30,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js index 557107c93f540e34cd08eb240d62cdd86965ace9..95a30a38e62d6af8daa955bb7c60c444b4c11300 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-arguments-without-thisarg.js @@ -16,8 +16,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -28,17 +28,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js index 6a9c5d282a846ffa0a5bac9d877fa8a3c177ae8e..16691aac80e6fbf8c685c203fb53ea0d8bd2d790 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-no-iteration-over-non-integer.js @@ -16,8 +16,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -33,6 +33,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); - assert.sameValue(results[0][0], 7, "results[0][0] - kValue"); - assert.sameValue(results[1][0], 8, "results[1][0] - kValue"); + assert.sameValue(results[0][0], N(7), "results[0][0] - kValue"); + assert.sameValue(results[1][0], N(8), "results[1][0] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js index 7d3776296149ef1f6dc8457c0ab1633cb45aaa5a..6bf3f93afde1dfbc0ec4b1d6751c22f688b1b2c0 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-return-does-not-change-instance.js @@ -8,16 +8,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(3); - sample1[1] = 1; + sample1[1] = N(1); sample1.filter(function() { return 42; }); - assert.sameValue(sample1[0], 0, "[0] == 0"); - assert.sameValue(sample1[1], 1, "[1] == 1"); - assert.sameValue(sample1[2], 0, "[2] == 0"); + assert.sameValue(sample1[0], N(0), "[0] == 0"); + assert.sameValue(sample1[1], N(1), "[1] == 1"); + assert.sameValue(sample1[2], N(0), "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js index 97c4ae7d35cce3804a44279096a63d90da739925..5ef780ce180f0e9e0d5134435af2460c98f1cd49 100644 --- a/test/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js +++ b/test/built-ins/TypedArray/prototype/filter/callbackfn-set-value-during-iteration.js @@ -16,24 +16,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.filter(function(val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during interaction" ); @@ -41,7 +41,7 @@ testWithTypedArrayConstructors(function(TA) { newVal++; }); - assert.sameValue(sample[0], 7, "changed values after interaction [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after interaction [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after interaction [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after interaction [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after interaction [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after interaction [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js b/test/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js index bbd292d14fd1d985a91a72cd26ccae9daf5e9e16..1d68757d650c1579a8a9f4f4d55919c8db7153ea 100644 --- a/test/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js +++ b/test/built-ins/TypedArray/prototype/filter/result-does-not-share-buffer.js @@ -15,8 +15,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var result; result = sample.filter(function() { return true; }); diff --git a/test/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js b/test/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js index f46bf483daeb6532ab77580fc9ec6c62e31c6bc1..2999799891867fa4eb9ccb544bfa3550a3dfe61c 100644 --- a/test/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js +++ b/test/built-ins/TypedArray/prototype/filter/result-full-callbackfn-returns-true.js @@ -16,8 +16,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); [ true, diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js index 6f9099eaecc9143633abb260137dfc8b95b3a761..e4d5890504cee797285e1bf3db899e2000c1e864 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-abrupt.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); Object.defineProperty(sample, "constructor", { get: function() { diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js index 9db63a8eb16a98d76ef9ce1e5ea7daee7b2a2f96..f58f47211d48ae291b53faed691fde76db35da1f 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-inherited.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js index a63bd2e5336e4334c9ee586511f85a7a2fc16e15..9b574031c212baaaa684d2a59c9a170beed14777 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor-returns-throws.js @@ -30,8 +30,8 @@ features: [Symbol, TypedArray] var callbackfn = function() { return true; }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); sample.constructor = 42; assert.throws(TypeError, function() { diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js index 6308fe92ffd20a50594bec42d93242d785837025..23b11e3fd8b5da8316c774ee5392a5efc88788c2 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-ctor.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js index ad8313a26a3fce358579bf673d7afc52b8fd97af..3339c513a611fbdc93e60230866bd6a807ea761f 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-invocation.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 42, 42])); var result, ctorThis; sample.constructor = {}; @@ -47,7 +47,7 @@ testWithTypedArrayConstructors(function(TA) { return new TA(count); }; - sample.filter(function(v) { return v === 42; }); + sample.filter(function(v) { return v === N(42); }); assert.sameValue(result.length, 1, "called with 1 argument"); assert.sameValue(result[0], 2, "[0] is the new captured length"); diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js index 79547878b127f7ab733897d5bf69286be074d146..5181cf3c7aedb105eed327da722b266d5b27e72d 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40])); var otherTA = TA === Int8Array ? Int16Array : Int8Array; var other = new otherTA([1, 0, 1]); var result; diff --git a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js index 28e12b135223f5faac757401e03fff3dfcc62d00..309f646a38e91e85e506f65806f1d41ffebca618 100644 --- a/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js +++ b/test/built-ins/TypedArray/prototype/filter/speciesctor-get-species-custom-ctor.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var calls = 0; var other, result; @@ -52,5 +52,5 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(calls, 1, "ctor called once"); assert.sameValue(result, other, "return is instance of custom constructor"); - assert(compareArray(result, [40, 41, 42]), "values are set on the new obj"); + assert(compareArray(result, N([40, 41, 42])), "values are set on the new obj"); }); diff --git a/test/built-ins/TypedArray/prototype/filter/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/filter/values-are-not-cached.js index 1b24d310e53a220aab2e50263a2458e311a49580..47c0d465fe66cfb98d88a1c3b374fae0532d388c 100644 --- a/test/built-ins/TypedArray/prototype/filter/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/filter/values-are-not-cached.js @@ -16,16 +16,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.filter(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); }); }); diff --git a/test/built-ins/TypedArray/prototype/filter/values-are-set.js b/test/built-ins/TypedArray/prototype/filter/values-are-set.js index c9f16b8df1d6f544b945016be6bd058262234eca..2a033c7018678db98a9b6c12422820cdeab517d8 100644 --- a/test/built-ins/TypedArray/prototype/filter/values-are-set.js +++ b/test/built-ins/TypedArray/prototype/filter/values-are-set.js @@ -16,15 +16,15 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([41, 1, 42, 7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([41, 1, 42, 7])); var result; result = sample.filter(function() { return true; }); - assert(compareArray(result, [41, 1, 42, 7]), "values are set #1"); + assert(compareArray(result, N([41, 1, 42, 7])), "values are set #1"); result = sample.filter(function(v) { - return v > 40; + return v > N(40); }); - assert(compareArray(result, [41, 42]), "values are set #2"); + assert(compareArray(result, N([41, 42])), "values are set #2"); }); diff --git a/test/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js b/test/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js index b62f9170fab4edc4a53a60064568667eedaae313..754c2d3070ecbf4b9df2b49aca76a20bdbb9fff0 100644 --- a/test/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js +++ b/test/built-ins/TypedArray/prototype/find/get-length-ignores-length-prop.js @@ -32,14 +32,14 @@ Object.defineProperty(TypedArray.prototype, "length", { } }); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { Object.defineProperty(TA.prototype, "length", { get: function() { throw new Test262Error(); } }); - var sample = new TA([42]); + var sample = new TA(N([42])); Object.defineProperty(sample, "length", { get: function() { @@ -50,6 +50,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue( sample.find(function() { return true; }), - 42 + N(42) ); }); diff --git a/test/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js index 556fb9851c58d5767150717945ed46a1cdb31129..b036a7c92cb352e7ce13ec04ab5975595eef04c9 100644 --- a/test/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/find/predicate-call-changes-value.js @@ -29,8 +29,8 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { - var arr = [1, 2, 3]; +testWithTypedArrayConstructors(function(TA, N) { + var arr = N([1, 2, 3]); var sample; var result; @@ -38,41 +38,41 @@ testWithTypedArrayConstructors(function(TA) { sample.find(function(val, i) { sample[i] = arr[i]; - assert.sameValue(val, 0, "value is not mapped to instance"); + assert.sameValue(val, N(0), "value is not mapped to instance"); }); assert(compareArray(sample, arr), "values set during each predicate call"); sample = new TA(arr); result = sample.find(function(val, i) { if ( i === 0 ) { - sample[2] = 7; + sample[2] = N(7); } - return val === 7; + return val === N(7); }); - assert.sameValue(result, 7, "value found"); + assert.sameValue(result, N(7), "value found"); sample = new TA(arr); result = sample.find(function(val, i) { if ( i === 0 ) { - sample[2] = 7; + sample[2] = N(7); } - return val === 3; + return val === N(3); }); assert.sameValue(result, undefined, "value not found"); sample = new TA(arr); result = sample.find(function(val, i) { if ( i > 0 ) { - sample[0] = 7; + sample[0] = N(7); } - return val === 7; + return val === N(7); }); assert.sameValue(result, undefined, "value not found - changed after call"); sample = new TA(arr); result = sample.find(function() { - sample[0] = 7; + sample[0] = N(7); return true; }); - assert.sameValue(result, 1, "find() returns previous found value"); + assert.sameValue(result, N(1), "find() returns previous found value"); }); diff --git a/test/built-ins/TypedArray/prototype/find/predicate-call-parameters.js b/test/built-ins/TypedArray/prototype/find/predicate-call-parameters.js index 02c20a2c95c2ebf6dc39f0ca01e7280311cc3895..e31cb95221911f2b2e0b546cf1d29a3063c3a7b9 100644 --- a/test/built-ins/TypedArray/prototype/find/predicate-call-parameters.js +++ b/test/built-ins/TypedArray/prototype/find/predicate-call-parameters.js @@ -30,8 +30,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([39, 2, 62]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([39, 2, 62])); var results = []; var result; @@ -44,19 +44,19 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "predicate is called for each index"); result = results[0]; - assert.sameValue(result[0], 39, "results[0][0] === 39, value"); + assert.sameValue(result[0], N(39), "results[0][0] === 39, value"); assert.sameValue(result[1], 0, "results[0][1] === 0, index"); assert.sameValue(result[2], sample, "results[0][2] === sample, instance"); assert.sameValue(result.length, 3, "results[0].length === 3 arguments"); result = results[1]; - assert.sameValue(result[0], 2, "results[1][0] === 2, value"); + assert.sameValue(result[0], N(2), "results[1][0] === 2, value"); assert.sameValue(result[1], 1, "results[1][1] === 1, index"); assert.sameValue(result[2], sample, "results[1][2] === sample, instance"); assert.sameValue(result.length, 3, "results[1].length === 3 arguments"); result = results[2]; - assert.sameValue(result[0], 62, "results[2][0] === 62, value"); + assert.sameValue(result[0], N(62), "results[2][0] === 62, value"); assert.sameValue(result[1], 2, "results[2][1] === 2, index"); assert.sameValue(result[2], sample, "results[2][2] === sample, instance"); assert.sameValue(result.length, 3, "results[2].length === 3 arguments"); diff --git a/test/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js b/test/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js index a2d0302c618f532876d6806e3bdb389f98fdb743..716b1638b50fd05eee69b56ef4e1bf205a6f6a39 100644 --- a/test/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js +++ b/test/built-ins/TypedArray/prototype/find/return-found-value-predicate-result-is-true.js @@ -29,8 +29,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([39, 2, 62]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([39, 2, 62])); var called, result; called = 0; @@ -38,29 +38,29 @@ testWithTypedArrayConstructors(function(TA) { called++; return true; }); - assert.sameValue(result, 39, "returned true on sample[0]"); + assert.sameValue(result, N(39), "returned true on sample[0]"); assert.sameValue(called, 1, "predicate was called once"); called = 0; result = sample.find(function(val) { called++; - return val === 62; + return val === N(62); }); assert.sameValue(called, 3, "predicate was called three times"); - assert.sameValue(result, 62, "returned true on sample[3]"); + assert.sameValue(result, N(62), "returned true on sample[3]"); result = sample.find(function() { return "string"; }); - assert.sameValue(result, 39, "ToBoolean(string)"); + assert.sameValue(result, N(39), "ToBoolean(string)"); result = sample.find(function() { return {}; }); - assert.sameValue(result, 39, "ToBoolean(object)"); + assert.sameValue(result, N(39), "ToBoolean(object)"); result = sample.find(function() { return Symbol(""); }); - assert.sameValue(result, 39, "ToBoolean(symbol)"); + assert.sameValue(result, N(39), "ToBoolean(symbol)"); result = sample.find(function() { return 1; }); - assert.sameValue(result, 39, "ToBoolean(number)"); + assert.sameValue(result, N(39), "ToBoolean(number)"); result = sample.find(function() { return -1; }); - assert.sameValue(result, 39, "ToBoolean(negative number)"); + assert.sameValue(result, N(39), "ToBoolean(negative number)"); }); diff --git a/test/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js b/test/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js index 99566c3d56fbee2e949c67cefa3e0fcd6e9042e7..697f3ef430f1afb65ddde6587bae0ea5ad3c3ffe 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js +++ b/test/built-ins/TypedArray/prototype/findIndex/get-length-ignores-length-prop.js @@ -30,14 +30,14 @@ Object.defineProperty(TypedArray.prototype, "length", { } }); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { Object.defineProperty(TA.prototype, "length", { get: function() { throw new Test262Error(); } }); - var sample = new TA([42]); + var sample = new TA(N([42])); Object.defineProperty(sample, "length", { get: function() { diff --git a/test/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js b/test/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js index 84efabc2649bf0ed36c590f7b97a6b8b999c9846..e2a0fab02b2a3e5a8da87b95d505fc1ad0504189 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js +++ b/test/built-ins/TypedArray/prototype/findIndex/predicate-call-changes-value.js @@ -25,8 +25,8 @@ info: | includes: [compareArray.js, testTypedArray.js] ---*/ -testWithTypedArrayConstructors(function(TA) { - var arr = [10, 20, 30]; +testWithTypedArrayConstructors(function(TA, N) { + var arr = N([10, 20, 30]); var sample; var result; @@ -34,34 +34,34 @@ testWithTypedArrayConstructors(function(TA) { sample.findIndex(function(val, i) { sample[i] = arr[i]; - assert.sameValue(val, 0, "value is not mapped to instance"); + assert.sameValue(val, N(0), "value is not mapped to instance"); }); assert(compareArray(sample, arr), "values set during each predicate call"); sample = new TA(arr); result = sample.findIndex(function(val, i) { if ( i === 0 ) { - sample[2] = 7; + sample[2] = N(7); } - return val === 7; + return val === N(7); }); assert.sameValue(result, 2, "value found"); sample = new TA(arr); result = sample.findIndex(function(val, i) { if ( i === 0 ) { - sample[2] = 7; + sample[2] = N(7); } - return val === 30; + return val === N(30); }); assert.sameValue(result, -1, "value not found"); sample = new TA(arr); result = sample.findIndex(function(val, i) { if ( i > 0 ) { - sample[0] = 7; + sample[0] = N(7); } - return val === 7; + return val === N(7); }); assert.sameValue(result, -1, "value not found - changed after call"); -}); \ No newline at end of file +}); diff --git a/test/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js b/test/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js index a4102dcb3a331119010bf07bf60049bb3becbbf5..c19ccd1d925025a82ca8b41fd62951a73fa18f8e 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js +++ b/test/built-ins/TypedArray/prototype/findIndex/predicate-call-parameters.js @@ -28,8 +28,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([39, 2, 62]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([39, 2, 62])); var results = []; var result; @@ -42,19 +42,19 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "predicate is called for each index"); result = results[0]; - assert.sameValue(result[0], 39, "results[0][0] === 39, value"); + assert.sameValue(result[0], N(39), "results[0][0] === 39, value"); assert.sameValue(result[1], 0, "results[0][1] === 0, index"); assert.sameValue(result[2], sample, "results[0][2] === sample, instance"); assert.sameValue(result.length, 3, "results[0].length === 3, arguments"); result = results[1]; - assert.sameValue(result[0], 2, "results[1][0] === 2, value"); + assert.sameValue(result[0], N(2), "results[1][0] === 2, value"); assert.sameValue(result[1], 1, "results[1][1] === 1, index"); assert.sameValue(result[2], sample, "results[1][2] === sample, instance"); assert.sameValue(result.length, 3, "results[1].length === 3, arguments"); result = results[2]; - assert.sameValue(result[0], 62, "results[2][0] === 62, value"); + assert.sameValue(result[0], N(62), "results[2][0] === 62, value"); assert.sameValue(result[1], 2, "results[2][1] === 2, index"); assert.sameValue(result[2], sample, "results[2][2] === sample, instance"); assert.sameValue(result.length, 3, "results[2].length === 3, arguments"); diff --git a/test/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js b/test/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js index 9e4880f22521ecdd0557856c2a6dc683237d7681..1e56448ca9cb73398e26feefb5b3238d9a74de14 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js +++ b/test/built-ins/TypedArray/prototype/findIndex/return-index-predicate-result-is-true.js @@ -28,8 +28,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([39, 3, 9]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([39, 3, 9])); var called = 0; var result = sample.findIndex(function() { @@ -43,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { called = 0; result = sample.findIndex(function(val) { called++; - return val === 9; + return val === N(9); }); assert.sameValue(called, 3, "predicate was called three times"); diff --git a/test/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js b/test/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js index f3367fbfafc4551d3e8485b6c4781e5b8947e07d..7a8b9d9e501a2a44724f0676d8bb5f539ce1473c 100644 --- a/test/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js +++ b/test/built-ins/TypedArray/prototype/findIndex/return-negative-one-if-predicate-returns-false-value.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); var called = 0; var result = sample.findIndex(function() { diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js index 13ae208be2a5a35348229214a366a3f102ec3412..15a960ab9efd6f3bf67a1d2656ac01a838d71a1f 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-with-thisarg.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; @@ -39,17 +39,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js index 1255dbf2b91050cfab17b9b0fcf4737879e432f3..454df6941928f3b66921bbc60eb0cc05bffdef58 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-arguments-without-thisarg.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -37,17 +37,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js index 4056d65f487e99ef677d8d87a75b01ad3004055b..a36a8824b72147600195f7c9bcd4df3a60a09f65 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-no-interaction-over-non-integer.js @@ -19,8 +19,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -36,6 +36,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); - assert.sameValue(results[0][0], 7, "results[0][0] - kValue"); - assert.sameValue(results[1][0], 8, "results[1][0] - kValue"); + assert.sameValue(results[0][0], N(7), "results[0][0] - kValue"); + assert.sameValue(results[1][0], N(8), "results[1][0] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js index 19584f112352d384188c18aa221efc01cd263418..b2c7f3ff57a92045d92f873bd1b9851921b50868 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-return-does-not-change-instance.js @@ -15,16 +15,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(3); - sample1[1] = 1; + sample1[1] = N(1); sample1.forEach(function() { return 42; }); - assert.sameValue(sample1[0], 0, "[0] == 0"); - assert.sameValue(sample1[1], 1, "[1] == 1"); - assert.sameValue(sample1[2], 0, "[2] == 0"); + assert.sameValue(sample1[0], N(0), "[0] == 0"); + assert.sameValue(sample1[1], N(1), "[1] == 1"); + assert.sameValue(sample1[2], N(0), "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js index 8cae0a4c58da056e0cb808821e88da27e81e0550..4c5a73bbffc1c5028671b6cdce0ca651e23e4f38 100644 --- a/test/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js +++ b/test/built-ins/TypedArray/prototype/forEach/callbackfn-set-value-during-interaction.js @@ -16,24 +16,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.forEach(function(val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); @@ -41,7 +41,7 @@ testWithTypedArrayConstructors(function(TA) { newVal++; }); - assert.sameValue(sample[0], 7, "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js index 10b31135622f4580e9505af1d4d06f1d537afc61..7a965668d21b6cdd8dbcd699e32f989716c6c000 100644 --- a/test/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/forEach/values-are-not-cached.js @@ -16,16 +16,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.forEach(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js b/test/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js index b9af6be50587dd8775284a01083c79de0e9799fb..f904d82a505a7a92d1a4dce91e6f85bc9b925340 100644 --- a/test/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js +++ b/test/built-ins/TypedArray/prototype/includes/fromIndex-infinity.js @@ -29,16 +29,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 43, 41]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 43, 41])); assert.sameValue( - sample.includes(43, Infinity), + sample.includes(N(43), Infinity), false, "includes(43, Infinity)" ); assert.sameValue( - sample.includes(43, -Infinity), + sample.includes(N(43), -Infinity), true, "includes(43, -Infinity)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js b/test/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js index be2fedf7c2933213ff8cd1f454855e694a2c6952..3d4c08fb793a30fa4105bb7e29ccb125853625f9 100644 --- a/test/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js +++ b/test/built-ins/TypedArray/prototype/includes/fromIndex-minus-zero.js @@ -24,11 +24,11 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.includes(42, -0), true, "-0 [0]"); - assert.sameValue(sample.includes(43, -0), true, "-0 [1]"); - assert.sameValue(sample.includes(44, -0), false, "-0 [2]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.includes(N(42), -0), true, "-0 [0]"); + assert.sameValue(sample.includes(N(43), -0), true, "-0 [1]"); + assert.sameValue(sample.includes(N(44), -0), false, "-0 [2]"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js index eb10a80bd07fcb102739bceb241d864f145ee976..c8b6b62801afc93bc12a9fb50617d845a2a13909 100644 --- a/test/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/includes/get-length-uses-internal-arraylength.js @@ -23,11 +23,11 @@ features: [TypedArray] Object.defineProperty(TypedArray.prototype, "length", {value: 0}); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7])); Object.defineProperty(TA.prototype, "length", {value: 0}); Object.defineProperty(sample, "length", {value: 0}); - assert.sameValue(sample.includes(7), true); + assert.sameValue(sample.includes(N(7)), true); }); diff --git a/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js b/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js index 5e5364d5bdbb6c0ce1878bf38fc96b8285ae8268..cc4207aa3472c901e0afea8c992aa8eec106d2fe 100644 --- a/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js +++ b/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex-symbol.js @@ -24,10 +24,10 @@ features: [Symbol, TypedArray] var fromIndex = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7])); assert.throws(TypeError, function() { - sample.includes(7, fromIndex); + sample.includes(N(7), fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js index b17b6e3432847b146cc2180adc21024768df45b3..40a1f6dbc71741b6e8e58fe9f96588481e516655 100644 --- a/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/includes/return-abrupt-tointeger-fromindex.js @@ -28,10 +28,10 @@ var fromIndex = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7])); assert.throws(Test262Error, function() { - sample.includes(7, fromIndex); + sample.includes(N(7), fromIndex); }); }); diff --git a/test/built-ins/TypedArray/prototype/includes/samevaluezero.js b/test/built-ins/TypedArray/prototype/includes/samevaluezero.js index c6ad3785becb8a2fb7a9d8e54a428b38cbfc1a8f..c06e20b1a5b96138259a61335853a861cca3c859 100644 --- a/test/built-ins/TypedArray/prototype/includes/samevaluezero.js +++ b/test/built-ins/TypedArray/prototype/includes/samevaluezero.js @@ -36,7 +36,9 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(sample.includes(false), false, "false"); assert.sameValue(sample.includes(null), false, "null"); assert.sameValue(sample.includes(""), false, "empty string"); -}); +}, + // ToBigInt(undefined) throws a TypeError exception. + numericTypedArrayConstructors); testWithTypedArrayConstructors(function(FloatArray) { var sample = new FloatArray([42, 0, 1, undefined, NaN]); diff --git a/test/built-ins/TypedArray/prototype/includes/search-found-returns-true.js b/test/built-ins/TypedArray/prototype/includes/search-found-returns-true.js index e77ace2609b66eedbb399d7613933cc13f9488f1..27c6e25f0d1366eaa9c801b3f4366c76969b85b5 100644 --- a/test/built-ins/TypedArray/prototype/includes/search-found-returns-true.js +++ b/test/built-ins/TypedArray/prototype/includes/search-found-returns-true.js @@ -29,16 +29,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.includes(42), true, "includes(42)"); - assert.sameValue(sample.includes(43), true, "includes(43)"); - assert.sameValue(sample.includes(43, 1), true, "includes(43, 1)"); - assert.sameValue(sample.includes(42, 1), true, "includes(42, 1)"); - assert.sameValue(sample.includes(42, 2), true, "includes(42, 2)"); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.includes(N(42)), true, "includes(42)"); + assert.sameValue(sample.includes(N(43)), true, "includes(43)"); + assert.sameValue(sample.includes(N(43), 1), true, "includes(43, 1)"); + assert.sameValue(sample.includes(N(42), 1), true, "includes(42, 1)"); + assert.sameValue(sample.includes(N(42), 2), true, "includes(42, 2)"); - assert.sameValue(sample.includes(42, -4), true, "includes(42, -4)"); - assert.sameValue(sample.includes(42, -3), true, "includes(42, -3)"); - assert.sameValue(sample.includes(42, -2), true, "includes(42, -2)"); - assert.sameValue(sample.includes(42, -5), true, "includes(42, -5)"); + assert.sameValue(sample.includes(N(42), -4), true, "includes(42, -4)"); + assert.sameValue(sample.includes(N(42), -3), true, "includes(42, -3)"); + assert.sameValue(sample.includes(N(42), -2), true, "includes(42, -2)"); + assert.sameValue(sample.includes(N(42), -5), true, "includes(42, -5)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js b/test/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js index 4000cd39b6c97d783e8f025797184e4b2a5ff587..8654b4d36fcba5d38235a57aa96e674a71472c15 100644 --- a/test/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js +++ b/test/built-ins/TypedArray/prototype/includes/search-not-found-returns-false.js @@ -29,14 +29,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.includes(44), false, "includes(44)"); - assert.sameValue(sample.includes(43, 2), false, "includes(43, 2)"); - assert.sameValue(sample.includes(42, 3), false, "includes(42, 3)"); - assert.sameValue(sample.includes(44, -4), false, "includes(44, -4)"); - assert.sameValue(sample.includes(44, -5), false, "includes(44, -5)"); - assert.sameValue(sample.includes(42, -1), false, "includes(42, -1)"); + sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.includes(N(44)), false, "includes(44)"); + assert.sameValue(sample.includes(N(43), 2), false, "includes(43, 2)"); + assert.sameValue(sample.includes(N(42), 3), false, "includes(42, 3)"); + assert.sameValue(sample.includes(N(44), -4), false, "includes(44, -4)"); + assert.sameValue(sample.includes(N(44), -5), false, "includes(44, -5)"); + assert.sameValue(sample.includes(N(42), -1), false, "includes(42, -1)"); }); diff --git a/test/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js index 9a2be979f342e2248c1a668347c023cd8bc7483f..9ab7c404a9e9993f7aef7f07a0d28484088f2afc 100644 --- a/test/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/includes/tointeger-fromindex.js @@ -35,31 +35,31 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.includes(42, "1"), false, "string [0]"); - assert.sameValue(sample.includes(43, "1"), true, "string [1]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.includes(N(42), "1"), false, "string [0]"); + assert.sameValue(sample.includes(N(43), "1"), true, "string [1]"); - assert.sameValue(sample.includes(42, true), false, "true [0]"); - assert.sameValue(sample.includes(43, true), true, "true [1]"); + assert.sameValue(sample.includes(N(42), true), false, "true [0]"); + assert.sameValue(sample.includes(N(43), true), true, "true [1]"); - assert.sameValue(sample.includes(42, false), true, "false [0]"); - assert.sameValue(sample.includes(43, false), true, "false [1]"); + assert.sameValue(sample.includes(N(42), false), true, "false [0]"); + assert.sameValue(sample.includes(N(43), false), true, "false [1]"); - assert.sameValue(sample.includes(42, NaN), true, "NaN [0]"); - assert.sameValue(sample.includes(43, NaN), true, "NaN [1]"); + assert.sameValue(sample.includes(N(42), NaN), true, "NaN [0]"); + assert.sameValue(sample.includes(N(43), NaN), true, "NaN [1]"); - assert.sameValue(sample.includes(42, null), true, "null [0]"); - assert.sameValue(sample.includes(43, null), true, "null [1]"); + assert.sameValue(sample.includes(N(42), null), true, "null [0]"); + assert.sameValue(sample.includes(N(43), null), true, "null [1]"); - assert.sameValue(sample.includes(42, undefined), true, "undefined [0]"); - assert.sameValue(sample.includes(43, undefined), true, "undefined [1]"); + assert.sameValue(sample.includes(N(42), undefined), true, "undefined [0]"); + assert.sameValue(sample.includes(N(43), undefined), true, "undefined [1]"); - assert.sameValue(sample.includes(42, null), true, "null [0]"); - assert.sameValue(sample.includes(43, null), true, "null [1]"); + assert.sameValue(sample.includes(N(42), null), true, "null [0]"); + assert.sameValue(sample.includes(N(43), null), true, "null [1]"); - assert.sameValue(sample.includes(42, obj), false, "object [0]"); - assert.sameValue(sample.includes(43, obj), true, "object [1]"); + assert.sameValue(sample.includes(N(42), obj), false, "object [0]"); + assert.sameValue(sample.includes(N(43), obj), true, "object [1]"); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js b/test/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js index a048138c0e678665a3327f101cbc71a5e670ce6d..e4a61ec962282ff6a9fadbd6dc08bf843e61cac8 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js +++ b/test/built-ins/TypedArray/prototype/indexOf/fromIndex-infinity.js @@ -31,9 +31,9 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 43, 41]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 43, 41])); - assert.sameValue(sample.indexOf(43, Infinity), -1, "indexOf(43, Infinity)"); - assert.sameValue(sample.indexOf(43, -Infinity), 1, "indexOf(43, -Infinity)"); + assert.sameValue(sample.indexOf(N(43), Infinity), -1, "indexOf(43, Infinity)"); + assert.sameValue(sample.indexOf(N(43), -Infinity), 1, "indexOf(43, -Infinity)"); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js b/test/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js index 3e4dfae8f9591800d36f78c7098a0865ea97237f..46fbb0550dd6867dfee3f10f8aad375f3e445040 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js +++ b/test/built-ins/TypedArray/prototype/indexOf/fromIndex-minus-zero.js @@ -21,10 +21,10 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.indexOf(42, -0), 0, "-0 [0]"); - assert.sameValue(sample.indexOf(43, -0), 1, "-0 [1]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.indexOf(N(42), -0), 0, "-0 [0]"); + assert.sameValue(sample.indexOf(N(43), -0), 1, "-0 [1]"); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js index 2703a0519b6c31b808d97c1486d133c819e4f01b..fb3d62349894dac21ebd3b889b95f46fb7cf0d22 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/indexOf/get-length-uses-internal-arraylength.js @@ -22,11 +22,11 @@ features: [TypedArray] Object.defineProperty(TypedArray.prototype, "length", {value: 0}); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7])); Object.defineProperty(TA.prototype, "length", {value: 0}); Object.defineProperty(sample, "length", {value: 0}); - assert.sameValue(sample.indexOf(7), 0); + assert.sameValue(sample.indexOf(N(7)), 0); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js b/test/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js index 48500c1a85b32d5987ee007b3262d8579f4d74ae..4a75a3a0a960e15680a22a2418baa0adba046ef7 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js +++ b/test/built-ins/TypedArray/prototype/indexOf/search-found-returns-index.js @@ -31,16 +31,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.indexOf(42), 0, "indexOf(42)"); - assert.sameValue(sample.indexOf(43), 1, "indexOf(43)"); - assert.sameValue(sample.indexOf(43, 1), 1, "indexOf(43, 1)"); - assert.sameValue(sample.indexOf(42, 1), 2, "indexOf(42, 1)"); - assert.sameValue(sample.indexOf(42, 2), 2, "indexOf(42, 2)"); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.indexOf(N(42)), 0, "indexOf(42)"); + assert.sameValue(sample.indexOf(N(43)), 1, "indexOf(43)"); + assert.sameValue(sample.indexOf(N(43), 1), 1, "indexOf(43, 1)"); + assert.sameValue(sample.indexOf(N(42), 1), 2, "indexOf(42, 1)"); + assert.sameValue(sample.indexOf(N(42), 2), 2, "indexOf(42, 2)"); - assert.sameValue(sample.indexOf(42, -4), 0, "indexOf(42, -4)"); - assert.sameValue(sample.indexOf(42, -3), 2, "indexOf(42, -3)"); - assert.sameValue(sample.indexOf(42, -2), 2, "indexOf(42, -2)"); - assert.sameValue(sample.indexOf(42, -5), 0, "indexOf(42, -5)"); + assert.sameValue(sample.indexOf(N(42), -4), 0, "indexOf(42, -4)"); + assert.sameValue(sample.indexOf(N(42), -3), 2, "indexOf(42, -3)"); + assert.sameValue(sample.indexOf(N(42), -2), 2, "indexOf(42, -2)"); + assert.sameValue(sample.indexOf(N(42), -5), 0, "indexOf(42, -5)"); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js b/test/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js index ee8f513dc8671bfc0e6e669352ed33398e9479f4..8c0917920ffe4bda0353ee50ef5278971aa92fcb 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/indexOf/search-not-found-returns-minus-one.js @@ -25,14 +25,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.indexOf(44), -1, "indexOf(44)"); - assert.sameValue(sample.indexOf(43, 2), -1, "indexOf(43, 2)"); - assert.sameValue(sample.indexOf(42, 3), -1, "indexOf(42, 3)"); - assert.sameValue(sample.indexOf(44, -4), -1, "indexOf(44, -4)"); - assert.sameValue(sample.indexOf(44, -5), -1, "indexOf(44, -5)"); - assert.sameValue(sample.indexOf(42, -1), -1, "indexOf(42, -1)"); + sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.indexOf(N(44)), -1, "indexOf(44)"); + assert.sameValue(sample.indexOf(N(43), 2), -1, "indexOf(43, 2)"); + assert.sameValue(sample.indexOf(N(42), 3), -1, "indexOf(42, 3)"); + assert.sameValue(sample.indexOf(N(44), -4), -1, "indexOf(44, -4)"); + assert.sameValue(sample.indexOf(N(44), -5), -1, "indexOf(44, -5)"); + assert.sameValue(sample.indexOf(N(42), -1), -1, "indexOf(42, -1)"); }); diff --git a/test/built-ins/TypedArray/prototype/indexOf/strict-comparison.js b/test/built-ins/TypedArray/prototype/indexOf/strict-comparison.js index 5a7883f9703ffee4735621fb22ce34b66c9db3aa..ddd3540f8fdc1979718e4361ec50333393c58d06 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/strict-comparison.js +++ b/test/built-ins/TypedArray/prototype/indexOf/strict-comparison.js @@ -38,4 +38,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(sample.indexOf(null), -1, "null"); assert.sameValue(sample.indexOf(undefined), -1, "undefined"); assert.sameValue(sample.indexOf(""), -1, "empty string"); -}); +}, + // Cannot create Big*64Arrays from non-safe integers. + numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js index f733d249cec42bb5fcf10cd4ffe26144bcba873d..2672ddb128367341f9d5fd176f538e49462944a9 100644 --- a/test/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/indexOf/tointeger-fromindex.js @@ -27,31 +27,31 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.indexOf(42, "1"), -1, "string [0]"); - assert.sameValue(sample.indexOf(43, "1"), 1, "string [1]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.indexOf(N(42), "1"), -1, "string [0]"); + assert.sameValue(sample.indexOf(N(43), "1"), 1, "string [1]"); - assert.sameValue(sample.indexOf(42, true), -1, "true [0]"); - assert.sameValue(sample.indexOf(43, true), 1, "true [1]"); + assert.sameValue(sample.indexOf(N(42), true), -1, "true [0]"); + assert.sameValue(sample.indexOf(N(43), true), 1, "true [1]"); - assert.sameValue(sample.indexOf(42, false), 0, "false [0]"); - assert.sameValue(sample.indexOf(43, false), 1, "false [1]"); + assert.sameValue(sample.indexOf(N(42), false), 0, "false [0]"); + assert.sameValue(sample.indexOf(N(43), false), 1, "false [1]"); - assert.sameValue(sample.indexOf(42, NaN), 0, "NaN [0]"); - assert.sameValue(sample.indexOf(43, NaN), 1, "NaN [1]"); + assert.sameValue(sample.indexOf(N(42), NaN), 0, "NaN [0]"); + assert.sameValue(sample.indexOf(N(43), NaN), 1, "NaN [1]"); - assert.sameValue(sample.indexOf(42, null), 0, "null [0]"); - assert.sameValue(sample.indexOf(43, null), 1, "null [1]"); + assert.sameValue(sample.indexOf(N(42), null), 0, "null [0]"); + assert.sameValue(sample.indexOf(N(43), null), 1, "null [1]"); - assert.sameValue(sample.indexOf(42, undefined), 0, "undefined [0]"); - assert.sameValue(sample.indexOf(43, undefined), 1, "undefined [1]"); + assert.sameValue(sample.indexOf(N(42), undefined), 0, "undefined [0]"); + assert.sameValue(sample.indexOf(N(43), undefined), 1, "undefined [1]"); - assert.sameValue(sample.indexOf(42, null), 0, "null [0]"); - assert.sameValue(sample.indexOf(43, null), 1, "null [1]"); + assert.sameValue(sample.indexOf(N(42), null), 0, "null [0]"); + assert.sameValue(sample.indexOf(N(43), null), 1, "null [1]"); - assert.sameValue(sample.indexOf(42, obj), -1, "object [0]"); - assert.sameValue(sample.indexOf(43, obj), 1, "object [1]"); + assert.sameValue(sample.indexOf(N(42), obj), -1, "object [0]"); + assert.sameValue(sample.indexOf(N(43), obj), 1, "object [1]"); }); diff --git a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js index 694f81db088e034d6f0ee49223fa06f4a64a3600..13cb0624a98884f68a737b0b02c7030f39a44a01 100644 --- a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js +++ b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-simple-value.js @@ -29,8 +29,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 0, 2, 3, 42, 127]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 0, 2, 3, 42, 127])); var result; diff --git a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js index 94caedf65a437ce780138be251f0becdfd75a29f..d135c173fe6ee1035e49e584552edd301852da0d 100644 --- a/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js +++ b/test/built-ins/TypedArray/prototype/join/custom-separator-result-from-tostring-on-each-value.js @@ -132,4 +132,6 @@ testWithTypedArrayConstructors(function(TA) { }).join(separator); result = sample.join(separator); assert.sameValue(result, expected, "using: " + separator); -}); +}, + // Cannot create Big*64Arrays from non-safe integers. + numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js index 5588297048c2f979e39c9e41bc8478902ab6d080..a98f8b84e97f8f836a398a5fb596b13bb1cedd01 100644 --- a/test/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/join/get-length-uses-internal-arraylength.js @@ -32,8 +32,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js index b6d91a0350e43fcc483e034ab1c2f9ac5a6ec424..dd6f9810328259ebedde2907d091f88f6af86117 100644 --- a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js +++ b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-simple-value.js @@ -28,8 +28,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 0, 2, 3, 42, 127]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 0, 2, 3, 42, 127])); var result = sample.join(); diff --git a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js index d3d699ffa08899b67f6c7971977551827c99644b..df27d079cfe5d80e49851aecc62cffa57c2fbd77 100644 --- a/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js +++ b/test/built-ins/TypedArray/prototype/join/result-from-tostring-on-each-value.js @@ -41,4 +41,6 @@ testWithTypedArrayConstructors(function(TA) { var result = sample.join(); assert.sameValue(result, expected); -}); +}, + // Cannot construct Big*64Arrays from non-safe integers. + numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArray/prototype/keys/iter-prototype.js b/test/built-ins/TypedArray/prototype/keys/iter-prototype.js index fd5509ac6240058553c937d61a80459e7c0345d7..a01464f547fc526fd4b2e724d34b12e98f9c5e10 100644 --- a/test/built-ins/TypedArray/prototype/keys/iter-prototype.js +++ b/test/built-ins/TypedArray/prototype/keys/iter-prototype.js @@ -17,8 +17,8 @@ features: [Symbol.iterator, TypedArray] var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]()); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 42, 64]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 42, 64])); var iter = sample.keys(); assert.sameValue(Object.getPrototypeOf(iter), ArrayIteratorProto); diff --git a/test/built-ins/TypedArray/prototype/keys/return-itor.js b/test/built-ins/TypedArray/prototype/keys/return-itor.js index 877f069652ebc36d2667094619204a8d1e2aa1bc..e0fa5bdfb8dd9483cc6a2e6639280176bdbcb7de 100644 --- a/test/built-ins/TypedArray/prototype/keys/return-itor.js +++ b/test/built-ins/TypedArray/prototype/keys/return-itor.js @@ -13,10 +13,10 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -var sample = new Int8Array([0, 42, 64]); +var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, N) { + var typedArray = new TA(N(sample)); var itor = typedArray.keys(); var next = itor.next(); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js b/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js index 118fa2981bc8720b8a9d290535944f0a26c2813a..6e828e8c5b5b461bf2d4718587b7ff44b463deec 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-infinity.js @@ -24,9 +24,9 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 43, 41]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 43, 41])); - assert.sameValue(sample.lastIndexOf(43, Infinity), 2, "lastIndexOf(43, Infinity)"); - assert.sameValue(sample.lastIndexOf(43, -Infinity), -1, "lastIndexOf(43, -Infinity)"); + assert.sameValue(sample.lastIndexOf(N(43), Infinity), 2, "lastIndexOf(43, Infinity)"); + assert.sameValue(sample.lastIndexOf(N(43), -Infinity), -1, "lastIndexOf(43, -Infinity)"); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js b/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js index 1cf02d32952cce6b17ff59e7f0f2ff4e4ca6b565..c18cd6c68d88e0ae8fd3afb0a4707a1f0dc53c2d 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/fromIndex-minus-zero.js @@ -21,10 +21,10 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.lastIndexOf(42, -0), 0, "-0 [0]"); - assert.sameValue(sample.lastIndexOf(43, -0), -1, "-0 [1]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.lastIndexOf(N(42), -0), 0, "-0 [0]"); + assert.sameValue(sample.lastIndexOf(N(43), -0), -1, "-0 [1]"); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js index 076d0b8d8fc2e7ecf44b687a81d8f469662b1302..cc846e7ec71791c2ff8279a04a9140f0b908c20b 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/get-length-uses-internal-arraylength.js @@ -22,11 +22,11 @@ features: [TypedArray] Object.defineProperty(TypedArray.prototype, "length", {value: 0}); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7])); Object.defineProperty(TA.prototype, "length", {value: 0}); Object.defineProperty(sample, "length", {value: 0}); - assert.sameValue(sample.lastIndexOf(7), 0); + assert.sameValue(sample.lastIndexOf(N(7)), 0); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js b/test/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js index ecf7b2a84990b495e7d8a0c3dfba3e3532881681..cfcae34fe7d1616bc5d08b224151f5e8ce20827d 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/search-found-returns-index.js @@ -30,28 +30,28 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.lastIndexOf(42), 2, "lastIndexOf(42)"); - assert.sameValue(sample.lastIndexOf(43), 1, "lastIndexOf(43)"); - assert.sameValue(sample.lastIndexOf(41), 3, "lastIndexOf(41)"); - assert.sameValue(sample.lastIndexOf(41, 3), 3, "lastIndexOf(41, 3)"); - assert.sameValue(sample.lastIndexOf(41, 4), 3, "lastIndexOf(41, 4)"); - assert.sameValue(sample.lastIndexOf(43, 1), 1, "lastIndexOf(43, 1)"); - assert.sameValue(sample.lastIndexOf(43, 2), 1, "lastIndexOf(43, 2)"); - assert.sameValue(sample.lastIndexOf(43, 3), 1, "lastIndexOf(43, 3)"); - assert.sameValue(sample.lastIndexOf(43, 4), 1, "lastIndexOf(43, 4)"); - assert.sameValue(sample.lastIndexOf(42, 0), 0, "lastIndexOf(42, 0)"); - assert.sameValue(sample.lastIndexOf(42, 1), 0, "lastIndexOf(42, 1)"); - assert.sameValue(sample.lastIndexOf(42, 2), 2, "lastIndexOf(42, 2)"); - assert.sameValue(sample.lastIndexOf(42, 3), 2, "lastIndexOf(42, 3)"); - assert.sameValue(sample.lastIndexOf(42, 4), 2, "lastIndexOf(42, 4)"); - assert.sameValue(sample.lastIndexOf(42, -4), 0, "lastIndexOf(42, -4)"); - assert.sameValue(sample.lastIndexOf(42, -3), 0, "lastIndexOf(42, -3)"); - assert.sameValue(sample.lastIndexOf(42, -2), 2, "lastIndexOf(42, -2)"); - assert.sameValue(sample.lastIndexOf(42, -1), 2, "lastIndexOf(42, -1)"); - assert.sameValue(sample.lastIndexOf(43, -3), 1, "lastIndexOf(43, -3)"); - assert.sameValue(sample.lastIndexOf(43, -2), 1, "lastIndexOf(43, -2)"); - assert.sameValue(sample.lastIndexOf(43, -1), 1, "lastIndexOf(43, -1)"); - assert.sameValue(sample.lastIndexOf(41, -1), 3, "lastIndexOf(41, -1)"); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.lastIndexOf(N(42)), 2, "lastIndexOf(42)"); + assert.sameValue(sample.lastIndexOf(N(43)), 1, "lastIndexOf(43)"); + assert.sameValue(sample.lastIndexOf(N(41)), 3, "lastIndexOf(41)"); + assert.sameValue(sample.lastIndexOf(N(41), 3), 3, "lastIndexOf(41, 3)"); + assert.sameValue(sample.lastIndexOf(N(41), 4), 3, "lastIndexOf(41, 4)"); + assert.sameValue(sample.lastIndexOf(N(43), 1), 1, "lastIndexOf(43, 1)"); + assert.sameValue(sample.lastIndexOf(N(43), 2), 1, "lastIndexOf(43, 2)"); + assert.sameValue(sample.lastIndexOf(N(43), 3), 1, "lastIndexOf(43, 3)"); + assert.sameValue(sample.lastIndexOf(N(43), 4), 1, "lastIndexOf(43, 4)"); + assert.sameValue(sample.lastIndexOf(N(42), 0), 0, "lastIndexOf(42, 0)"); + assert.sameValue(sample.lastIndexOf(N(42), 1), 0, "lastIndexOf(42, 1)"); + assert.sameValue(sample.lastIndexOf(N(42), 2), 2, "lastIndexOf(42, 2)"); + assert.sameValue(sample.lastIndexOf(N(42), 3), 2, "lastIndexOf(42, 3)"); + assert.sameValue(sample.lastIndexOf(N(42), 4), 2, "lastIndexOf(42, 4)"); + assert.sameValue(sample.lastIndexOf(N(42), -4), 0, "lastIndexOf(42, -4)"); + assert.sameValue(sample.lastIndexOf(N(42), -3), 0, "lastIndexOf(42, -3)"); + assert.sameValue(sample.lastIndexOf(N(42), -2), 2, "lastIndexOf(42, -2)"); + assert.sameValue(sample.lastIndexOf(N(42), -1), 2, "lastIndexOf(42, -1)"); + assert.sameValue(sample.lastIndexOf(N(43), -3), 1, "lastIndexOf(43, -3)"); + assert.sameValue(sample.lastIndexOf(N(43), -2), 1, "lastIndexOf(43, -2)"); + assert.sameValue(sample.lastIndexOf(N(43), -1), 1, "lastIndexOf(43, -1)"); + assert.sameValue(sample.lastIndexOf(N(41), -1), 3, "lastIndexOf(41, -1)"); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js b/test/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js index 4669b5fc5e1012053d2cab90f263fc79c36bc38d..2094a40b3ca019fb0aa7ae8c4c6d36ea5a84793e 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/search-not-found-returns-minus-one.js @@ -25,18 +25,18 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43, 42, 41]); - assert.sameValue(sample.lastIndexOf(44), -1, "lastIndexOf(44)"); - assert.sameValue(sample.lastIndexOf(44, -4), -1, "lastIndexOf(44, -4)"); - assert.sameValue(sample.lastIndexOf(44, -5), -1, "lastIndexOf(44, -5)"); - assert.sameValue(sample.lastIndexOf(42, -5), -1, "lastIndexOf(42, -5)"); - assert.sameValue(sample.lastIndexOf(43, -4), -1, "lastIndexOf(43, -4)"); - assert.sameValue(sample.lastIndexOf(43, -5), -1, "lastIndexOf(43, -5)"); - assert.sameValue(sample.lastIndexOf(41, 0), -1, "lastIndexOf(41, 0)"); - assert.sameValue(sample.lastIndexOf(41, 1), -1, "lastIndexOf(41, 1)"); - assert.sameValue(sample.lastIndexOf(41, 2), -1, "lastIndexOf(41, 2)"); - assert.sameValue(sample.lastIndexOf(43, 0), -1, "lastIndexOf(43, 0)"); + sample = new TA(N([42, 43, 42, 41])); + assert.sameValue(sample.lastIndexOf(N(44)), -1, "lastIndexOf(44)"); + assert.sameValue(sample.lastIndexOf(N(44), -4), -1, "lastIndexOf(44, -4)"); + assert.sameValue(sample.lastIndexOf(N(44), -5), -1, "lastIndexOf(44, -5)"); + assert.sameValue(sample.lastIndexOf(N(42), -5), -1, "lastIndexOf(42, -5)"); + assert.sameValue(sample.lastIndexOf(N(43), -4), -1, "lastIndexOf(43, -4)"); + assert.sameValue(sample.lastIndexOf(N(43), -5), -1, "lastIndexOf(43, -5)"); + assert.sameValue(sample.lastIndexOf(N(41), 0), -1, "lastIndexOf(41, 0)"); + assert.sameValue(sample.lastIndexOf(N(41), 1), -1, "lastIndexOf(41, 1)"); + assert.sameValue(sample.lastIndexOf(N(41), 2), -1, "lastIndexOf(41, 2)"); + assert.sameValue(sample.lastIndexOf(N(43), 0), -1, "lastIndexOf(43, 0)"); }); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js b/test/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js index 374cebfa5c71d234ec2a2b23c154b265b79f3232..1adeec42fbd2b9d2ef51ebec3fa3f2d9efe5de44 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/strict-comparison.js @@ -38,4 +38,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(sample.lastIndexOf(null), -1, "null"); assert.sameValue(sample.lastIndexOf(undefined), -1, "undefined"); assert.sameValue(sample.lastIndexOf(""), -1, "empty string"); -}); +}, + // Cannot create Big*64Arrays from non-safe integers. + numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js b/test/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js index 5d47be3342f0565713bc17758c678f20969f92cf..c516ee8ca3f51bdf264e22e4a95390ef5a8d0b19 100644 --- a/test/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js +++ b/test/built-ins/TypedArray/prototype/lastIndexOf/tointeger-fromindex.js @@ -27,31 +27,31 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([42, 43]); - assert.sameValue(sample.lastIndexOf(42, "1"), 0, "string [0]"); - assert.sameValue(sample.lastIndexOf(43, "1"), 1, "string [1]"); + sample = new TA(N([42, 43])); + assert.sameValue(sample.lastIndexOf(N(42), "1"), 0, "string [0]"); + assert.sameValue(sample.lastIndexOf(N(43), "1"), 1, "string [1]"); - assert.sameValue(sample.lastIndexOf(42, true), 0, "true [0]"); - assert.sameValue(sample.lastIndexOf(43, true), 1, "true [1]"); + assert.sameValue(sample.lastIndexOf(N(42), true), 0, "true [0]"); + assert.sameValue(sample.lastIndexOf(N(43), true), 1, "true [1]"); - assert.sameValue(sample.lastIndexOf(42, false), 0, "false [0]"); - assert.sameValue(sample.lastIndexOf(43, false), -1, "false [1]"); + assert.sameValue(sample.lastIndexOf(N(42), false), 0, "false [0]"); + assert.sameValue(sample.lastIndexOf(N(43), false), -1, "false [1]"); - assert.sameValue(sample.lastIndexOf(42, NaN), 0, "NaN [0]"); - assert.sameValue(sample.lastIndexOf(43, NaN), -1, "NaN [1]"); + assert.sameValue(sample.lastIndexOf(N(42), NaN), 0, "NaN [0]"); + assert.sameValue(sample.lastIndexOf(N(43), NaN), -1, "NaN [1]"); - assert.sameValue(sample.lastIndexOf(42, null), 0, "null [0]"); - assert.sameValue(sample.lastIndexOf(43, null), -1, "null [1]"); + assert.sameValue(sample.lastIndexOf(N(42), null), 0, "null [0]"); + assert.sameValue(sample.lastIndexOf(N(43), null), -1, "null [1]"); - assert.sameValue(sample.lastIndexOf(42, undefined), 0, "undefined [0]"); - assert.sameValue(sample.lastIndexOf(43, undefined), -1, "undefined [1]"); + assert.sameValue(sample.lastIndexOf(N(42), undefined), 0, "undefined [0]"); + assert.sameValue(sample.lastIndexOf(N(43), undefined), -1, "undefined [1]"); - assert.sameValue(sample.lastIndexOf(42, null), 0, "null [0]"); - assert.sameValue(sample.lastIndexOf(43, null), -1, "null [1]"); + assert.sameValue(sample.lastIndexOf(N(42), null), 0, "null [0]"); + assert.sameValue(sample.lastIndexOf(N(43), null), -1, "null [1]"); - assert.sameValue(sample.lastIndexOf(42, obj), 0, "object [0]"); - assert.sameValue(sample.lastIndexOf(43, obj), 1, "object [1]"); + assert.sameValue(sample.lastIndexOf(N(42), obj), 0, "object [0]"); + assert.sameValue(sample.lastIndexOf(N(43), obj), 1, "object [1]"); }); diff --git a/test/built-ins/TypedArray/prototype/map/arraylength-internal.js b/test/built-ins/TypedArray/prototype/map/arraylength-internal.js index 0f9ec0807831b558baeb801b92594386d51bf4f1..39b34ae8a1cbe5aebea62b5a5db332dc7524ab79 100644 --- a/test/built-ins/TypedArray/prototype/map/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/map/arraylength-internal.js @@ -14,7 +14,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(42); var loop = 0; @@ -22,6 +22,7 @@ testWithTypedArrayConstructors(function(TA) { sample1.map(function() { loop++; + return N(0); }); assert.sameValue(loop, 42, "data descriptor"); @@ -37,6 +38,7 @@ testWithTypedArrayConstructors(function(TA) { sample2.map(function() { loop++; + return N(0); }); assert.sameValue(loop, 4, "accessor descriptor"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js index 5ffb6ce943e0e60da6de18b91320b6018b525328..b0442e5e2c07e67a9d2e6f7da43375dd709d8e7c 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-with-thisarg.js @@ -17,31 +17,32 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; sample.map(function() { results.push(arguments); + return N(0); }, thisArg); assert.sameValue(results.length, 3, "results.length"); assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js index 97386a564c12c61f0f243d68efe9972df3f1379c..506f3e1ed741da88f4f94d3506f39f37b8f52076 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-arguments-without-thisarg.js @@ -17,29 +17,30 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; sample.map(function() { results.push(arguments); + return N(0); }); assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js b/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js index 1a7e78fae6f496d057b325a904930f3942525998..ef5b7fee7a57fcad13dc31d5fdf53337f2136662 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-detachbuffer.js @@ -27,6 +27,7 @@ testWithTypedArrayConstructors(function(TA) { } $DETACHBUFFER(sample.buffer); loops++; + return N(0); }); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js b/test/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js index 0ce305a7ed504d395ac412357cc77fffdc9c8187..eff8277d63fdac345812423e9f962b28449b044c 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-no-interaction-over-non-integer-properties.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -28,6 +28,7 @@ testWithTypedArrayConstructors(function(TA) { sample.map(function() { results.push(arguments); + return N(0); }); assert.sameValue(results.length, 2, "results.length"); @@ -35,6 +36,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); - assert.sameValue(results[0][0], 7, "results[0][0] - kValue"); - assert.sameValue(results[1][0], 8, "results[1][0] - kValue"); + assert.sameValue(results[0][0], N(7), "results[0][0] - kValue"); + assert.sameValue(results[1][0], N(8), "results[1][0] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js b/test/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js index 6f19e2277d0a76ff8cc3d65486d90a1f19cf68e3..b05d96894dc38d72db4bbe0610b6e376b6804ea5 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-return-affects-returned-object.js @@ -19,13 +19,13 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 4]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 4])); var result = sample.map(function(v) { - return v * 3; + return v * N(3); }); - assert.sameValue(result[0], 3, "result[0] == 3"); - assert.sameValue(result[1], 6, "result[1] == 6"); - assert.sameValue(result[2], 12, "result[2] == 12"); + assert.sameValue(result[0], N(3), "result[0] == 3"); + assert.sameValue(result[1], N(6), "result[1] == 6"); + assert.sameValue(result[2], N(12), "result[2] == 12"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js index fe298618b8c4e076aa18a03f2bae2d5c5b70d5a4..311fbde669b6463adf306f047469363e2b7be23b 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-change-instance.js @@ -10,16 +10,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample1 = new TA(3); - sample1[1] = 1; + sample1[1] = N(1); sample1.map(function() { - return 42; + return N(42); }); - assert.sameValue(sample1[0], 0, "[0] == 0"); - assert.sameValue(sample1[1], 1, "[1] == 1"); - assert.sameValue(sample1[2], 0, "[2] == 0"); + assert.sameValue(sample1[0], N(0), "[0] == 0"); + assert.sameValue(sample1[1], N(1), "[1] == 1"); + assert.sameValue(sample1[2], N(0), "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js b/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js index cbe3316cd8ef5ce34464cfea92162734e941c5ae..d9fcda6ca2f521a687312952698a9e323b2e5eb3 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-return-does-not-copy-non-integer-properties.js @@ -17,15 +17,15 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var bar = Symbol("1"); sample.foo = 42; sample[bar] = 1; var result = sample.map(function() { - return 0; + return N(0); }); assert.sameValue(result.length, 2, "result.length"); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js index 0d520cd4538ea17d620b251a47ff6073eda8b8e7..b401826c6143b4428dfc28a0e6438d179e2b43c8 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-set-value-during-interaction.js @@ -11,32 +11,33 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.map(function(val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); newVal++; + return N(0); }); - assert.sameValue(sample[0], 7, "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/map/callbackfn-this.js b/test/built-ins/TypedArray/prototype/map/callbackfn-this.js index 43d3159bc4b842d5f983dee2f53a9c79762018fe..46d9909726336917840291f383131da088080d6c 100644 --- a/test/built-ins/TypedArray/prototype/map/callbackfn-this.js +++ b/test/built-ins/TypedArray/prototype/map/callbackfn-this.js @@ -21,14 +21,14 @@ features: [TypedArray] var expected = (function() { return this; })(); var thisArg = {}; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(3); var results1 = []; sample.map(function() { results1.push(this); - return 0; + return N(0); }); assert.sameValue(results1.length, 3, "results1"); @@ -40,7 +40,7 @@ testWithTypedArrayConstructors(function(TA) { sample.map(function() { results2.push(this); - return 0; + return N(0); }, thisArg); assert.sameValue(results2.length, 3, "results2"); diff --git a/test/built-ins/TypedArray/prototype/map/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/map/values-are-not-cached.js index d2345b13c0ef193271f8f975a54341037a51c9ba..e7d87ff1d122d1e1541449c94367503751348ef1 100644 --- a/test/built-ins/TypedArray/prototype/map/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/map/values-are-not-cached.js @@ -11,16 +11,18 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.map(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); + + return N(0); }); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js index c99ad441b13d74e5591c4bf2d3561e55c939fd15..3ed389aff770066eda7d7608fce7a4f339821c8b 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-custom-accumulator.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -40,19 +40,19 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0].length, 4, "results[0].length"); assert.sameValue(results[0][0], 7, "results[0][0] - accumulator"); - assert.sameValue(results[0][1], 42, "results[0][1] - kValue"); + assert.sameValue(results[0][1], N(42), "results[0][1] - kValue"); assert.sameValue(results[0][2], 0, "results[0][2] - k"); assert.sameValue(results[0][3], sample, "results[0][3] - this"); assert.sameValue(results[1].length, 4, "results[1].length"); assert.sameValue(results[1][0], 8, "results[1][0] - accumulator"); - assert.sameValue(results[1][1], 43, "results[1][1] - kValue"); + assert.sameValue(results[1][1], N(43), "results[1][1] - kValue"); assert.sameValue(results[1][2], 1, "results[1][2] - k"); assert.sameValue(results[1][3], sample, "results[1][3] - this"); assert.sameValue(results[2].length, 4, "results[2].length"); assert.sameValue(results[2][0], 9, "results[2][0] - accumulator"); - assert.sameValue(results[2][1], 44, "results[2][1] - kValue"); + assert.sameValue(results[2][1], N(44), "results[2][1] - kValue"); assert.sameValue(results[2][2], 2, "results[2][2] - k"); assert.sameValue(results[2][3], sample, "results[2][3] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js index f293ef1b934da40896e20e8f53209efb5dc2c5e6..bdf5f7c646c14c8a08673f4e6499c58581acc53b 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-arguments-default-accumulator.js @@ -33,27 +33,27 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; sample.reduce(function(accumulator) { results.push(arguments); - return accumulator - 1; + return accumulator - N(1); }); assert.sameValue(results.length, 2, "results.length"); assert.sameValue(results[0].length, 4, "results[1].length"); - assert.sameValue(results[0][0], 42, "results[1][0] - accumulator"); - assert.sameValue(results[0][1], 43, "results[1][1] - kValue"); + assert.sameValue(results[0][0], N(42), "results[1][0] - accumulator"); + assert.sameValue(results[0][1], N(43), "results[1][1] - kValue"); assert.sameValue(results[0][2], 1, "results[1][2] - k"); assert.sameValue(results[0][3], sample, "results[1][3] - this"); assert.sameValue(results[1].length, 4, "results[2].length"); - assert.sameValue(results[1][0], 41, "results[2][0] - accumulator"); - assert.sameValue(results[1][1], 44, "results[2][1] - kValue"); + assert.sameValue(results[1][0], N(41), "results[2][0] - accumulator"); + assert.sameValue(results[1][1], N(44), "results[2][1] - kValue"); assert.sameValue(results[1][2], 2, "results[2][2] - k"); assert.sameValue(results[1][3], sample, "results[2][3] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js index 18982a9d37122ed4f2a1a6d27acf49a7d2a87abc..14911508ce955e02ee17a25598be8de9acb68d2a 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-no-iteration-over-non-integer-properties.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -43,6 +43,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][2], 0, "results[0][2] - k"); assert.sameValue(results[1][2], 1, "results[1][2] - k"); - assert.sameValue(results[0][1], 7, "results[0][1] - kValue"); - assert.sameValue(results[1][1], 8, "results[1][1] - kValue"); + assert.sameValue(results[0][1], N(7), "results[0][1] - kValue"); + assert.sameValue(results[1][1], N(8), "results[1][1] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js index 6969dd9b544d6988d14c24d06a1313e61377e760..8c0dcd9aa46e4d3169984d66f554a8755a1e16a1 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-return-does-not-change-instance.js @@ -8,14 +8,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 1, 0]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 1, 0])); sample.reduce(function() { return 42; }, 7); - assert.sameValue(sample[0], 0, "[0] == 0"); - assert.sameValue(sample[1], 1, "[1] == 1"); - assert.sameValue(sample[2], 0, "[2] == 0"); + assert.sameValue(sample[0], N(0), "[0] == 0"); + assert.sameValue(sample[1], N(1), "[1] == 1"); + assert.sameValue(sample[2], N(0), "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js index 41ae9c0c7bb6e372491814af63ddce6295f7cd9a..0afa1860c4380756ea9a7f4d0c178c1f41bb92b9 100644 --- a/test/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js +++ b/test/built-ins/TypedArray/prototype/reduce/callbackfn-set-value-during-iteration.js @@ -18,24 +18,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.reduce(function(acc, val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); @@ -43,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { newVal++; }, 0); - assert.sameValue(sample[0], 7, "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js index 53f976f0f8f55e30780d48a935c3172eef981f88..b72ca46716b0414f3e41635f8fc66e40721397a4 100644 --- a/test/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/reduce/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var calls = 0; Object.defineProperty(TA.prototype, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js b/test/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js index 17280f1590320a6e16786dd0280e6ec53a63f727..99ae68cef5fd08e23873c0fe0cd8067d6b1d58ee 100644 --- a/test/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js +++ b/test/built-ins/TypedArray/prototype/reduce/result-is-last-callbackfn-return.js @@ -34,11 +34,11 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var calls, result; calls = 0; - result = new TA([1, 2, 3]).reduce(function() { + result = new TA(N([1, 2, 3])).reduce(function() { calls++; if (calls == 2) { @@ -48,7 +48,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(result, 42, "using default accumulator"); calls = 0; - result = new TA([1, 2, 3]).reduce(function() { + result = new TA(N([1, 2, 3])).reduce(function() { calls++; if (calls == 3) { diff --git a/test/built-ins/TypedArray/prototype/reduce/result-of-any-type.js b/test/built-ins/TypedArray/prototype/reduce/result-of-any-type.js index 0519cc88a5952745ac069494e44446fb4a5c6fa5..3ff22b46f09003a37176cf409551ef7954a33b04 100644 --- a/test/built-ins/TypedArray/prototype/reduce/result-of-any-type.js +++ b/test/built-ins/TypedArray/prototype/reduce/result-of-any-type.js @@ -34,8 +34,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); [ ["test262", "string"], ["", "empty string"], diff --git a/test/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js b/test/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js index 236b332e4f6851e506ee81d176b91dbbeccd3f7e..965cec5c2dd62ef463dceebde01a370fd526c1df 100644 --- a/test/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js +++ b/test/built-ins/TypedArray/prototype/reduce/return-first-value-without-callbackfn.js @@ -31,12 +31,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var called = false; - var result = new TA([42]).reduce(function() { + var result = new TA(N([42])).reduce(function() { called = true; }); - assert.sameValue(result, 42); + assert.sameValue(result, N(42)); assert.sameValue(called, false); }); diff --git a/test/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js index e091df1f9da26bc204b61b006cb8fb6d75a481d1..ecb194d960a741f4b95975482f14de06aa9d6c07 100644 --- a/test/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/reduce/values-are-not-cached.js @@ -26,16 +26,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.reduce(function(a, v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); }, 0); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js index aecfae24ebaf1b4f197df84447930da61bb06586..c280aeef0a40d0159aa174b8510bf05962498173 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-custom-accumulator.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -41,19 +41,19 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0].length, 4, "results[0].length"); assert.sameValue(results[0][0], 7, "results[0][0] - accumulator"); - assert.sameValue(results[0][1], 44, "results[0][1] - kValue"); + assert.sameValue(results[0][1], N(44), "results[0][1] - kValue"); assert.sameValue(results[0][2], 2, "results[0][2] - k"); assert.sameValue(results[0][3], sample, "results[0][3] - this"); assert.sameValue(results[1].length, 4, "results[1].length"); assert.sameValue(results[1][0], 8, "results[1][0] - accumulator"); - assert.sameValue(results[1][1], 43, "results[1][1] - kValue"); + assert.sameValue(results[1][1], N(43), "results[1][1] - kValue"); assert.sameValue(results[1][2], 1, "results[1][2] - k"); assert.sameValue(results[1][3], sample, "results[1][3] - this"); assert.sameValue(results[2].length, 4, "results[2].length"); assert.sameValue(results[2][0], 9, "results[2][0] - accumulator"); - assert.sameValue(results[2][1], 42, "results[2][1] - kValue"); + assert.sameValue(results[2][1], N(42), "results[2][1] - kValue"); assert.sameValue(results[2][2], 0, "results[2][2] - k"); assert.sameValue(results[2][3], sample, "results[2][3] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js index 51509985e921c4f764313bf1ab2362866a896c70..e689c9fe762d9910bb80fd1d663e206008c3ee62 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-arguments-default-accumulator.js @@ -36,27 +36,27 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; sample.reduceRight(function(accumulator) { results.push(arguments); - return accumulator + 1; + return accumulator + N(1); }); assert.sameValue(results.length, 2, "results.length"); assert.sameValue(results[0].length, 4, "results[1].length"); - assert.sameValue(results[0][0], 44, "results[1][0] - accumulator"); - assert.sameValue(results[0][1], 43, "results[1][1] - kValue"); + assert.sameValue(results[0][0], N(44), "results[1][0] - accumulator"); + assert.sameValue(results[0][1], N(43), "results[1][1] - kValue"); assert.sameValue(results[0][2], 1, "results[1][2] - k"); assert.sameValue(results[0][3], sample, "results[1][3] - this"); assert.sameValue(results[1].length, 4, "results[2].length"); - assert.sameValue(results[1][0], 45, "results[2][0] - accumulator"); - assert.sameValue(results[1][1], 42, "results[2][1] - kValue"); + assert.sameValue(results[1][0], N(45), "results[2][0] - accumulator"); + assert.sameValue(results[1][1], N(42), "results[2][1] - kValue"); assert.sameValue(results[1][2], 0, "results[2][2] - k"); assert.sameValue(results[1][3], sample, "results[2][3] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js index b81c9a91ed55c0caab0ca75709d776a562882baa..c807f650a3721b50fcdb4c313f9d75bcfe9de187 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-no-iteration-over-non-integer-properties.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -44,6 +44,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][2], 1, "results[0][2] - k"); assert.sameValue(results[1][2], 0, "results[1][2] - k"); - assert.sameValue(results[0][1], 8, "results[0][1] - kValue"); - assert.sameValue(results[1][1], 7, "results[1][1] - kValue"); + assert.sameValue(results[0][1], N(8), "results[0][1] - kValue"); + assert.sameValue(results[1][1], N(7), "results[1][1] - kValue"); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js index d1c746ffaf81ec069bf89403177d66848ae7bcf6..294eb33ea65290908200f48b53bafe3189324c78 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-return-does-not-change-instance.js @@ -8,14 +8,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 1, 0]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 1, 0])); sample.reduceRight(function() { return 42; }, 7); - assert.sameValue(sample[0], 0, "[0] == 0"); - assert.sameValue(sample[1], 1, "[1] == 1"); - assert.sameValue(sample[2], 0, "[2] == 0"); + assert.sameValue(sample[0], N(0), "[0] == 0"); + assert.sameValue(sample[1], N(1), "[1] == 1"); + assert.sameValue(sample[2], N(0), "[2] == 0"); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js index 290f197c031e759f317dec186928a079f7d95e25..62c9ef47a368e53d39bcd9f640c20da683c79e80 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/callbackfn-set-value-during-iteration.js @@ -18,24 +18,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.reduceRight(function(acc, val, i) { if (i < sample.length - 1) { assert.sameValue( - sample[i + 1], newVal - 1, + sample[i + 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 2, 7), + Reflect.set(sample, 2, N(7)), true, "re-set a value for sample[2]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); @@ -43,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { newVal++; }, 0); - assert.sameValue(sample[0], 2, "changed values after iteration [0] == 2"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 7, "changed values after iteration [2] == 7"); + assert.sameValue(sample[0], N(2), "changed values after iteration [0] == 2"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(7), "changed values after iteration [2] == 7"); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js index 32c560242c3e83589c387fc8cab5f5658020b3ec..b1ff04f5d69823a51bf00383005e6a6939d532ec 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var calls = 0; Object.defineProperty(TA.prototype, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js b/test/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js index 67504f27be720be93b05e432c8df41bcacc41a93..41771b6f73f36f72330bee172435697b489dd609 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/result-is-last-callbackfn-return.js @@ -36,11 +36,11 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var calls, result; calls = 0; - result = new TA([1, 2, 3]).reduceRight(function() { + result = new TA(N([1, 2, 3])).reduceRight(function() { calls++; if (calls == 2) { @@ -50,7 +50,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(result, 42, "using default accumulator"); calls = 0; - result = new TA([1, 2, 3]).reduceRight(function() { + result = new TA(N([1, 2, 3])).reduceRight(function() { calls++; if (calls == 3) { diff --git a/test/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js b/test/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js index a7f2d6df87ef2a74c318d43f1f9830397307c830..2cb4a4f62a4a2f0616010f2890156574c831ea97 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/result-of-any-type.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); [ ["test262", "string"], ["", "empty string"], diff --git a/test/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js b/test/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js index 7100baf43a8a10944cc875f259ed3c80e7adef96..7992c27c3293bd15f867420fd1bf2746c63da8ac 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/return-first-value-without-callbackfn.js @@ -32,12 +32,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var called = false; - var result = new TA([42]).reduceRight(function() { + var result = new TA(N([42])).reduceRight(function() { called = true; }); - assert.sameValue(result, 42); + assert.sameValue(result, N(42)); assert.sameValue(called, false); }); diff --git a/test/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js index fb93d3e208c9be71f99684e9f7e39bea160c4f37..014ba87ddc4bfa1777f27d3bd4d8ca465bbcfd51 100644 --- a/test/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/reduceRight/values-are-not-cached.js @@ -27,16 +27,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([44, 43, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([44, 43, 42])); sample.reduceRight(function(a, v, i) { if (i > 0) { - sample[i-1] = 42; + sample[i-1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); }, 0); }); diff --git a/test/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js index 4a51f2ffbcf70fb9ae8bf13c731837e8721257d2..35150f28975e50a096840eb9869acbaaf1bb8b79 100644 --- a/test/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/reverse/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/reverse/reverts.js b/test/built-ins/TypedArray/prototype/reverse/reverts.js index 5bec740e5b3bad21559336a7bcb864daf8df5c6d..be321a62fad5406a1acba12fc963285a7b028915 100644 --- a/test/built-ins/TypedArray/prototype/reverse/reverts.js +++ b/test/built-ins/TypedArray/prototype/reverse/reverts.js @@ -21,37 +21,37 @@ features: [TypedArray] var buffer = new ArrayBuffer(64); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(buffer, 0, 4); var other = new TA(buffer, 0, 5); - sample[0] = 42; - sample[1] = 43; - sample[2] = 2; - sample[3] = 1; - other[4] = 7; + sample[0] = N(42); + sample[1] = N(43); + sample[2] = N(2); + sample[3] = N(1); + other[4] = N(7); sample.reverse(); assert( - compareArray(sample, [1, 2, 43, 42]) + compareArray(sample, N([1, 2, 43, 42])) ); assert( - compareArray(other, [1, 2, 43, 42, 7]) + compareArray(other, N([1, 2, 43, 42, 7])) ); - sample[0] = 7; - sample[1] = 17; - sample[2] = 1; - sample[3] = 0; - other[4] = 42; + sample[0] = N(7); + sample[1] = N(17); + sample[2] = N(1); + sample[3] = N(0); + other[4] = N(42); other.reverse(); assert( - compareArray(other, [42, 0, 1, 17, 7]) + compareArray(other, N([42, 0, 1, 17, 7])) ); assert( - compareArray(sample, [42, 0, 1, 17]) + compareArray(sample, N([42, 0, 1, 17])) ); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js b/test/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js index a5ab527732527d2f87db3d70f79b1f9506ceb5e5..c0e88a13d06ce39817d5c0013fe63f50e5406a41 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-offset-tointeger.js @@ -18,78 +18,78 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([1, 2]); - sample.set([42], ""); - assert(compareArray(sample, [42, 2]), "the empty string"); + sample = new TA(N([1, 2])); + sample.set([N(42)], ""); + assert(compareArray(sample, N([42, 2])), "the empty string"); - sample = new TA([1, 2]); - sample.set([42], "0"); - assert(compareArray(sample, [42, 2]), "'0'"); + sample = new TA(N([1, 2])); + sample.set([N(42)], "0"); + assert(compareArray(sample, N([42, 2])), "'0'"); - sample = new TA([1, 2]); - sample.set([42], false); - assert(compareArray(sample, [42, 2]), "false"); + sample = new TA(N([1, 2])); + sample.set([N(42)], false); + assert(compareArray(sample, N([42, 2])), "false"); - sample = new TA([1, 2]); - sample.set([42], 0.1); - assert(compareArray(sample, [42, 2]), "0.1"); + sample = new TA(N([1, 2])); + sample.set([N(42)], 0.1); + assert(compareArray(sample, N([42, 2])), "0.1"); - sample = new TA([1, 2]); - sample.set([42], 0.9); - assert(compareArray(sample, [42, 2]), "0.9"); + sample = new TA(N([1, 2])); + sample.set([N(42)], 0.9); + assert(compareArray(sample, N([42, 2])), "0.9"); - sample = new TA([1, 2]); - sample.set([42], -0.5); - assert(compareArray(sample, [42, 2]), "-0.5"); + sample = new TA(N([1, 2])); + sample.set([N(42)], -0.5); + assert(compareArray(sample, N([42, 2])), "-0.5"); - sample = new TA([1, 2]); - sample.set([42], 1.1); - assert(compareArray(sample, [1, 42]), "1.1"); + sample = new TA(N([1, 2])); + sample.set([N(42)], 1.1); + assert(compareArray(sample, N([1, 42])), "1.1"); - sample = new TA([1, 2]); - sample.set([42], NaN); - assert(compareArray(sample, [42, 2]), "NaN"); + sample = new TA(N([1, 2])); + sample.set([N(42)], NaN); + assert(compareArray(sample, N([42, 2])), "NaN"); - sample = new TA([1, 2]); - sample.set([42], null); - assert(compareArray(sample, [42, 2]), "null"); + sample = new TA(N([1, 2])); + sample.set([N(42)], null); + assert(compareArray(sample, N([42, 2])), "null"); - sample = new TA([1, 2]); - sample.set([42], undefined); - assert(compareArray(sample, [42, 2]), "undefined"); + sample = new TA(N([1, 2])); + sample.set([N(42)], undefined); + assert(compareArray(sample, N([42, 2])), "undefined"); - sample = new TA([1, 2]); - sample.set([42], {}); - assert(compareArray(sample, [42, 2]), "{}"); + sample = new TA(N([1, 2])); + sample.set([N(42)], {}); + assert(compareArray(sample, N([42, 2])), "{}"); - sample = new TA([1, 2]); - sample.set([42], []); - assert(compareArray(sample, [42, 2]), "[]"); + sample = new TA(N([1, 2])); + sample.set([N(42)], []); + assert(compareArray(sample, N([42, 2])), "[]"); - sample = new TA([1, 2]); - sample.set([42], [0]); - assert(compareArray(sample, [42, 2]), "[0]"); + sample = new TA(N([1, 2])); + sample.set([N(42)], [0]); + assert(compareArray(sample, N([42, 2])), "[0]"); - sample = new TA([1, 2]); - sample.set([42], true); - assert(compareArray(sample, [1, 42]), "true"); + sample = new TA(N([1, 2])); + sample.set([N(42)], true); + assert(compareArray(sample, N([1, 42])), "true"); - sample = new TA([1, 2]); - sample.set([42], "1"); - assert(compareArray(sample, [1, 42]), "'1'"); + sample = new TA(N([1, 2])); + sample.set([N(42)], "1"); + assert(compareArray(sample, N([1, 42])), "'1'"); - sample = new TA([1, 2]); - sample.set([42], [1]); - assert(compareArray(sample, [1, 42]), "[1]"); + sample = new TA(N([1, 2])); + sample.set([N(42)], [1]); + assert(compareArray(sample, N([1, 42])), "[1]"); - sample = new TA([1, 2]); - sample.set([42], { valueOf: function() {return 1;} }); - assert(compareArray(sample, [1, 42]), "valueOf"); + sample = new TA(N([1, 2])); + sample.set([N(42)], { valueOf: function() {return 1;} }); + assert(compareArray(sample, N([1, 42])), "valueOf"); - sample = new TA([1, 2]); - sample.set([42], { toString: function() {return 1;} }); - assert(compareArray(sample, [1, 42]), "toString"); + sample = new TA(N([1, 2])); + sample.set([N(42)], { toString: function() {return 1;} }); + assert(compareArray(sample, N([1, 42])), "toString"); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js index 2c67c5cc40579e3f70e20629918e48b104ad5b5e..e4b1b77268e9eb2383d3cd5c97ea42b987003844 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-length.js @@ -24,8 +24,8 @@ Object.defineProperty(obj, "length", { } }); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); assert.throws(Test262Error, function() { sample.set(obj); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js index e4704624787c82e72a412894c48f5e9bb8896f3c..c96f7bcb9fc63ebe4c7e524cfef1e3be85ff3c67 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-get-value.js @@ -22,27 +22,27 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -var obj = { - length: 4, - "0": 42, - "1": 43, - "3": 44 -}; -Object.defineProperty(obj, "2", { - get: function() { - throw new Test262Error(); - } -}); +testWithTypedArrayConstructors(function(TA, N) { + var obj = { + length: 4, + "0": N(42), + "1": N(43), + "3": N(44) + }; + Object.defineProperty(obj, "2", { + get: function() { + throw new Test262Error(); + } + }); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3, 4]); + var sample = new TA(N([1, 2, 3, 4])); assert.throws(Test262Error, function() { sample.set(obj); }); assert( - compareArray(sample, [42, 43, 3, 4]), + compareArray(sample, N([42, 43, 3, 4])), "values are set until exception" ); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js index f5b2289d8dbc3fbc1bdee362e0587fad0ed19ad2..a1c8bd7955f550c4ede65fa0aa428fcafcab0eb7 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length-symbol.js @@ -21,8 +21,8 @@ var obj = { length: Symbol("1") }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); assert.throws(TypeError, function() { sample.set(obj); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js index 8252ebbef6c751d18403e52a3abca0b38b08676a..bac8f5b74b4c3dc6e258af375649f51b0d0398bf 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-length.js @@ -33,8 +33,8 @@ var obj2 = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); assert.throws(Test262Error, function() { sample.set(obj1); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js index 250b66c0b41541817f4a5a16f835163fd7e6355d..db48b41d7f77d77c65498e90d27596072ad521e5 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value-symbol.js @@ -22,23 +22,23 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol, TypedArray] ---*/ -var obj = { - length: 4, - "0": 42, - "1": 43, - "2": Symbol("1"), - "3": 44 -}; +testWithTypedArrayConstructors(function(TA, N) { + var obj = { + length: 4, + "0": N(42), + "1": N(43), + "2": Symbol("1"), + "3": N(44) + }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3, 4]); + var sample = new TA(N([1, 2, 3, 4])); assert.throws(TypeError, function() { sample.set(obj); }); assert( - compareArray(sample, [42, 43, 3, 4]), + compareArray(sample, N([42, 43, 3, 4])), "values are set until exception" ); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js index 535841f580b35055e7f2a64bf9d9215f47a2ac78..6348580e2fd81d76ff665f57e01c31e9cc062ac3 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-src-tonumber-value.js @@ -22,27 +22,27 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -var obj = { - length: 4, - "0": 42, - "1": 43, - "2": { - valueOf: function() { - throw new Test262Error(); - } - }, - "3": 44 -}; +testWithTypedArrayConstructors(function(TA, N) { + var obj = { + length: 4, + "0": N(42), + "1": N(43), + "2": { + valueOf: function() { + throw new Test262Error(); + } + }, + "3": N(44) + }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3, 4]); + var sample = new TA(N([1, 2, 3, 4])); assert.throws(Test262Error, function() { sample.set(obj); }); assert( - compareArray(sample, [42, 43, 3, 4]), + compareArray(sample, N([42, 43, 3, 4])), "values are set until exception" ); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js index d3671239391f4cbb1b1c101a7303e8e3d1453e50..78a3c00d0976b3f6b6cbbe1e24ce9b2fd1b8d475 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-return-abrupt-from-toobject-offset.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); assert.throws(TypeError, function() { sample.set(undefined); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js b/test/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js index 9c1603a30dea29d6e20e0f155a6790e147db2fb2..95ef44d9f103b2f7afda34fb9191fb6e84a1d2fe 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-set-values-in-order.js @@ -22,7 +22,7 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(5); var calls = []; var obj = { @@ -32,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) { get: function() { calls.push(0); calls.push(sample.join()); - return 42; + return N(42); } }); @@ -40,7 +40,7 @@ testWithTypedArrayConstructors(function(TA) { get: function() { calls.push(1); calls.push(sample.join()); - return 43; + return N(43); } }); @@ -48,7 +48,7 @@ testWithTypedArrayConstructors(function(TA) { get: function() { calls.push(2); calls.push(sample.join()); - return 44; + return N(44); } }); @@ -61,7 +61,7 @@ testWithTypedArrayConstructors(function(TA) { sample.set(obj, 1); assert( - compareArray(sample, [0, 42, 43, 44, 0]), + compareArray(sample, N([0, 42, 43, 44, 0])), "values are set for src length" ); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-set-values.js b/test/built-ins/TypedArray/prototype/set/array-arg-set-values.js index 6e53dbc94e3a17c7c1309d1822f467f74ffaa993..5490305d0cfcfe40f33f0bbec11b1845b17c844c 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-set-values.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-set-values.js @@ -22,42 +22,42 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var src = [42, 43]; +testWithTypedArrayConstructors(function(TA, N) { + var src = N([42, 43]); var srcObj = { length: 2, - '0': 7, - '1': 17 + '0': N(7), + '1': N(17) }; var sample, result; - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 0); - assert(compareArray(sample, [42, 43, 3, 4]), "offset: 0, result: " + sample); + assert(compareArray(sample, N([42, 43, 3, 4])), "offset: 0, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 1); - assert(compareArray(sample, [1, 42, 43, 4]), "offset: 1, result: " + sample); + assert(compareArray(sample, N([1, 42, 43, 4])), "offset: 1, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 2); - assert(compareArray(sample, [1, 2, 42, 43]), "offset: 2, result: " + sample); + assert(compareArray(sample, N([1, 2, 42, 43])), "offset: 2, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(srcObj, 0); - assert(compareArray(sample, [7, 17, 3, 4]), "offset: 0, result: " + sample); + assert(compareArray(sample, N([7, 17, 3, 4])), "offset: 0, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(srcObj, 1); - assert(compareArray(sample, [1, 7, 17, 4]), "offset: 1, result: " + sample); + assert(compareArray(sample, N([1, 7, 17, 4])), "offset: 1, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(srcObj, 2); - assert(compareArray(sample, [1, 2, 7, 17]), "offset: 2, result: " + sample); + assert(compareArray(sample, N([1, 2, 7, 17])), "offset: 2, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js b/test/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js index 0256df84e2560f047cfa58b16c78bab12317861e..78ed1b45591e14f42dc280c3639214be81d3fcd3 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-src-tonumber-value-type-conversions.js @@ -22,24 +22,30 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -var obj1 = { - valueOf: function() { - return 42; - } -}; +testWithTypedArrayConstructors(function(TA, N) { + var obj1 = { + valueOf: function() { + return N(42); + } + }; -var obj2 = { - toString: function() { - return 42; - } -}; + var obj2 = { + toString: function() { + return "42"; + } + }; -// undefined and NaN covered on typedArrayConversions -var arr = ["1", "", false, true, null, obj1, obj2, [], [1]]; + // undefined and NaN covered on typedArrayConversions + var nullish; + try { + nullish = N(null); + } catch (e) { + nullish = 0n; + } + var arr = ["1", "", false, true, nullish, obj1, obj2, [], [1]]; -testWithTypedArrayConstructors(function(TA) { var sample = new TA(arr.length); - var expected = new TA([1, 0, 0, 1, 0, 42, 42, 0, 1]); + var expected = new TA(N([1, 0, 0, 1, 0, 42, 42, 0, 1])); sample.set(arr); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js b/test/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js index a3750490f111d80bfb299d8174186cb1efc9efe6..8931748ec364f229ce0a65d8879225e56d21e771 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-src-values-are-not-cached.js @@ -22,26 +22,26 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(5); var obj = { length: 5, - '1': 7, - '2': 7, - '3': 7, - '4': 7 + '1': N(7), + '2': N(7), + '3': N(7), + '4': N(7) }; Object.defineProperty(obj, 0, { get: function() { - obj[1] = 43; - obj[2] = 44; - obj[3] = 45; - obj[4] = 46; - return 42; + obj[1] = N(43); + obj[2] = N(44); + obj[3] = N(45); + obj[4] = N(46); + return N(42); } }); sample.set(obj); - assert(compareArray(sample, [42, 43, 44, 45, 46])); + assert(compareArray(sample, N([42, 43, 44, 45, 46]))); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js index 97bead5c9e09550de37ea7d092ee46196592aac9..4a6e1ee3993d92bb43822ae46614665960bbc5c3 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-target-arraylength-internal.js @@ -29,13 +29,13 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); - sample.set([42, 43]); + sample.set(N([42, 43])); assert.sameValue(getCalls, 0, "ignores length properties"); }); diff --git a/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-throws.js b/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-throws.js index eed7db0831ad2dc1539d4aea853604e1f41b4c26..e77c0bdfd4a99bc37043cac75cfc2f3fcf5a5996 100644 --- a/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-throws.js +++ b/test/built-ins/TypedArray/prototype/set/array-arg-targetbuffer-detached-on-get-src-value-throws.js @@ -22,11 +22,11 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([1, 2, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([1, 2, 3])); var obj = { length: 3, - "0": 42 + "0": N(42) }; Object.defineProperty(obj, 1, { get: function() { diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js index 7f63cb9960727b9e292d39f458eff88d768a2d81..2bdb3ded3bcd249c1c2c86cef164662b10f4c137 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-offset-tointeger.js @@ -15,79 +15,79 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - var src = new TA([42]); + var src = new TA(N([42])); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, ""); - assert(compareArray(sample, [42, 2]), "the empty string"); + assert(compareArray(sample, N([42, 2])), "the empty string"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, "0"); - assert(compareArray(sample, [42, 2]), "'0'"); + assert(compareArray(sample, N([42, 2])), "'0'"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, false); - assert(compareArray(sample, [42, 2]), "false"); + assert(compareArray(sample, N([42, 2])), "false"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, 0.1); - assert(compareArray(sample, [42, 2]), "0.1"); + assert(compareArray(sample, N([42, 2])), "0.1"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, 0.9); - assert(compareArray(sample, [42, 2]), "0.9"); + assert(compareArray(sample, N([42, 2])), "0.9"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, -0.5); - assert(compareArray(sample, [42, 2]), "-0.5"); + assert(compareArray(sample, N([42, 2])), "-0.5"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, 1.1); - assert(compareArray(sample, [1, 42]), "1.1"); + assert(compareArray(sample, N([1, 42])), "1.1"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, NaN); - assert(compareArray(sample, [42, 2]), "NaN"); + assert(compareArray(sample, N([42, 2])), "NaN"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, null); - assert(compareArray(sample, [42, 2]), "null"); + assert(compareArray(sample, N([42, 2])), "null"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, undefined); - assert(compareArray(sample, [42, 2]), "undefined"); + assert(compareArray(sample, N([42, 2])), "undefined"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, {}); - assert(compareArray(sample, [42, 2]), "{}"); + assert(compareArray(sample, N([42, 2])), "{}"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, []); - assert(compareArray(sample, [42, 2]), "[]"); + assert(compareArray(sample, N([42, 2])), "[]"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, [0]); - assert(compareArray(sample, [42, 2]), "[0]"); + assert(compareArray(sample, N([42, 2])), "[0]"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, true); - assert(compareArray(sample, [1, 42]), "true"); + assert(compareArray(sample, N([1, 42])), "true"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, "1"); - assert(compareArray(sample, [1, 42]), "'1'"); + assert(compareArray(sample, N([1, 42])), "'1'"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, [1]); - assert(compareArray(sample, [1, 42]), "[1]"); + assert(compareArray(sample, N([1, 42])), "[1]"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, { valueOf: function() {return 1;} }); - assert(compareArray(sample, [1, 42]), "valueOf"); + assert(compareArray(sample, N([1, 42])), "valueOf"); - sample = new TA([1, 2]); + sample = new TA(N([1, 2])); sample.set(src, { toString: function() {return 1;} }); - assert(compareArray(sample, [1, 42]), "toString"); + assert(compareArray(sample, N([1, 42])), "toString"); }); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js index 04ddb52371f3d9e47d82985b3822ce1dc2405434..4f21a918df446ded7add504ab82cc94560ccecbf 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-other-type.js @@ -26,23 +26,26 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var other = TA === Float32Array ? Float64Array : Float32Array; - var src = new other([42, 43]); + if (typeof BigInt !== "undefined") + other = TA === BigInt64Array ? BigUint64Array : + TA === BigUint64Array ? BigInt64Array : other; + var src = new other(N([42, 43])); var sample, result; - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 0); - assert(compareArray(sample, [42, 43, 3, 4]), "offset: 0, result: " + sample); + assert(compareArray(sample, N([42, 43, 3, 4])), "offset: 0, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 1); - assert(compareArray(sample, [1, 42, 43, 4]), "offset: 1, result: " + sample); + assert(compareArray(sample, N([1, 42, 43, 4])), "offset: 1, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 2); - assert(compareArray(sample, [1, 2, 42, 43]), "offset: 2, result: " + sample); + assert(compareArray(sample, N([1, 2, 42, 43])), "offset: 2, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); }); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js index b9157478552159a7130c85727ed837298beab287..4dcde7c092ec3935a405c7f8070569b80bd878ce 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-diff-buffer-same-type.js @@ -29,22 +29,22 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample, result; - var src = new TA([42, 43]); + var src = new TA(N([42, 43])); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 1); - assert(compareArray(sample, [1, 42, 43, 4]), "offset: 1, result: " + sample); + assert(compareArray(sample, N([1, 42, 43, 4])), "offset: 1, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 0); - assert(compareArray(sample, [42, 43, 3, 4]), "offset: 0, result: " + sample); + assert(compareArray(sample, N([42, 43, 3, 4])), "offset: 0, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); result = sample.set(src, 2); - assert(compareArray(sample, [1, 2, 42, 43]), "offset: 2, result: " + sample); + assert(compareArray(sample, N([1, 2, 42, 43])), "offset: 2, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); }); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js index 45d648c1a20dc9e0bd47eea2d241c739f25d870a..9ea3f3ef08d0cdf06c094dd66e4ebf7e68a8b494 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-other-type.js @@ -56,4 +56,4 @@ testWithTypedArrayConstructors(function(TA) { assert(compareArray(sample, expected[TA.name]), sample); assert.sameValue(result, undefined, "returns undefined"); -}); +}, numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js index 02d15ddee9c991797aac0e9bef5d6d799d5787c0..bd3256da6066e8df4aaa64a92a02291be25da12e 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-set-values-same-buffer-same-type.js @@ -30,24 +30,24 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample, src, result; - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); src = new TA(sample.buffer, 0, 2); result = sample.set(src, 0); - assert(compareArray(sample, [1, 2, 3, 4]), "offset: 0, result: " + sample); + assert(compareArray(sample, N([1, 2, 3, 4])), "offset: 0, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); src = new TA(sample.buffer, 0, 2); result = sample.set(src, 1); - assert(compareArray(sample, [1, 1, 2, 4]), "offset: 1, result: " + sample); + assert(compareArray(sample, N([1, 1, 2, 4])), "offset: 1, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); - sample = new TA([1, 2, 3, 4]); + sample = new TA(N([1, 2, 3, 4])); src = new TA(sample.buffer, 0, 2); result = sample.set(src, 2); - assert(compareArray(sample, [1, 2, 1, 2]), "offset: 2, result: " + sample); + assert(compareArray(sample, N([1, 2, 1, 2])), "offset: 2, result: " + sample); assert.sameValue(result, undefined, "returns undefined"); }); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js index 864172b96c0f18173190be0f59ce701a336e2097..0009dae86446e81fc0eb4f862b75cc3e229064a0 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-arraylength-internal.js @@ -28,9 +28,9 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); - var src = new TA([42, 43]); + var src = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(src, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js index c3bfdeb28e9d997cbc94ac27314b09d5c2ef4351..811c2c86a935f332871b5af30a625f3519f8b9f4 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-src-byteoffset-internal.js @@ -25,11 +25,14 @@ var desc = { Object.defineProperty(TypedArray.prototype, "byteOffset", desc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); - var src = new TA([42, 43]); + var src = new TA(N([42, 43])); var differentTA = TA === Uint8Array ? Int8Array : Uint8Array; - var src2 = new differentTA([42, 43]); + if (typeof BigInt !== "undefined") + differentTA = TA === BigInt64Array ? BigUint64Array : + TA === BigUint64Array ? BigInt64Array : differentTA; + var src2 = new differentTA(N([42, 43])); var src3 = new differentTA(sample.buffer, 0, 2); Object.defineProperty(TA.prototype, "byteOffset", desc); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js index fe251f1f17acaaaf8e54b2c4ba3a2db910816da0..df8f068598979037faf443a6069edc87f1def0f4 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-arraylength-internal.js @@ -29,9 +29,9 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); - var src = new TA([42, 43]); + var src = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js b/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js index 9e2802617a21b9cf5308136f782931e0f904aa10..29dd574df85f6ffd1ecb25f33599460a95945315 100644 --- a/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js +++ b/test/built-ins/TypedArray/prototype/set/typedarray-arg-target-byteoffset-internal.js @@ -26,11 +26,14 @@ var desc = { Object.defineProperty(TypedArray.prototype, "byteOffset", desc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); - var src = new TA([42, 43]); + var src = new TA(N([42, 43])); var differentTA = TA === Uint8Array ? Int8Array : Uint8Array; - var src2 = new differentTA([42, 43]); + if (typeof BigInt !== "undefined") + differentTA = TA === BigInt64Array ? BigUint64Array : + TA === BigUint64Array ? BigInt64Array : differentTA; + var src2 = new differentTA(N([42, 43])); var src3 = new differentTA(sample.buffer, 0, 2); Object.defineProperty(TA.prototype, "byteOffset", desc); diff --git a/test/built-ins/TypedArray/prototype/slice/arraylength-internal.js b/test/built-ins/TypedArray/prototype/slice/arraylength-internal.js index 2c9e7cba303a2d752ad60778d5b35ffaf8508d13..8cf70558311b42c04470cf8e4622670bda36f4c2 100644 --- a/test/built-ins/TypedArray/prototype/slice/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/slice/arraylength-internal.js @@ -23,8 +23,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); @@ -32,7 +32,7 @@ testWithTypedArrayConstructors(function(TA) { var result = sample.slice(); assert.sameValue(getCalls, 0, "ignores length properties"); - assert.sameValue(result[0], 42); - assert.sameValue(result[1], 43); + assert.sameValue(result[0], N(42)); + assert.sameValue(result[1], N(43)); assert.sameValue(result.hasOwnProperty(2), false); }); diff --git a/test/built-ins/TypedArray/prototype/slice/infinity.js b/test/built-ins/TypedArray/prototype/slice/infinity.js index a93cd713a720e44c43b7e05bae058a2c61bedaea..7fda1ec897d252c21e9cac493448365e2958bfc2 100644 --- a/test/built-ins/TypedArray/prototype/slice/infinity.js +++ b/test/built-ins/TypedArray/prototype/slice/infinity.js @@ -7,11 +7,11 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert( - compareArray(sample.slice(-Infinity), [40, 41, 42, 43]), + compareArray(sample.slice(-Infinity), N([40, 41, 42, 43])), "start == -Infinity" ); assert( @@ -23,7 +23,7 @@ testWithTypedArrayConstructors(function(TA) { "end == -Infinity" ); assert( - compareArray(sample.slice(0, Infinity), [40, 41, 42, 43]), + compareArray(sample.slice(0, Infinity), N([40, 41, 42, 43])), "end == Infinity" ); }); diff --git a/test/built-ins/TypedArray/prototype/slice/minus-zero.js b/test/built-ins/TypedArray/prototype/slice/minus-zero.js index c597dadec9b749f1739cebf6f8b5635c809c4b18..b4c000bc0dfec420effc8cba734d48c0a6d2ce16 100644 --- a/test/built-ins/TypedArray/prototype/slice/minus-zero.js +++ b/test/built-ins/TypedArray/prototype/slice/minus-zero.js @@ -9,15 +9,15 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert( - compareArray(sample.slice(-0), [40, 41, 42, 43]), + compareArray(sample.slice(-0), N([40, 41, 42, 43])), "start == -0" ); assert( - compareArray(sample.slice(-0, 4), [40, 41, 42, 43]), + compareArray(sample.slice(-0, 4), N([40, 41, 42, 43])), "start == -0, end == length" ); assert( diff --git a/test/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js b/test/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js index 91df72a334d421ebc14392bb8c2ea27fa42302a7..ca2b9d8e9aeb7b761f9ba3307c57e1e53496a391 100644 --- a/test/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js +++ b/test/built-ins/TypedArray/prototype/slice/result-does-not-copy-ordinary-properties.js @@ -9,8 +9,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([41, 42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([41, 42, 43, 44])); sample.foo = 42; var result = sample.slice(); diff --git a/test/built-ins/TypedArray/prototype/slice/results-with-different-length.js b/test/built-ins/TypedArray/prototype/slice/results-with-different-length.js index 34a4ad11b3e1cfa540087a0b05fc4a6282347b5e..b6a62afb8fbf503441190c77af809db519ae9fc4 100644 --- a/test/built-ins/TypedArray/prototype/slice/results-with-different-length.js +++ b/test/built-ins/TypedArray/prototype/slice/results-with-different-length.js @@ -7,47 +7,47 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, expected, msg) { assert(compareArray(result, expected), msg + ", result: [" + result + "]"); } - testRes(sample.slice(1), [41, 42, 43], "begin == 1"); - testRes(sample.slice(2), [42, 43], "begin == 2"); - testRes(sample.slice(3), [43], "begin == 3"); + testRes(sample.slice(1), N([41, 42, 43]), "begin == 1"); + testRes(sample.slice(2), N([42, 43]), "begin == 2"); + testRes(sample.slice(3), N([43]), "begin == 3"); - testRes(sample.slice(1, 4), [41, 42, 43], "begin == 1, end == length"); - testRes(sample.slice(2, 4), [42, 43], "begin == 2, end == length"); - testRes(sample.slice(3, 4), [43], "begin == 3, end == length"); + testRes(sample.slice(1, 4), N([41, 42, 43]), "begin == 1, end == length"); + testRes(sample.slice(2, 4), N([42, 43]), "begin == 2, end == length"); + testRes(sample.slice(3, 4), N([43]), "begin == 3, end == length"); - testRes(sample.slice(0, 1), [40], "begin == 0, end == 1"); - testRes(sample.slice(0, 2), [40, 41], "begin == 0, end == 2"); - testRes(sample.slice(0, 3), [40, 41, 42], "begin == 0, end == 3"); + testRes(sample.slice(0, 1), N([40]), "begin == 0, end == 1"); + testRes(sample.slice(0, 2), N([40, 41]), "begin == 0, end == 2"); + testRes(sample.slice(0, 3), N([40, 41, 42]), "begin == 0, end == 3"); - testRes(sample.slice(-1), [43], "begin == -1"); - testRes(sample.slice(-2), [42, 43], "begin == -2"); - testRes(sample.slice(-3), [41, 42, 43], "begin == -3"); + testRes(sample.slice(-1), N([43]), "begin == -1"); + testRes(sample.slice(-2), N([42, 43]), "begin == -2"); + testRes(sample.slice(-3), N([41, 42, 43]), "begin == -3"); - testRes(sample.slice(-1, 4), [43], "begin == -1, end == length"); - testRes(sample.slice(-2, 4), [42, 43], "begin == -2, end == length"); - testRes(sample.slice(-3, 4), [41, 42, 43], "begin == -3, end == length"); + testRes(sample.slice(-1, 4), N([43]), "begin == -1, end == length"); + testRes(sample.slice(-2, 4), N([42, 43]), "begin == -2, end == length"); + testRes(sample.slice(-3, 4), N([41, 42, 43]), "begin == -3, end == length"); - testRes(sample.slice(0, -1), [40, 41, 42], "begin == 0, end == -1"); - testRes(sample.slice(0, -2), [40, 41], "begin == 0, end == -2"); - testRes(sample.slice(0, -3), [40], "begin == 0, end == -3"); + testRes(sample.slice(0, -1), N([40, 41, 42]), "begin == 0, end == -1"); + testRes(sample.slice(0, -2), N([40, 41]), "begin == 0, end == -2"); + testRes(sample.slice(0, -3), N([40]), "begin == 0, end == -3"); - testRes(sample.slice(-0, -1), [40, 41, 42], "begin == -0, end == -1"); - testRes(sample.slice(-0, -2), [40, 41], "begin == -0, end == -2"); - testRes(sample.slice(-0, -3), [40], "begin == -0, end == -3"); + testRes(sample.slice(-0, -1), N([40, 41, 42]), "begin == -0, end == -1"); + testRes(sample.slice(-0, -2), N([40, 41]), "begin == -0, end == -2"); + testRes(sample.slice(-0, -3), N([40]), "begin == -0, end == -3"); - testRes(sample.slice(-2, -1), [42], "length == 4, begin == -2, end == -1"); - testRes(sample.slice(1, -1), [41, 42], "length == 4, begin == 1, end == -1"); - testRes(sample.slice(1, -2), [41], "length == 4, begin == 1, end == -2"); - testRes(sample.slice(2, -1), [42], "length == 4, begin == 2, end == -1"); + testRes(sample.slice(-2, -1), N([42]), "length == 4, begin == -2, end == -1"); + testRes(sample.slice(1, -1), N([41, 42]), "length == 4, begin == 1, end == -1"); + testRes(sample.slice(1, -2), N([41]), "length == 4, begin == 1, end == -2"); + testRes(sample.slice(2, -1), N([42]), "length == 4, begin == 2, end == -1"); - testRes(sample.slice(-1, 5), [43], "begin == -1, end > length"); - testRes(sample.slice(-2, 4), [42, 43], "begin == -2, end > length"); - testRes(sample.slice(-3, 4), [41, 42, 43], "begin == -3, end > length"); + testRes(sample.slice(-1, 5), N([43]), "begin == -1, end > length"); + testRes(sample.slice(-2, 4), N([42, 43]), "begin == -2, end > length"); + testRes(sample.slice(-3, 4), N([41, 42, 43]), "begin == -3, end > length"); }); diff --git a/test/built-ins/TypedArray/prototype/slice/results-with-empty-length.js b/test/built-ins/TypedArray/prototype/slice/results-with-empty-length.js index 7cd44b9c60b37a32d1e33c4d6a5790943e5df03d..a3c7490570ec9f20d7bc8854c98495ac16dbc380 100644 --- a/test/built-ins/TypedArray/prototype/slice/results-with-empty-length.js +++ b/test/built-ins/TypedArray/prototype/slice/results-with-empty-length.js @@ -7,8 +7,8 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, msg) { assert.sameValue(result.length, 0, msg); diff --git a/test/built-ins/TypedArray/prototype/slice/results-with-same-length.js b/test/built-ins/TypedArray/prototype/slice/results-with-same-length.js index d89cbbdf513e0bb9971627faa3c0c1c3edae9c5e..904efd50b4f4ba6b21d4b08e69af45fb48d3d6cc 100644 --- a/test/built-ins/TypedArray/prototype/slice/results-with-same-length.js +++ b/test/built-ins/TypedArray/prototype/slice/results-with-same-length.js @@ -7,15 +7,15 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, msg) { assert.sameValue(result.length, 4, msg); - assert.sameValue(result[0], 40, msg + " & result[0] === 40"); - assert.sameValue(result[1], 41, msg + " & result[1] === 41"); - assert.sameValue(result[2], 42, msg + " & result[2] === 42"); - assert.sameValue(result[3], 43, msg + " & result[3] === 43"); + assert.sameValue(result[0], N(40), msg + " & result[0] === 40"); + assert.sameValue(result[1], N(41), msg + " & result[1] === 41"); + assert.sameValue(result[2], N(42), msg + " & result[2] === 42"); + assert.sameValue(result[3], N(43), msg + " & result[3] === 43"); } testRes(sample.slice(0), "begin == 0"); diff --git a/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js b/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js index cb19d311d2c74b056ef5d3e0887afa867bf58666..89f322ce07d23b02e0f6bdb9ffb86bc77892fc04 100644 --- a/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js +++ b/test/built-ins/TypedArray/prototype/slice/set-values-from-different-ctor-type.js @@ -32,16 +32,19 @@ features: [Symbol.species, TypedArray] var arr = [42, 43, 44]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); var other = TA === Int8Array ? Uint8Array : Int8Array; + if (typeof BigInt !== "undefined") { + other = TA === BigInt64Array ? BigUint64Array : + TA === BigUint64Array ? BigInt64Array : other; sample.constructor = {}; sample.constructor[Symbol.species] = other; var result = sample.slice(); - assert(compareArray(result, arr), "values are set"); + assert(compareArray(result, N(arr)), "values are set"); assert.notSameValue(result.buffer, sample.buffer, "creates a new buffer"); assert.sameValue(result.constructor, other, "used the custom ctor"); }); diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js index d7baa426e32f77bd392a75e878e284d39aae48ee..d0f2d147b6d6e3ec186edcee4e48214cd38fa3ed 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-abrupt.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); Object.defineProperty(sample, "constructor", { get: function() { diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js index 79c9df2a7725aa5afcfe6c340c899cfedec8c36d..d2d7667a974baa2d7921f8f96df56772ab2135b6 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-inherited.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js index c048632f26bc8222db03687eaf46b4490efe448a..9910c9b4e42d92710ca6cf774b3a3a42f8616e2b 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor-returns-throws.js @@ -28,8 +28,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); sample.constructor = 42; assert.throws(TypeError, function() { diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js index c09681ec05244d4417427f1aec63ac7e7c382d3a..ca237fb6d488f1cf6f757059e6c7ecb942258c6b 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-ctor.js @@ -26,8 +26,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js index d1642f1b77466ffd8ebebcd316d9fe193221e96a..15acea7c628a6c26b5ad9723aa8f3b665bd0a9fc 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-invocation.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var result, ctorThis; sample.constructor = {}; diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js index 7bb19f5df4aa15afa5dd3748808ec9e7ca667f65..6b95f571b248c7c488093dbdcfe4fb6d06fafe45 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40])); var other = new Int8Array([1, 0, 1]); var result; diff --git a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js index 0477a0fd43bdaa5a28e16360c61a83a9472ffa8a..5a5151e720c7faeeeb73c0fcc5f7734a7775ffbb 100644 --- a/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js +++ b/test/built-ins/TypedArray/prototype/slice/speciesctor-get-species-custom-ctor.js @@ -36,8 +36,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var calls = 0; var result; @@ -50,5 +50,5 @@ testWithTypedArrayConstructors(function(TA) { result = sample.slice(1); assert.sameValue(calls, 1, "ctor called once"); - assert(compareArray(result, [41, 42]), "expected object"); + assert(compareArray(result, N([41, 42])), "expected object"); }); diff --git a/test/built-ins/TypedArray/prototype/slice/tointeger-end.js b/test/built-ins/TypedArray/prototype/slice/tointeger-end.js index 2a9be9406805edc31cf72a24504513cbe3e57e07..df15d831c1ff011e834df6bbc96a163d23ee8802 100644 --- a/test/built-ins/TypedArray/prototype/slice/tointeger-end.js +++ b/test/built-ins/TypedArray/prototype/slice/tointeger-end.js @@ -20,28 +20,28 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert(compareArray(sample.slice(0, false), []), "false"); - assert(compareArray(sample.slice(0, true), [40]), "true"); + assert(compareArray(sample.slice(0, true), N([40])), "true"); assert(compareArray(sample.slice(0, NaN), []), "NaN"); assert(compareArray(sample.slice(0, null), []), "null"); - assert(compareArray(sample.slice(0, undefined), [40, 41, 42, 43]), "undefined"); + assert(compareArray(sample.slice(0, undefined), N([40, 41, 42, 43])), "undefined"); assert(compareArray(sample.slice(0, 0.6), []), "0.6"); - assert(compareArray(sample.slice(0, 1.1), [40]), "1.1"); - assert(compareArray(sample.slice(0, 1.5), [40]), "1.5"); + assert(compareArray(sample.slice(0, 1.1), N([40])), "1.1"); + assert(compareArray(sample.slice(0, 1.5), N([40])), "1.5"); assert(compareArray(sample.slice(0, -0.6), []), "-0.6"); - assert(compareArray(sample.slice(0, -1.1), [40, 41, 42]), "-1.1"); - assert(compareArray(sample.slice(0, -1.5), [40, 41, 42]), "-1.5"); + assert(compareArray(sample.slice(0, -1.1), N([40, 41, 42])), "-1.1"); + assert(compareArray(sample.slice(0, -1.5), N([40, 41, 42])), "-1.5"); - assert(compareArray(sample.slice(0, "3"), [40, 41, 42]), "string"); + assert(compareArray(sample.slice(0, "3"), N([40, 41, 42])), "string"); assert( compareArray( sample.slice(0, obj), - [40, 41] + N([40, 41]) ), "object" ); diff --git a/test/built-ins/TypedArray/prototype/slice/tointeger-start.js b/test/built-ins/TypedArray/prototype/slice/tointeger-start.js index f67ee090c083e320e8638fce8fd4aa0c708e8ae0..353ac46e2021d572ad99b3e6ccceea52c1de1bd4 100644 --- a/test/built-ins/TypedArray/prototype/slice/tointeger-start.js +++ b/test/built-ins/TypedArray/prototype/slice/tointeger-start.js @@ -19,29 +19,29 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); - assert(compareArray(sample.slice(false), [40, 41, 42, 43]), "false"); - assert(compareArray(sample.slice(true), [41, 42, 43]), "true"); + assert(compareArray(sample.slice(false), N([40, 41, 42, 43])), "false"); + assert(compareArray(sample.slice(true), N([41, 42, 43])), "true"); - assert(compareArray(sample.slice(NaN), [40, 41, 42, 43]), "NaN"); - assert(compareArray(sample.slice(null), [40, 41, 42, 43]), "null"); - assert(compareArray(sample.slice(undefined), [40, 41, 42, 43]), "undefined"); + assert(compareArray(sample.slice(NaN), N([40, 41, 42, 43])), "NaN"); + assert(compareArray(sample.slice(null), N([40, 41, 42, 43])), "null"); + assert(compareArray(sample.slice(undefined), N([40, 41, 42, 43])), "undefined"); - assert(compareArray(sample.slice(1.1), [41, 42, 43]), "1.1"); - assert(compareArray(sample.slice(1.5), [41, 42, 43]), "1.5"); - assert(compareArray(sample.slice(0.6), [40, 41, 42, 43]), "0.6"); + assert(compareArray(sample.slice(1.1), N([41, 42, 43])), "1.1"); + assert(compareArray(sample.slice(1.5), N([41, 42, 43])), "1.5"); + assert(compareArray(sample.slice(0.6), N([40, 41, 42, 43])), "0.6"); - assert(compareArray(sample.slice(-1.5), [43]), "-1.5"); - assert(compareArray(sample.slice(-1.1), [43]), "-1.1"); - assert(compareArray(sample.slice(-0.6), [40, 41, 42, 43]), "-0.6"); + assert(compareArray(sample.slice(-1.5), N([43])), "-1.5"); + assert(compareArray(sample.slice(-1.1), N([43])), "-1.1"); + assert(compareArray(sample.slice(-0.6), N([40, 41, 42, 43])), "-0.6"); - assert(compareArray(sample.slice("3"), [43]), "string"); + assert(compareArray(sample.slice("3"), N([43])), "string"); assert( compareArray( sample.slice(obj), - [42, 43] + N([42, 43]) ), "object" ); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js b/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js index 57fbcf3f58f8427d49e87b3f19bfa63dff9e86b9..cb579688af5cd0e0c569e028c2a2c264ed4cea32 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-with-thisarg.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; var thisArg = ["test262", 0, "ecma262", 0]; @@ -41,17 +41,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(thisArg.length, 4, "thisArg.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js b/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js index fff82e93b87f4c1deabed30bed7c36cd527c83c6..44d890c4d4bf4f631e66af9f4ae865ab48dc0c7f 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-arguments-without-thisarg.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var results = []; @@ -39,17 +39,17 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results.length, 3, "results.length"); assert.sameValue(results[0].length, 3, "results[0].length"); - assert.sameValue(results[0][0], 42, "results[0][0] - kValue"); + assert.sameValue(results[0][0], N(42), "results[0][0] - kValue"); assert.sameValue(results[0][1], 0, "results[0][1] - k"); assert.sameValue(results[0][2], sample, "results[0][2] - this"); assert.sameValue(results[1].length, 3, "results[1].length"); - assert.sameValue(results[1][0], 43, "results[1][0] - kValue"); + assert.sameValue(results[1][0], N(43), "results[1][0] - kValue"); assert.sameValue(results[1][1], 1, "results[1][1] - k"); assert.sameValue(results[1][2], sample, "results[1][2] - this"); assert.sameValue(results[2].length, 3, "results[2].length"); - assert.sameValue(results[2][0], 44, "results[2][0] - kValue"); + assert.sameValue(results[2][0], N(44), "results[2][0] - kValue"); assert.sameValue(results[2][1], 2, "results[2][1] - k"); assert.sameValue(results[2][2], sample, "results[2][2] - this"); }); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js b/test/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js index d7a55a444b40d8136c4de4014b664632dd8e1fe7..f28e0d90789349d0fa66b95d7ba92ade3b9a35dd 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-no-interaction-over-non-integer.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([7, 8]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([7, 8])); var results = []; @@ -35,6 +35,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(results[0][1], 0, "results[0][1] - key"); assert.sameValue(results[1][1], 1, "results[1][1] - key"); - assert.sameValue(results[0][0], 7, "results[0][0] - value"); - assert.sameValue(results[1][0], 8, "results[1][0] - value"); + assert.sameValue(results[0][0], N(7), "results[0][0] - value"); + assert.sameValue(results[1][0], N(8), "results[1][0] - value"); }); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js b/test/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js index ddfedf5af9cce4849ba12e56a1ab675cefce2dd3..e7df5442d88f44c12f79858082fa7c00f95a63c3 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-return-does-not-change-instance.js @@ -25,14 +25,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); sample.some(function() { return 0; }); - assert.sameValue(sample[0], 40, "[0] == 40"); - assert.sameValue(sample[1], 41, "[1] == 41"); - assert.sameValue(sample[2], 42, "[2] == 42"); + assert.sameValue(sample[0], N(40), "[0] == 40"); + assert.sameValue(sample[1], N(41), "[1] == 41"); + assert.sameValue(sample[2], N(42), "[2] == 42"); }); diff --git a/test/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js b/test/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js index da68b8a16cf54a25e6e9d6c7637cd60bcf9f9e9b..c779dbb049bae2fd822a664b430085f25c941602 100644 --- a/test/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js +++ b/test/built-ins/TypedArray/prototype/some/callbackfn-set-value-during-interaction.js @@ -25,24 +25,24 @@ includes: [testTypedArray.js] features: [Reflect.set, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); var newVal = 0; sample.some(function(val, i) { if (i > 0) { assert.sameValue( - sample[i - 1], newVal - 1, + sample[i - 1], N(newVal - 1), "get the changed value during the loop" ); assert.sameValue( - Reflect.set(sample, 0, 7), + Reflect.set(sample, 0, N(7)), true, "re-set a value for sample[0]" ); } assert.sameValue( - Reflect.set(sample, i, newVal), + Reflect.set(sample, i, N(newVal)), true, "set value during iteration" ); @@ -50,7 +50,7 @@ testWithTypedArrayConstructors(function(TA) { newVal++; }); - assert.sameValue(sample[0], 7, "changed values after iteration [0] == 7"); - assert.sameValue(sample[1], 1, "changed values after iteration [1] == 1"); - assert.sameValue(sample[2], 2, "changed values after iteration [2] == 2"); + assert.sameValue(sample[0], N(7), "changed values after iteration [0] == 7"); + assert.sameValue(sample[1], N(1), "changed values after iteration [1] == 1"); + assert.sameValue(sample[2], N(2), "changed values after iteration [2] == 2"); }); diff --git a/test/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js index 3fd958a92c55af8536015c04c251eded30f8657c..14c21cab27f14c33018f130cc288dacba8aae3a7 100644 --- a/test/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/some/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var calls = 0; Object.defineProperty(TA.prototype, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/some/values-are-not-cached.js b/test/built-ins/TypedArray/prototype/some/values-are-not-cached.js index c8a3c2cdeae6ad49a9378b74e8cfcb3a8f89902b..12fc43d9c9b655fffc2378b56af0beda4e07636f 100644 --- a/test/built-ins/TypedArray/prototype/some/values-are-not-cached.js +++ b/test/built-ins/TypedArray/prototype/some/values-are-not-cached.js @@ -25,16 +25,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44])); sample.some(function(v, i) { if (i < sample.length - 1) { - sample[i+1] = 42; + sample[i+1] = N(42); } assert.sameValue( - v, 42, "method does not cache values before callbackfn calls" + v, N(42), "method does not cache values before callbackfn calls" ); }); }); diff --git a/test/built-ins/TypedArray/prototype/sort/arraylength-internal.js b/test/built-ins/TypedArray/prototype/sort/arraylength-internal.js index 543c4eaa6f080d83b7abcfe6ed355cff1bffb2f7..833ed4cd1784ecdf7443c833367b93c0240e4007 100644 --- a/test/built-ins/TypedArray/prototype/sort/arraylength-internal.js +++ b/test/built-ins/TypedArray/prototype/sort/arraylength-internal.js @@ -22,8 +22,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 42, 42])); getCalls = 0; Object.defineProperty(TA.prototype, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js b/test/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js index 3370975d0e4ac9e49a857e8aa53d34e6ef9b645c..6754d85232c76d23947670d942bdbf72902e210e 100644 --- a/test/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js +++ b/test/built-ins/TypedArray/prototype/sort/comparefn-call-throws.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44, 45, 46]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44, 45, 46])); var calls = 0; var comparefn = function() { diff --git a/test/built-ins/TypedArray/prototype/sort/comparefn-calls.js b/test/built-ins/TypedArray/prototype/sort/comparefn-calls.js index 6c060218291b7b2212ba918c98f229f8ac4237fe..52ba9cce2a80aad774e1f3a19d2a0b8ff1d40a76 100644 --- a/test/built-ins/TypedArray/prototype/sort/comparefn-calls.js +++ b/test/built-ins/TypedArray/prototype/sort/comparefn-calls.js @@ -22,8 +22,8 @@ var expectedThis = (function() { return this; })(); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 42, 42, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 42, 42, 42, 42])); var calls = []; var comparefn = function() { @@ -36,7 +36,7 @@ testWithTypedArrayConstructors(function(TA) { calls.forEach(function(args) { assert.sameValue(args[0], expectedThis, "comparefn is called no specific this"); assert.sameValue(args[1].length, 2, "comparefn is always called with 2 args"); - assert.sameValue(args[1][0], 42, "x is a listed value"); - assert.sameValue(args[1][0], 42, "y is a listed value"); + assert.sameValue(args[1][0], N(42), "x is a listed value"); + assert.sameValue(args[1][0], N(42), "y is a listed value"); }); }); diff --git a/test/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js b/test/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js index dceb36d66bc2f0607cca3fcf9b2e35cbb40dd278..a2e5cf0ef45b0c24f38228430314d83d0c707c39 100644 --- a/test/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js +++ b/test/built-ins/TypedArray/prototype/sort/comparefn-nonfunction-call-throws.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43, 44, 45, 46]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43, 44, 45, 46])); assert.throws(TypeError, function() { sample.sort(null); diff --git a/test/built-ins/TypedArray/prototype/sort/return-same-instance.js b/test/built-ins/TypedArray/prototype/sort/return-same-instance.js index f9588508025644748e9d38e72779f0c953399b3b..e45ad5eafdf0d2b151dd43a18e47d4d71f50f813 100644 --- a/test/built-ins/TypedArray/prototype/sort/return-same-instance.js +++ b/test/built-ins/TypedArray/prototype/sort/return-same-instance.js @@ -14,8 +14,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([2, 1]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([2, 1])); var result = sample.sort(); assert.sameValue(sample, result, "without comparefn"); diff --git a/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js b/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js index f3bb0cac038ce31b8c9f84d705bbc3097e4c344c..ec42fb0691f3ec48ee40bbb58bd2df66d951b13f 100644 --- a/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js +++ b/test/built-ins/TypedArray/prototype/sort/sortcompare-with-no-tostring.js @@ -20,8 +20,8 @@ features: [TypedArray] var origToString = Number.prototype.toString; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([20, 100, 3]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([20, 100, 3])); var result = sample.sort(); - assert(compareArray(result, [3, 20, 100])); + assert(compareArray(result, N([3, 20, 100]))); }); diff --git a/test/built-ins/TypedArray/prototype/sort/sorted-values.js b/test/built-ins/TypedArray/prototype/sort/sorted-values.js index 83d870e9ee02871580add07976a8915ffadce628..ad35153506957c78a6fbc25e235ca49be30da3eb 100644 --- a/test/built-ins/TypedArray/prototype/sort/sorted-values.js +++ b/test/built-ins/TypedArray/prototype/sort/sorted-values.js @@ -14,20 +14,20 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample; - sample = new TA([4, 3, 2, 1]).sort(); - assert(compareArray(sample, [1, 2, 3, 4]), "descending values"); + sample = new TA(N([4, 3, 2, 1])).sort(); + assert(compareArray(sample, N([1, 2, 3, 4])), "descending values"); - sample = new TA([3, 4, 1, 2]).sort(); - assert(compareArray(sample, [1, 2, 3, 4]), "mixed numbers"); + sample = new TA(N([3, 4, 1, 2])).sort(); + assert(compareArray(sample, N([1, 2, 3, 4])), "mixed numbers"); - sample = new TA([3, 4, 3, 1, 0, 1, 2]).sort(); - assert(compareArray(sample, [0, 1, 1, 2, 3, 3, 4]), "repeating numbers"); + sample = new TA(N([3, 4, 3, 1, 0, 1, 2])).sort(); + assert(compareArray(sample, N([0, 1, 1, 2, 3, 3, 4])), "repeating numbers"); - sample = new TA([1, 0, -0, 2]).sort(); - assert(compareArray(sample, [0, 0, 1, 2]), "0s"); + sample = new TA(N([1, 0, -0, 2])).sort(); + assert(compareArray(sample, N([0, 0, 1, 2])), "0s"); }); testWithTypedArrayConstructors(function(TA) { diff --git a/test/built-ins/TypedArray/prototype/subarray/infinity.js b/test/built-ins/TypedArray/prototype/subarray/infinity.js index 8a27464925da8a76a6ce22cfb3cf6b232bf67b8d..df67a42c17ea29b4845d3147fb3b2bdfa7afa550 100644 --- a/test/built-ins/TypedArray/prototype/subarray/infinity.js +++ b/test/built-ins/TypedArray/prototype/subarray/infinity.js @@ -9,11 +9,11 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert( - compareArray(sample.subarray(-Infinity), [40, 41, 42, 43]), + compareArray(sample.subarray(-Infinity), N([40, 41, 42, 43])), "begin == -Infinity" ); assert( @@ -25,7 +25,7 @@ testWithTypedArrayConstructors(function(TA) { "end == -Infinity" ); assert( - compareArray(sample.subarray(0, Infinity), [40, 41, 42, 43]), + compareArray(sample.subarray(0, Infinity), N([40, 41, 42, 43])), "end == Infinity" ); }); diff --git a/test/built-ins/TypedArray/prototype/subarray/minus-zero.js b/test/built-ins/TypedArray/prototype/subarray/minus-zero.js index de714ad4698fc2afd47d6eecda10baf2a15b5b44..def5ab0359edb2db6f228a045a88bcde6bd7d3dc 100644 --- a/test/built-ins/TypedArray/prototype/subarray/minus-zero.js +++ b/test/built-ins/TypedArray/prototype/subarray/minus-zero.js @@ -9,15 +9,15 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert( - compareArray(sample.subarray(-0), [40, 41, 42, 43]), + compareArray(sample.subarray(-0), N([40, 41, 42, 43])), "begin == -0" ); assert( - compareArray(sample.subarray(-0, 4), [40, 41, 42, 43]), + compareArray(sample.subarray(-0, 4), N([40, 41, 42, 43])), "being == -0, end == length" ); assert( diff --git a/test/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js b/test/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js index c8e9e0d6cee2ddd9ffafe114aea0c6c4dfc52600..f08f99d505a260fb92d1cb09ddca03f25da1c2d4 100644 --- a/test/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js +++ b/test/built-ins/TypedArray/prototype/subarray/result-does-not-copy-ordinary-properties.js @@ -12,8 +12,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([41, 42, 43, 44]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([41, 42, 43, 44])); var result; sample.foo = 42; diff --git a/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js b/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js index a507518bb751d8550762b8d911f94894942bd955..f995d6a5f232e38358870ac33bf26fd99059342e 100644 --- a/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js +++ b/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-from-same-ctor.js @@ -12,8 +12,8 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var result = sample.subarray(1); assert.sameValue( @@ -25,7 +25,7 @@ testWithTypedArrayConstructors(function(TA) { assert(result instanceof TA, "instanceof"); assert( - compareArray(sample, [40, 41, 42, 43]), + compareArray(sample, N([40, 41, 42, 43])), "original sample remains the same" ); }); diff --git a/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js b/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js index ff3925eb632d9690df768b6868464e073e7e9ee2..704a2feb3cd87b9bdd553d994443d3deb2c13e5b 100644 --- a/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js +++ b/test/built-ins/TypedArray/prototype/subarray/result-is-new-instance-with-shared-buffer.js @@ -12,8 +12,8 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var buffer = sample.buffer; var result = sample.subarray(1); @@ -21,15 +21,15 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(result.buffer, sample.buffer, "shared buffer"); assert.sameValue(sample.buffer, buffer, "original buffer is preserved"); - sample[1] = 100; + sample[1] = N(100); assert( - compareArray(result, [100, 42, 43]), + compareArray(result, N([100, 42, 43])), "changes on the original sample values affect the new instance" ); - result[1] = 111; + result[1] = N(111); assert( - compareArray(sample, [40, 100, 111, 43]), + compareArray(sample, N([40, 100, 111, 43])), "changes on the new instance values affect the original sample" ); }); diff --git a/test/built-ins/TypedArray/prototype/subarray/results-with-different-length.js b/test/built-ins/TypedArray/prototype/subarray/results-with-different-length.js index c206e2462ba95049d1e47d633edfe6db7b639732..89c9846eaf6ee95843d3f50440680e48221b536b 100644 --- a/test/built-ins/TypedArray/prototype/subarray/results-with-different-length.js +++ b/test/built-ins/TypedArray/prototype/subarray/results-with-different-length.js @@ -12,47 +12,47 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, expected, msg) { assert(compareArray(result, expected), msg + ", result: [" + result + "]"); } - testRes(sample.subarray(1), [41, 42, 43], "begin == 1"); - testRes(sample.subarray(2), [42, 43], "begin == 2"); - testRes(sample.subarray(3), [43], "begin == 3"); + testRes(sample.subarray(1), N([41, 42, 43]), "begin == 1"); + testRes(sample.subarray(2), N([42, 43]), "begin == 2"); + testRes(sample.subarray(3), N([43]), "begin == 3"); - testRes(sample.subarray(1, 4), [41, 42, 43], "begin == 1, end == length"); - testRes(sample.subarray(2, 4), [42, 43], "begin == 2, end == length"); - testRes(sample.subarray(3, 4), [43], "begin == 3, end == length"); + testRes(sample.subarray(1, 4), N([41, 42, 43]), "begin == 1, end == length"); + testRes(sample.subarray(2, 4), N([42, 43]), "begin == 2, end == length"); + testRes(sample.subarray(3, 4), N([43]), "begin == 3, end == length"); - testRes(sample.subarray(0, 1), [40], "begin == 0, end == 1"); - testRes(sample.subarray(0, 2), [40, 41], "begin == 0, end == 2"); - testRes(sample.subarray(0, 3), [40, 41, 42], "begin == 0, end == 3"); + testRes(sample.subarray(0, 1), N([40]), "begin == 0, end == 1"); + testRes(sample.subarray(0, 2), N([40, 41]), "begin == 0, end == 2"); + testRes(sample.subarray(0, 3), N([40, 41, 42]), "begin == 0, end == 3"); - testRes(sample.subarray(-1), [43], "begin == -1"); - testRes(sample.subarray(-2), [42, 43], "begin == -2"); - testRes(sample.subarray(-3), [41, 42, 43], "begin == -3"); + testRes(sample.subarray(-1), N([43]), "begin == -1"); + testRes(sample.subarray(-2), N([42, 43]), "begin == -2"); + testRes(sample.subarray(-3), N([41, 42, 43]), "begin == -3"); - testRes(sample.subarray(-1, 4), [43], "begin == -1, end == length"); - testRes(sample.subarray(-2, 4), [42, 43], "begin == -2, end == length"); - testRes(sample.subarray(-3, 4), [41, 42, 43], "begin == -3, end == length"); + testRes(sample.subarray(-1, 4), N([43]), "begin == -1, end == length"); + testRes(sample.subarray(-2, 4), N([42, 43]), "begin == -2, end == length"); + testRes(sample.subarray(-3, 4), N([41, 42, 43]), "begin == -3, end == length"); - testRes(sample.subarray(0, -1), [40, 41, 42], "begin == 0, end == -1"); - testRes(sample.subarray(0, -2), [40, 41], "begin == 0, end == -2"); - testRes(sample.subarray(0, -3), [40], "begin == 0, end == -3"); + testRes(sample.subarray(0, -1), N([40, 41, 42]), "begin == 0, end == -1"); + testRes(sample.subarray(0, -2), N([40, 41]), "begin == 0, end == -2"); + testRes(sample.subarray(0, -3), N([40]), "begin == 0, end == -3"); - testRes(sample.subarray(-0, -1), [40, 41, 42], "begin == -0, end == -1"); - testRes(sample.subarray(-0, -2), [40, 41], "begin == -0, end == -2"); - testRes(sample.subarray(-0, -3), [40], "begin == -0, end == -3"); + testRes(sample.subarray(-0, -1), N([40, 41, 42]), "begin == -0, end == -1"); + testRes(sample.subarray(-0, -2), N([40, 41]), "begin == -0, end == -2"); + testRes(sample.subarray(-0, -3), N([40]), "begin == -0, end == -3"); - testRes(sample.subarray(-2, -1), [42], "length == 4, begin == -2, end == -1"); - testRes(sample.subarray(1, -1), [41, 42], "length == 4, begin == 1, end == -1"); - testRes(sample.subarray(1, -2), [41], "length == 4, begin == 1, end == -2"); - testRes(sample.subarray(2, -1), [42], "length == 4, begin == 2, end == -1"); + testRes(sample.subarray(-2, -1), N([42]), "length == 4, begin == -2, end == -1"); + testRes(sample.subarray(1, -1), N([41, 42]), "length == 4, begin == 1, end == -1"); + testRes(sample.subarray(1, -2), N([41]), "length == 4, begin == 1, end == -2"); + testRes(sample.subarray(2, -1), N([42]), "length == 4, begin == 2, end == -1"); - testRes(sample.subarray(-1, 5), [43], "begin == -1, end > length"); - testRes(sample.subarray(-2, 4), [42, 43], "begin == -2, end > length"); - testRes(sample.subarray(-3, 4), [41, 42, 43], "begin == -3, end > length"); + testRes(sample.subarray(-1, 5), N([43]), "begin == -1, end > length"); + testRes(sample.subarray(-2, 4), N([42, 43]), "begin == -2, end > length"); + testRes(sample.subarray(-3, 4), N([41, 42, 43]), "begin == -3, end > length"); }); diff --git a/test/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js b/test/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js index 0660a11125da2737d25211362bf77b0aa5e101de..23a425836781a0da606249c818215b8c799a65be 100644 --- a/test/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js +++ b/test/built-ins/TypedArray/prototype/subarray/results-with-empty-length.js @@ -12,8 +12,8 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, msg) { assert.sameValue(result.length, 0, msg); diff --git a/test/built-ins/TypedArray/prototype/subarray/results-with-same-length.js b/test/built-ins/TypedArray/prototype/subarray/results-with-same-length.js index 947e957223e678b026e6cb405a02d2d5e175abf2..a78adfee1f7be7c0fccacc7b06ff6b8880e63235 100644 --- a/test/built-ins/TypedArray/prototype/subarray/results-with-same-length.js +++ b/test/built-ins/TypedArray/prototype/subarray/results-with-same-length.js @@ -12,15 +12,15 @@ includes: [testTypedArray.js, compareArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); function testRes(result, msg) { assert.sameValue(result.length, 4, msg); - assert.sameValue(result[0], 40, msg + " & result[0] === 40"); - assert.sameValue(result[1], 41, msg + " & result[1] === 41"); - assert.sameValue(result[2], 42, msg + " & result[2] === 42"); - assert.sameValue(result[3], 43, msg + " & result[3] === 43"); + assert.sameValue(result[0], N(40), msg + " & result[0] === 40"); + assert.sameValue(result[1], N(41), msg + " & result[1] === 41"); + assert.sameValue(result[2], N(42), msg + " & result[2] === 42"); + assert.sameValue(result[3], N(43), msg + " & result[3] === 43"); } testRes(sample.subarray(0), "begin == 0"); diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js index a7d2bc800e795b674fcf5346610aba79ebaae8bd..ca5a484fa6435dd1640cfa63a2196aac8980dabe 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-abrupt.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); Object.defineProperty(sample, "constructor", { get: function() { diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js index 3fa39b43142eeca37c4d5d4757e04069516dbbe0..65771d46dcc52d6ecfe7614d990bbb55dfe2fe05 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-inherited.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js index 70714191e7cfaa9e5ca26e5af7603d85cbb79b43..1a8b1a47246d2defd7163c7ef4bcaf51c70a597b 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor-returns-throws.js @@ -27,8 +27,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); sample.constructor = 42; assert.throws(TypeError, function() { diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js index 6e6a65e3b98ed77e76f015582675e535de7d36e8..9622a8477e977f7af2a5e4e10d3c7c9c2f395152 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-ctor.js @@ -25,8 +25,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); var calls = 0; var result; diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js index 0b62ffdcb121a6a30aa87c8b14452f9890cc86cc..d8931af989a3a8fa08488d0a0d2c6f0c74723674 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-invocation.js @@ -35,8 +35,8 @@ includes: [testTypedArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var expectedOffset = TA.BYTES_PER_ELEMENT; var result, ctorThis; diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js index 3ed6ba00a864e67cba4b7776de9e02cc0004493c..77e3c2c5bfb119c373de04c1b46950c2dc483e4d 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor-returns-another-instance.js @@ -35,8 +35,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40])); var other = new Int8Array([1, 0, 1]); var result; diff --git a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js index 5dbc2cc3610460788bae3b4259e1cf8bdc338a94..963db60dcb25c878d177a42459c005d56c35a6cc 100644 --- a/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js +++ b/test/built-ins/TypedArray/prototype/subarray/speciesctor-get-species-custom-ctor.js @@ -35,8 +35,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Symbol.species, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42])); var calls = 0; var result; @@ -49,5 +49,5 @@ testWithTypedArrayConstructors(function(TA) { result = sample.subarray(1); assert.sameValue(calls, 1, "ctor called once"); - assert(compareArray(result, [41, 42]), "expected subarray"); + assert(compareArray(result, N([41, 42])), "expected subarray"); }); diff --git a/test/built-ins/TypedArray/prototype/subarray/tointeger-begin.js b/test/built-ins/TypedArray/prototype/subarray/tointeger-begin.js index abf503cb8f7bb91fc97fdd9785dbea9b973b3e08..d135984a3ef4eeb547b082a7a0e1ad614e2595e9 100644 --- a/test/built-ins/TypedArray/prototype/subarray/tointeger-begin.js +++ b/test/built-ins/TypedArray/prototype/subarray/tointeger-begin.js @@ -19,29 +19,29 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); - assert(compareArray(sample.subarray(false), [40, 41, 42, 43]), "false"); - assert(compareArray(sample.subarray(true), [41, 42, 43]), "true"); + assert(compareArray(sample.subarray(false), N([40, 41, 42, 43])), "false"); + assert(compareArray(sample.subarray(true), N([41, 42, 43])), "true"); - assert(compareArray(sample.subarray(NaN), [40, 41, 42, 43]), "NaN"); - assert(compareArray(sample.subarray(null), [40, 41, 42, 43]), "null"); - assert(compareArray(sample.subarray(undefined), [40, 41, 42, 43]), "undefined"); + assert(compareArray(sample.subarray(NaN), N([40, 41, 42, 43])), "NaN"); + assert(compareArray(sample.subarray(null), N([40, 41, 42, 43])), "null"); + assert(compareArray(sample.subarray(undefined), N([40, 41, 42, 43])), "undefined"); - assert(compareArray(sample.subarray(1.1), [41, 42, 43]), "1.1"); - assert(compareArray(sample.subarray(1.5), [41, 42, 43]), "1.5"); - assert(compareArray(sample.subarray(0.6), [40, 41, 42, 43]), "0.6"); + assert(compareArray(sample.subarray(1.1), N([41, 42, 43])), "1.1"); + assert(compareArray(sample.subarray(1.5), N([41, 42, 43])), "1.5"); + assert(compareArray(sample.subarray(0.6), N([40, 41, 42, 43])), "0.6"); - assert(compareArray(sample.subarray(-1.5), [43]), "-1.5"); - assert(compareArray(sample.subarray(-1.1), [43]), "-1.1"); - assert(compareArray(sample.subarray(-0.6), [40, 41, 42, 43]), "-0.6"); + assert(compareArray(sample.subarray(-1.5), N([43])), "-1.5"); + assert(compareArray(sample.subarray(-1.1), N([43])), "-1.1"); + assert(compareArray(sample.subarray(-0.6), N([40, 41, 42, 43])), "-0.6"); - assert(compareArray(sample.subarray("3"), [43]), "string"); + assert(compareArray(sample.subarray("3"), N([43])), "string"); assert( compareArray( sample.subarray(obj), - [42, 43] + N([42, 43]) ), "object" ); diff --git a/test/built-ins/TypedArray/prototype/subarray/tointeger-end.js b/test/built-ins/TypedArray/prototype/subarray/tointeger-end.js index 4797bf5b22ab3123ce75cc284ca66edbf83c886e..ad58835fb99043f1b0cfc3983b8e94c23c50259b 100644 --- a/test/built-ins/TypedArray/prototype/subarray/tointeger-end.js +++ b/test/built-ins/TypedArray/prototype/subarray/tointeger-end.js @@ -20,28 +20,28 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([40, 41, 42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([40, 41, 42, 43])); assert(compareArray(sample.subarray(0, false), []), "false"); - assert(compareArray(sample.subarray(0, true), [40]), "true"); + assert(compareArray(sample.subarray(0, true), N([40])), "true"); assert(compareArray(sample.subarray(0, NaN), []), "NaN"); assert(compareArray(sample.subarray(0, null), []), "null"); - assert(compareArray(sample.subarray(0, undefined), [40, 41, 42, 43]), "undefined"); + assert(compareArray(sample.subarray(0, undefined), N([40, 41, 42, 43])), "undefined"); assert(compareArray(sample.subarray(0, 0.6), []), "0.6"); - assert(compareArray(sample.subarray(0, 1.1), [40]), "1.1"); - assert(compareArray(sample.subarray(0, 1.5), [40]), "1.5"); + assert(compareArray(sample.subarray(0, 1.1), N([40])), "1.1"); + assert(compareArray(sample.subarray(0, 1.5), N([40])), "1.5"); assert(compareArray(sample.subarray(0, -0.6), []), "-0.6"); - assert(compareArray(sample.subarray(0, -1.1), [40, 41, 42]), "-1.1"); - assert(compareArray(sample.subarray(0, -1.5), [40, 41, 42]), "-1.5"); + assert(compareArray(sample.subarray(0, -1.1), N([40, 41, 42])), "-1.1"); + assert(compareArray(sample.subarray(0, -1.5), N([40, 41, 42])), "-1.5"); - assert(compareArray(sample.subarray(0, "3"), [40, 41, 42]), "string"); + assert(compareArray(sample.subarray(0, "3"), N([40, 41, 42])), "string"); assert( compareArray( sample.subarray(0, obj), - [40, 41] + N([40, 41]) ), "object" ); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js index 980670c721cfa7e261ed16b36d9bfdc96d156008..5c4ea06ef77d890073fe5d225741c2fd4120dd96 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tolocalestring-from-each-value.js @@ -39,15 +39,19 @@ Number.prototype.toLocaleString = function() { return "hacks" + calls.length; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = []; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert( - compareArray(new TA(calls), sample), + compareArray(new TA(N(calls)), sample), "toLocaleString called for each item" ); }); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js index 1329e4bd2b8e71fabc3f7c662627dafd48d5ec7d..5dfcf91d4a65f5edb5472d68ae1d6872abdd97ee 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-tostring-from-each-value.js @@ -47,11 +47,15 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert.sameValue(calls, 2, "toString called once for each item"); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js b/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js index 06f7bc0e056441963af4a4090f60b125ad0007c8..25603f372238c9b490d9aecc46907142f0e1ade2 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/calls-valueof-from-each-value.js @@ -45,11 +45,15 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; var expected = ["hacks1", "hacks2"].join(separator); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.sameValue(sample.toLocaleString(), expected, "returns expected value"); assert.sameValue(calls, 2, "valueOf called once for each item"); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js b/test/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js index 5d061ebaf4d33f5473eece30f419a8c9e367cc51..72e76979e98312135914fc5972176d07714f51ab 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/get-length-uses-internal-arraylength.js @@ -30,8 +30,8 @@ var desc = { Object.defineProperty(TypedArray.prototype, "length", desc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(TA.prototype, "length", desc); Object.defineProperty(sample, "length", desc); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js index ab58c6eaca52aad6f1937cafb463dadb27a4d7e7..be087cfd146186e20a92d38f780d107d9670c16e 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tolocalestring.js @@ -31,11 +31,15 @@ Number.prototype.toLocaleString = function() { throw new Test262Error(); }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { calls = 0; - var sample = new TA(arr); + var sample = new TA(N(arr)); assert.throws(Test262Error, function() { sample.toLocaleString(); }); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js index 736d7ff061a46e17277bada217091fb9d2e5e7dc..433613030cd4e70f58e081af33cff6f972c2fa38 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-tostring.js @@ -43,10 +43,14 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js index 81102c73d179f414492f15229df42f7e2bf5232b..b283f1db11c786567608ee1588c7af58ce63d61d 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-firstelement-valueof.js @@ -44,10 +44,14 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js index 0909a1dcd1bea4a9e68ab3598685589535a00300..013f2afc31114f439f6e442a2211c62dabea7642 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tolocalestring.js @@ -34,11 +34,15 @@ Number.prototype.toLocaleString = function() { } }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { calls = 0; - var sample = new TA(arr); + var sample = new TA(N(arr)); assert.throws(Test262Error, function() { sample.toLocaleString(); }); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js index 1b7330e92273365f77f78cbbc8671d71c2dba7ce..9d2eed638859c60a4b60ad72b776886b1fe94d1a 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-tostring.js @@ -45,10 +45,14 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js index 336b4b49b7fecfe8ac3f96f8cdbeb95cf95520fa..d70d442f5588fa49b02ebbc963a93356a4fe7f0d 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-abrupt-from-nextelement-valueof.js @@ -46,10 +46,14 @@ Number.prototype.toLocaleString = function() { }; }; +if (typeof BigInt !== "undefined") { + BigInt.prototype.toLocaleString = Number.prototype.toLocaleString; +} + var arr = [42, 0]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); calls = 0; assert.throws(Test262Error, function() { sample.toLocaleString(); diff --git a/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js b/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js index 3880798df7432b8cd9caa7ea964688ffa735fb01..f5825158fa4ed8dd8d2f833de0b838899f12a40d 100644 --- a/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js +++ b/test/built-ins/TypedArray/prototype/toLocaleString/return-result.js @@ -35,8 +35,8 @@ var separator = ["", ""].toLocaleString(); var arr = [42, 0, 43]; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA(arr); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N(arr)); var expected = sample[0].toLocaleString().toString() + separator + diff --git a/test/built-ins/TypedArray/prototype/values/iter-prototype.js b/test/built-ins/TypedArray/prototype/values/iter-prototype.js index 4bf31e18464b96c6585c9483b5ef47a5c99ea957..55913d2666c5a6147293e41adb8149a44edb8a07 100644 --- a/test/built-ins/TypedArray/prototype/values/iter-prototype.js +++ b/test/built-ins/TypedArray/prototype/values/iter-prototype.js @@ -17,8 +17,8 @@ features: [Symbol.iterator, TypedArray] var ArrayIteratorProto = Object.getPrototypeOf([][Symbol.iterator]()); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 42, 64]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 42, 64])); var iter = sample.values(); assert.sameValue(Object.getPrototypeOf(iter), ArrayIteratorProto); diff --git a/test/built-ins/TypedArray/prototype/values/return-itor.js b/test/built-ins/TypedArray/prototype/values/return-itor.js index 1877d7becc1102f8c06a55bf80b24861dc011ea1..31b9f410f13df83022749670c12ead1d311677fe 100644 --- a/test/built-ins/TypedArray/prototype/values/return-itor.js +++ b/test/built-ins/TypedArray/prototype/values/return-itor.js @@ -13,22 +13,22 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -var sample = new Int8Array([0, 42, 64]); +var sample = [0, 42, 64]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(sample); +testWithTypedArrayConstructors(function(TA, N) { + var typedArray = new TA(N(sample)); var itor = typedArray.values(); var next = itor.next(); - assert.sameValue(next.value, 0); + assert.sameValue(next.value, N(0)); assert.sameValue(next.done, false); next = itor.next(); - assert.sameValue(next.value, 42); + assert.sameValue(next.value, N(42)); assert.sameValue(next.done, false); next = itor.next(); - assert.sameValue(next.value, 64); + assert.sameValue(next.value, N(64)); assert.sameValue(next.done, false); next = itor.next(); diff --git a/test/built-ins/TypedArrays/from/custom-ctor-returns-other-instance.js b/test/built-ins/TypedArrays/from/custom-ctor-returns-other-instance.js index 8a01176822c640f53d023ebe8adbd2ce4a690224..b59bf2297155904884c680c192f24a45a0e15393 100644 --- a/test/built-ins/TypedArrays/from/custom-ctor-returns-other-instance.js +++ b/test/built-ins/TypedArrays/from/custom-ctor-returns-other-instance.js @@ -23,12 +23,14 @@ includes: [testTypedArray.js] features: [Symbol.iterator, TypedArray] ---*/ -var sourceItor = [1, 2]; -var sourceObj = { - length: 2 -}; +testWithTypedArrayConstructors(function(TA, N) { + var sourceItor = N([1, 2]); + var sourceObj = { + 0: N(0), + 1: N(0), + length: 2 + }; -testWithTypedArrayConstructors(function(TA) { var result; var custom = new TA(2); var ctor = function() { diff --git a/test/built-ins/TypedArrays/from/mapfn-arguments.js b/test/built-ins/TypedArrays/from/mapfn-arguments.js index 6d102d1b6c8d2ed8c2e4f4e25ba874061b94e6f2..65150c85b9c22844f012c4283159684e94576186 100644 --- a/test/built-ins/TypedArrays/from/mapfn-arguments.js +++ b/test/built-ins/TypedArrays/from/mapfn-arguments.js @@ -19,7 +19,7 @@ features: [TypedArray] var source = [42, 43, 44]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var results = []; var mapfn = function(kValue, k) { results.push({ @@ -27,6 +27,7 @@ testWithTypedArrayConstructors(function(TA) { k: k, argsLength: arguments.length }); + return N(0); }; TA.from(source, mapfn); diff --git a/test/built-ins/TypedArrays/from/mapfn-this-with-thisarg.js b/test/built-ins/TypedArrays/from/mapfn-this-with-thisarg.js index 2fb965d08c314a84108e45631a0c13e873fa2c6c..2df9a0efc55232dc8b1e5cada3996ff65437f743 100644 --- a/test/built-ins/TypedArrays/from/mapfn-this-with-thisarg.js +++ b/test/built-ins/TypedArrays/from/mapfn-this-with-thisarg.js @@ -22,10 +22,11 @@ features: [TypedArray] var source = [42, 43]; var thisArg = {}; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var results = []; var mapfn = function() { results.push(this); + return N(0); }; TA.from(source, mapfn, thisArg); diff --git a/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-non-strict.js b/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-non-strict.js index 02eeaba113e8876bb68d2ef98767c8d380c0882a..e136207a354f80991507a56700a311e9797a0fc6 100644 --- a/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-non-strict.js +++ b/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-non-strict.js @@ -23,13 +23,14 @@ features: [TypedArray] var source = [42, 43]; var global = this; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var results = []; - var mapfn = function() { + var mapfn = function(x) { results.push(this); + return N(x); }; - TA.from(source, mapfn); + TA.from(N(source), mapfn); assert.sameValue(results.length, 2); assert.sameValue(results[0], global); diff --git a/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-strict.js b/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-strict.js index 61612fa35aa17d1b4c7e07c59ab04f10a1c9e66f..ca2968c7ac0f408511d6a761ba04c06a3a7f9196 100644 --- a/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-strict.js +++ b/test/built-ins/TypedArrays/from/mapfn-this-without-thisarg-strict.js @@ -22,10 +22,11 @@ features: [TypedArray] var source = [42, 43]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var results = []; var mapfn = function() { results.push(this); + return N(0); }; TA.from(source, mapfn); diff --git a/test/built-ins/TypedArrays/from/new-instance-using-custom-ctor.js b/test/built-ins/TypedArrays/from/new-instance-using-custom-ctor.js index 2fe53a328fce7b1fe2d1a5d02ac66f51c94e6c8a..bf8c34acf3eb286862974ef8e63ae993658f9794 100644 --- a/test/built-ins/TypedArrays/from/new-instance-using-custom-ctor.js +++ b/test/built-ins/TypedArrays/from/new-instance-using-custom-ctor.js @@ -10,7 +10,7 @@ features: [TypedArray] var source = [42, 43, 42]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var called = 0; var ctor = function(len) { @@ -19,11 +19,11 @@ testWithTypedArrayConstructors(function(TA) { return new TA(len); }; - var result = TA.from.call(ctor, source); + var result = TA.from.call(ctor, N(source)); assert.sameValue(result.length, 3); - assert.sameValue(result[0], 42); - assert.sameValue(result[1], 43); - assert.sameValue(result[2], 42); + assert.sameValue(result[0], N(42)); + assert.sameValue(result[1], N(43)); + assert.sameValue(result[2], N(42)); assert.sameValue(result.constructor, TA); assert.sameValue(Object.getPrototypeOf(result), TA.prototype); assert.sameValue(called, 1); diff --git a/test/built-ins/TypedArrays/from/new-instance-with-mapfn.js b/test/built-ins/TypedArrays/from/new-instance-with-mapfn.js index ab8da0b98c0ad120ce95b9f8c78c038c399c541c..66536c623d8d779c4a74f8bc5c46876d9502b717 100644 --- a/test/built-ins/TypedArrays/from/new-instance-with-mapfn.js +++ b/test/built-ins/TypedArrays/from/new-instance-with-mapfn.js @@ -10,16 +10,16 @@ features: [TypedArray] var source = [42, 43, 42]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var mapfn = function(kValue) { - return kValue * 2; + return N(kValue * 2); }; var result = TA.from(source, mapfn); assert.sameValue(result.length, 3); - assert.sameValue(result[0], 84); - assert.sameValue(result[1], 86); - assert.sameValue(result[2], 84); + assert.sameValue(result[0], N(84)); + assert.sameValue(result[1], N(86)); + assert.sameValue(result[2], N(84)); assert.sameValue(result.constructor, TA); assert.sameValue(Object.getPrototypeOf(result), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/from/new-instance-without-mapfn.js b/test/built-ins/TypedArrays/from/new-instance-without-mapfn.js index d7ac6abc2c573953f72d0afe6e6afc421bd90032..ebedc93c8057f0f4007d21645b012662884640fb 100644 --- a/test/built-ins/TypedArrays/from/new-instance-without-mapfn.js +++ b/test/built-ins/TypedArrays/from/new-instance-without-mapfn.js @@ -10,12 +10,12 @@ features: [TypedArray] var source = [42, 43, 42]; -testWithTypedArrayConstructors(function(TA) { - var result = TA.from(source); +testWithTypedArrayConstructors(function(TA, N) { + var result = TA.from(N(source)); assert.sameValue(result.length, 3); - assert.sameValue(result[0], 42); - assert.sameValue(result[1], 43); - assert.sameValue(result[2], 42); + assert.sameValue(result[0], N(42)); + assert.sameValue(result[1], N(43)); + assert.sameValue(result[2], N(42)); assert.sameValue(result.constructor, TA); assert.sameValue(Object.getPrototypeOf(result), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/from/set-value-abrupt-completion.js b/test/built-ins/TypedArrays/from/set-value-abrupt-completion.js index ddde226a2b626ae51144e4084a9a5a6ae1922225..efae38c9021c1a8373f85029bac3a995843ea74c 100644 --- a/test/built-ins/TypedArrays/from/set-value-abrupt-completion.js +++ b/test/built-ins/TypedArrays/from/set-value-abrupt-completion.js @@ -25,9 +25,8 @@ var obj = { } }; -var source = [42, obj, 1]; - -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { + var source = [N(42), obj, N(1)]; var lastValue; var mapfn = function(kValue) { lastValue = kValue; diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/desc-value-throws.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/desc-value-throws.js index 6572c1f94620325a2bedf9bf703b7e0ef46759ae..ba658f22149d1d9571dd947f1fd6f7cc0b5542cc 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/desc-value-throws.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/desc-value-throws.js @@ -31,8 +31,8 @@ var obj = { } }; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.throws(Test262Error, function() { Object.defineProperty(sample, "0", {value: obj}); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-greater-than-last-index.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-greater-than-last-index.js index afb5672b9943099d3c4e5d4750d5e2a20bb04a83..4cc13c6f53c5d22c457707e9bd7caae3645bbdfc 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-greater-than-last-index.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-greater-than-last-index.js @@ -20,8 +20,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue( Reflect.defineProperty(sample, "2", { diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-lower-than-zero.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-lower-than-zero.js index ba21aec9c5ee94bebbcb3d76c42c2263fb84cf8f..3c63a0ab7fa96f2fb8c85315f84fe2872ab825c9 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-lower-than-zero.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-lower-than-zero.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue( Reflect.defineProperty(sample, "-1", { diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-minus-zero.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-minus-zero.js index c891f5cc1a618455424ee5cf094c6db98976788b..207344f831fbc4352a9d05e3e991ab7d51ae9d2a 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-minus-zero.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-minus-zero.js @@ -18,7 +18,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -31,6 +31,6 @@ testWithTypedArrayConstructors(function(TA) { false, "defineProperty returns false" ); - assert.sameValue(sample[0], 0, "does not change the value for [0]"); + assert.sameValue(sample[0], N(0), "does not change the value for [0]"); assert.sameValue(sample["-0"], undefined, "does define a value for ['-0']"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-canonical-index.js index 193d9166566f7b52d0793dcc48f1bde2ecfb56bb..33511ca7b48f99ae1597ccd1927da46390646122 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-canonical-index.js @@ -24,12 +24,6 @@ var keys = [ "0.0000001" ]; -var dataDesc = { - value: 42, - writable: true, - configurable: true -}; - var fnset = function() {}; var fnget = function() {}; @@ -40,8 +34,14 @@ var acDesc = { configurable: false }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { keys.forEach(function(key) { + var dataDesc = { + value: N(42), + writable: true, + configurable: true + }; + var sample1 = new TA(); assert.sameValue( @@ -50,7 +50,7 @@ testWithTypedArrayConstructors(function(TA) { "return true after defining data property [" + key + "]" ); - assert.sameValue(sample1[key], 42, "value is set to [" + key + "]"); + assert.sameValue(sample1[key], N(42), "value is set to [" + key + "]"); verifyNotEnumerable(sample1, key); verifyWritable(sample1, key); verifyConfigurable(sample1, key); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-integer.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-integer.js index b30fc17ece94f3c93103d48c691a289b316e0e8b..4232ab63821b942d16ca7ed6f79b111e1d84deac 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-integer.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-integer.js @@ -16,7 +16,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -29,7 +29,7 @@ testWithTypedArrayConstructors(function(TA) { false, "0.1" ); - assert.sameValue(sample[0], 0, "'0.1' - does not change the value for [0]"); + assert.sameValue(sample[0], N(0), "'0.1' - does not change the value for [0]"); assert.sameValue( sample["0.1"], undefined, @@ -47,7 +47,7 @@ testWithTypedArrayConstructors(function(TA) { "0.000001" ); assert.sameValue( - sample[0], 0, + sample[0], N(0), "'0.000001' - does not change the value for [0]" ); assert.sameValue( @@ -66,7 +66,7 @@ testWithTypedArrayConstructors(function(TA) { false, "1.1" ); - assert.sameValue(sample[1], 0, "'1.1' - does not change the value for [1]"); + assert.sameValue(sample[1], N(0), "'1.1' - does not change the value for [1]"); assert.sameValue( sample["1.1"], undefined, @@ -84,11 +84,11 @@ testWithTypedArrayConstructors(function(TA) { "Infinity" ); assert.sameValue( - sample[0], 0, + sample[0], N(0), "'Infinity' - does not change the value for [0]" ); assert.sameValue( - sample[1], 0, + sample[1], N(0), "'Infinity' - does not change the value for [1]" ); assert.sameValue( @@ -108,11 +108,11 @@ testWithTypedArrayConstructors(function(TA) { "-Infinity" ); assert.sameValue( - sample[0], 0, + sample[0], N(0), "'-Infinity' - does not change the value for [0]" ); assert.sameValue( - sample[1], 0, + sample[1], N(0), "'-Infinity' - does not change the value for [1]" ); assert.sameValue( diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-numeric-index.js index 845a9afbe29718a1b4cf17900fd6fcdd909da0e4..b51e1f23760b46b780a5b1d3b23c16e13805d47a 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-not-numeric-index.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, propertyHelper.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue( Reflect.defineProperty(sample, "foo", {value:42}), diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js index 5d8be8a2a658c2001a41e4419c5be0fa76f57b57..0c9e907975d26e10d7fb799ded41184226d186cc 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-accessor-desc.js @@ -18,7 +18,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -31,7 +31,7 @@ testWithTypedArrayConstructors(function(TA) { false, "get accessor" ); - assert.sameValue(sample[0], 0, "get accessor - side effect check"); + assert.sameValue(sample[0], N(0), "get accessor - side effect check"); assert.sameValue( Reflect.defineProperty(sample, "0", { @@ -41,7 +41,7 @@ testWithTypedArrayConstructors(function(TA) { false, "set accessor" ); - assert.sameValue(sample[0], 0, "set accessor - side effect check"); + assert.sameValue(sample[0], N(0), "set accessor - side effect check"); assert.sameValue( Reflect.defineProperty(sample, "0", { @@ -54,5 +54,5 @@ testWithTypedArrayConstructors(function(TA) { false, "get and set accessors" ); - assert.sameValue(sample[0], 0, "get and set accessors - side effect check"); + assert.sameValue(sample[0], N(0), "get and set accessors - side effect check"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js index 133f3343d5d8d605b7cdc8deeb735ac8d220e60e..5b03b57bfc19c03f28d87b1b5a7055cb08886e18 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-configurable.js @@ -18,7 +18,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -31,5 +31,5 @@ testWithTypedArrayConstructors(function(TA) { false, "defineProperty's result" ); - assert.sameValue(sample[0], 0, "side effect check"); + assert.sameValue(sample[0], N(0), "side effect check"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js index 09526d11f77dbf1a2a7df8ee6eb02e2a96ca8e2d..7bf8861403340668f1904436534db3b604ae7ad6 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-enumerable.js @@ -18,7 +18,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -31,5 +31,5 @@ testWithTypedArrayConstructors(function(TA) { false, "defineProperty's result" ); - assert.sameValue(sample[0], 0, "side effect check"); + assert.sameValue(sample[0], N(0), "side effect check"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js index 08c9a1b3a725b21eab832cd0a46b5fe9c4982f27..ab460e4e670640c423f681ab4f36e7f23aae3ccf 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex-desc-not-writable.js @@ -18,7 +18,7 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new TA(2); assert.sameValue( @@ -31,5 +31,5 @@ testWithTypedArrayConstructors(function(TA) { false, "defineProperty's result" ); - assert.sameValue(sample[0], 0, "side effect check"); + assert.sameValue(sample[0], N(0), "side effect check"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex.js index d815738b6e4c61d2be884714fc61a44f3819842a..c6ddb107074fe3c09511f8d5afc62c98e7c0411b 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-numericindex.js @@ -18,12 +18,12 @@ includes: [testTypedArray.js, propertyHelper.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 42])); assert.sameValue( Reflect.defineProperty(sample, "0", { - value: 8, + value: N(8), configurable: false, enumerable: true, writable: true @@ -31,10 +31,10 @@ testWithTypedArrayConstructors(function(TA) { true ); - assert.sameValue(sample[0], 8, "property value was set"); + assert.sameValue(sample[0], N(8), "property value was set"); var desc = Object.getOwnPropertyDescriptor(sample, "0"); - assert.sameValue(desc.value, 8, "desc.value"); + assert.sameValue(desc.value, N(8), "desc.value"); assert.sameValue(desc.writable, true, "property is writable"); verifyEnumerable(sample, "0"); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-symbol.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-symbol.js index c5cff6eee32fee99473287c527dd33a3cc2e771c..856997801c57fbf7361c59f8e0e9ff77d77e2419 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/key-is-symbol.js @@ -15,8 +15,8 @@ includes: [testTypedArray.js, propertyHelper.js] features: [Reflect, Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var s1 = Symbol("foo"); assert.sameValue( diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-new-key.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-new-key.js index e74c95f12f51da36443de158147cea75f3a83269..681630928da4a6adf68f5d74c519dbf21f58aaf1 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-new-key.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-new-key.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.preventExtensions(sample); assert.sameValue( diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-redefine-key.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-redefine-key.js index a0baaf57e54eedf837ded056148c087e00478051..5983e6dfbd1b0efcf6044ad674346419946e8681 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-redefine-key.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/non-extensible-redefine-key.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, propertyHelper.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); sample.foo = true; sample.bar = true; diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/set-value.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/set-value.js index ff71bee907fabbd6fc26ff418bce54a59c187607..0571a46eadcdb9258bf8509c512720163a50f0ee 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/set-value.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/set-value.js @@ -25,21 +25,21 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([0, 0]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([0, 0])); assert.sameValue( - Reflect.defineProperty(sample, "0", {value: 1}), + Reflect.defineProperty(sample, "0", {value: N(1)}), true, "set value for sample[0] returns true" ); assert.sameValue( - Reflect.defineProperty(sample, "1", {value: 2}), + Reflect.defineProperty(sample, "1", {value: N(2)}), true, "set value for sample[1] returns true" ); - assert.sameValue(sample[0], 1, "sample[0]"); - assert.sameValue(sample[1], 2, "sample[1]"); + assert.sameValue(sample[0], N(1), "sample[0]"); + assert.sameValue(sample[1], N(2), "sample[1]"); }); diff --git a/test/built-ins/TypedArrays/internals/DefineOwnProperty/this-is-not-extensible.js b/test/built-ins/TypedArrays/internals/DefineOwnProperty/this-is-not-extensible.js index 5e586c7759dadd01955720b7eebb50d36ce648a1..e4f54b45e61c784d697e658ded844f60922bbf10 100644 --- a/test/built-ins/TypedArrays/internals/DefineOwnProperty/this-is-not-extensible.js +++ b/test/built-ins/TypedArrays/internals/DefineOwnProperty/this-is-not-extensible.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [Reflect, Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.preventExtensions(sample); diff --git a/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-not-numeric-index.js index b0032bad71f2dc01aa9701ad06417af40e89f94c..4ebb82f7e0266c681dcdbd825fbaa2b952ea4913 100644 --- a/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-not-numeric-index.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); sample.foo = "test262"; $DETACHBUFFER(sample.buffer); diff --git a/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-symbol.js b/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-symbol.js index 2b18a93ea5fcee71f17492b504b6ec820f6e6e4e..9910fe6ebe06b6d5f4bc6260a2a133f36cf8c854 100644 --- a/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/Get/detached-buffer-key-is-symbol.js @@ -15,8 +15,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); $DETACHBUFFER(sample.buffer); var s = Symbol("1"); diff --git a/test/built-ins/TypedArrays/internals/Get/detached-buffer.js b/test/built-ins/TypedArrays/internals/Get/detached-buffer.js index 4e52b1cf0a240fcc3aff416c4f280862faffede3..467aff7cf51b05033d138d40554d82d9e5b84c78 100644 --- a/test/built-ins/TypedArrays/internals/Get/detached-buffer.js +++ b/test/built-ins/TypedArrays/internals/Get/detached-buffer.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { diff --git a/test/built-ins/TypedArrays/internals/Get/indexed-value-sab.js b/test/built-ins/TypedArrays/internals/Get/indexed-value-sab.js index 6145da9e24e8f2cfca84b353a274354e15f9a11f..c9e49d861df4174443d652c0747bee83d767f8fe 100644 --- a/test/built-ins/TypedArrays/internals/Get/indexed-value-sab.js +++ b/test/built-ins/TypedArrays/internals/Get/indexed-value-sab.js @@ -18,11 +18,11 @@ var throwDesc = { Object.defineProperty(proto, "0", throwDesc); Object.defineProperty(proto, "1", throwDesc); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sab = new SharedArrayBuffer(TA.BYTES_PER_ELEMENT * 2); var sample = new TA(sab); - sample.set([42, 1]); + sample.set([N(42), N(1)]); - assert.sameValue(sample["0"], 42); - assert.sameValue(sample["1"], 1); + assert.sameValue(sample["0"], N(42)); + assert.sameValue(sample["1"], N(1)); }); diff --git a/test/built-ins/TypedArrays/internals/Get/indexed-value.js b/test/built-ins/TypedArrays/internals/Get/indexed-value.js index f58c528b6a7e9fa32e829a090aa049f0cecc3ae1..cb761c6db4f4904c120fd955d3470acabdcc0c65 100644 --- a/test/built-ins/TypedArrays/internals/Get/indexed-value.js +++ b/test/built-ins/TypedArrays/internals/Get/indexed-value.js @@ -26,9 +26,9 @@ var throwDesc = { Object.defineProperty(proto, "0", throwDesc); Object.defineProperty(proto, "1", throwDesc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 1]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 1])); - assert.sameValue(sample["0"], 42); - assert.sameValue(sample["1"], 1); + assert.sameValue(sample["0"], N(42)); + assert.sameValue(sample["1"], N(1)); }); diff --git a/test/built-ins/TypedArrays/internals/Get/key-is-not-integer.js b/test/built-ins/TypedArrays/internals/Get/key-is-not-integer.js index 5ad684b787180488819f560618709ce68b994594..258f11193ee892d7724d6a82b465a348df6df21f 100644 --- a/test/built-ins/TypedArrays/internals/Get/key-is-not-integer.js +++ b/test/built-ins/TypedArrays/internals/Get/key-is-not-integer.js @@ -30,8 +30,8 @@ Object.defineProperty(proto, "1.1", { } }); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue(sample["1.1"], undefined); }); diff --git a/test/built-ins/TypedArrays/internals/Get/key-is-not-minus-zero.js b/test/built-ins/TypedArrays/internals/Get/key-is-not-minus-zero.js index 851cf72b44ee0d020d25a56d4e13a1f0df5ba469..45e7af40fa7d4cd757571e2a39b8f8a5d5750b47 100644 --- a/test/built-ins/TypedArrays/internals/Get/key-is-not-minus-zero.js +++ b/test/built-ins/TypedArrays/internals/Get/key-is-not-minus-zero.js @@ -30,8 +30,8 @@ Object.defineProperty(proto, "-0", { } }); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue(sample["-0"], undefined); }); diff --git a/test/built-ins/TypedArrays/internals/Get/key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/Get/key-is-not-numeric-index.js index 53824ad34abdfb4a4f4edcd1e09b33a15748985d..116f042753c7d4d15dd080cee0c9b61ac6d1594c 100644 --- a/test/built-ins/TypedArrays/internals/Get/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/Get/key-is-not-numeric-index.js @@ -19,8 +19,8 @@ features: [TypedArray] TypedArray.prototype.baz = "test262"; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue( sample.foo, undefined, diff --git a/test/built-ins/TypedArrays/internals/Get/key-is-out-of-bounds.js b/test/built-ins/TypedArrays/internals/Get/key-is-out-of-bounds.js index a6eaa05dfc2d4729caaae8c57d6d999b38205b06..dfb3d0411db79e77a354a01c7f97cee20f910713 100644 --- a/test/built-ins/TypedArrays/internals/Get/key-is-out-of-bounds.js +++ b/test/built-ins/TypedArrays/internals/Get/key-is-out-of-bounds.js @@ -34,8 +34,8 @@ Object.defineProperty(proto, "-1", throwDesc); Object.defineProperty(proto, "2", throwDesc); Object.defineProperty(proto, "3", throwDesc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue(sample["-1"], undefined); assert.sameValue(sample["2"], undefined); diff --git a/test/built-ins/TypedArrays/internals/Get/key-is-symbol.js b/test/built-ins/TypedArrays/internals/Get/key-is-symbol.js index 1d05d06bc0bc87b4ef7a9ef8927e2c26997eb414..3454fd676d4aa3435596359bf39b10bdc2be0ae0 100644 --- a/test/built-ins/TypedArrays/internals/Get/key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/Get/key-is-symbol.js @@ -18,8 +18,8 @@ features: [Symbol, TypedArray] var parentKey = Symbol("2"); TypedArray.prototype[parentKey] = "test262"; -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); var s1 = Symbol("1"); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-not-number.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-not-number.js index 81b274361f49e72e7ff1f8399c778dc489646c75..c0f54cd4a449bc7bdf6f8d5b950ed50ae15b623b 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-not-number.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-not-number.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); $DETACHBUFFER(sample.buffer); assert.sameValue( diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-symbol.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-symbol.js index 308a2973f1431c58c5084e3fa4013203dcf93a3e..b637e6fe3453a7ee50979cc254c8aa918bc6f21d 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/detached-buffer-key-is-symbol.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); $DETACHBUFFER(sample.buffer); var s = Symbol("foo"); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/index-prop-desc.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/index-prop-desc.js index fe7f1eca260af7b3c48c57b8c83609a52e7ee09e..0771ae51ec4a68ab1eff00f2856c6a13b0d0bcd1 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/index-prop-desc.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/index-prop-desc.js @@ -19,17 +19,17 @@ includes: [testTypedArray.js, propertyHelper.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var desc0 = Object.getOwnPropertyDescriptor(sample, 0); - assert.sameValue(desc0.value, 42, "value", "desc0.value === 42"); + assert.sameValue(desc0.value, N(42), "value", "desc0.value === 42"); assert.sameValue(desc0.writable, true, "index descriptor is writable [0]"); verifyEnumerable(sample, "0", "index descriptor is enumerable [0]"); verifyNotConfigurable(sample, "0", "index descriptor is not configurable [0]"); var desc1 = Object.getOwnPropertyDescriptor(sample, 1); - assert.sameValue(desc1.value, 43, "value", "desc1.value === 43"); + assert.sameValue(desc1.value, N(43), "value", "desc1.value === 43"); assert.sameValue(desc1.writable, true, "index descriptor is writable [1]"); verifyEnumerable(sample, "1", "index descriptor is enumerable [1]"); verifyNotConfigurable(sample, "1", "index descriptor is not configurable [1]"); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-minus-zero.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-minus-zero.js index 1b1c828abc21848314ac83b302e1d4876890962b..93fb63a55bfc06ee08cf73dc5db3f030dd2cd75b 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-minus-zero.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-minus-zero.js @@ -29,8 +29,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); // -0 as a number value is converted to "0" before calling [[GetOwnProperty]] assert.sameValue(Object.getOwnPropertyDescriptor(sample, "-0"), undefined); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-canonical-index.js index 35b6fa01c5ec92d9c14e711932ae0f5e17ece0ac..e2f7352a0370a1b825abba297ec7af4a316a8aa4 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-canonical-index.js @@ -26,9 +26,9 @@ var keys = [ "0.0000001" ]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { keys.forEach(function(key) { - var sample = new TA([42, 43]); + var sample = new TA(N([42, 43])); assert.sameValue( Object.getOwnPropertyDescriptor(sample, key), diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-integer.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-integer.js index f77950d728a88a4abdd529dddcea6fb75f9eeb6b..78e7e59150161b7e407f0dfdc9c79397dd95decb 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-integer.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-integer.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "1.1"), undefined); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "0.1"), undefined); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-numeric-index.js index 57fd606ae598febd780e57871bf3d8c5465895e4..32f68d2ceb776c10058f2700b82b93637bc4d4d0 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-not-numeric-index.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue( Object.getOwnPropertyDescriptor(sample, "undef"), diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-out-of-bounds.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-out-of-bounds.js index 891bc7184de16327d00caa57bf4db28b24d492d5..a02b44bb4dee8a2b57383404ac5b482cdcaba452 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-out-of-bounds.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-out-of-bounds.js @@ -24,8 +24,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "-1"), undefined); assert.sameValue(Object.getOwnPropertyDescriptor(sample, "-42"), undefined); diff --git a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-symbol.js b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-symbol.js index 6b440e1194c063e76301e28d4088f1ffc5a6b012..2d31cb822e49c02458fab51512edb68ce8fd33af 100644 --- a/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/GetOwnProperty/key-is-symbol.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js] features: [Symbol, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); var s = Symbol("foo"); Object.defineProperty(sample, s, { value: "baz" }); diff --git a/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-not-number.js b/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-not-number.js index 011e80c0b61429e0a6d643bc20c27c920c999345..4a4b645403288ce06182da3d4895541f7abdc4e2 100644 --- a/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-not-number.js +++ b/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-not-number.js @@ -18,8 +18,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(sample, "bar", { value: 42 }); $DETACHBUFFER(sample.buffer); diff --git a/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-symbol.js b/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-symbol.js index 2c34c3caa0fd1f0e0c6e61955b413a417a1466c2..abc2bf4e3ca9cafac54c09657590a6925d9c125d 100644 --- a/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/HasProperty/detached-buffer-key-is-symbol.js @@ -20,8 +20,8 @@ features: [Reflect, Symbol, TypedArray] var s1 = Symbol("foo"); var s2 = Symbol("bar"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); Object.defineProperty(sample, s1, { value: "baz" }); $DETACHBUFFER(sample.buffer); diff --git a/test/built-ins/TypedArrays/internals/HasProperty/indexed-value.js b/test/built-ins/TypedArrays/internals/HasProperty/indexed-value.js index 5a3b0482ac3e9eebda363c3c1b0145b1e7984d59..88aea9dc65f787db0006ad46ef731885b4758ec9 100644 --- a/test/built-ins/TypedArrays/internals/HasProperty/indexed-value.js +++ b/test/built-ins/TypedArrays/internals/HasProperty/indexed-value.js @@ -24,8 +24,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); assert.sameValue(Reflect.has(sample, 0), true); assert.sameValue(Reflect.has(sample, 1), true); diff --git a/test/built-ins/TypedArrays/internals/HasProperty/key-is-not-canonical-index.js b/test/built-ins/TypedArrays/internals/HasProperty/key-is-not-canonical-index.js index 7e20c5b24fb951ffca70565f64ce4eb7e6279db1..14ffa907287c53733d1aa3fe84f0b9a5722b94a3 100644 --- a/test/built-ins/TypedArrays/internals/HasProperty/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrays/internals/HasProperty/key-is-not-canonical-index.js @@ -25,7 +25,7 @@ var keys = [ "0.0000001" ]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { keys.forEach(function(key) { var sample = new TA(1); @@ -43,7 +43,7 @@ testWithTypedArrayConstructors(function(TA) { delete TypedArray.prototype[key]; - Object.defineProperty(sample, key, {value: 42}); + Object.defineProperty(sample, key, {value: N(42)}); assert.sameValue( Reflect.has(sample, key), true, diff --git a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js index 9060bee4d74f04baa3a1a3d2047d29d39c71aa89..d469c9ab1c9c82d8778ae52f0302a447e48aa791 100644 --- a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js +++ b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-and-symbol-keys-.js @@ -23,8 +23,8 @@ var s2 = Symbol("2"); TypedArray.prototype[3] = 42; TypedArray.prototype.bar = 42; -testWithTypedArrayConstructors(function(TA) { - var sample1 = new TA([42, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample1 = new TA(N([42, 42, 42])); sample1[s1] = 42; sample1[s2] = 42; sample1.test262 = 42; diff --git a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js index b227ef6f22645a60c0ce329c7bfa2ba772f9bad2..5f933e570b3611b0b5636a28d8e1356b51d168db 100644 --- a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js +++ b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes-and-string-keys.js @@ -20,8 +20,8 @@ features: [Reflect, TypedArray] TypedArray.prototype[3] = 42; TypedArray.prototype.bar = 42; -testWithTypedArrayConstructors(function(TA) { - var sample1 = new TA([42, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample1 = new TA(N([42, 42, 42])); sample1.test262 = 42; sample1.ecma262 = 42; var result1 = Reflect.ownKeys(sample1); diff --git a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes.js b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes.js index 00e57de342dabb7d7060b49d02583f4a9994da64..17c78ca5a3de40120f9b950528e2e54de3bec532 100644 --- a/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes.js +++ b/test/built-ins/TypedArrays/internals/OwnPropertyKeys/integer-indexes.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, compareArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample1 = new TA([42, 42, 42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample1 = new TA(N([42, 42, 42])); var result1 = Reflect.ownKeys(sample1); assert(compareArray(result1, ["0", "1", "2"]), "result1"); diff --git a/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-not-numeric-index.js index 7382d626e72ffeda832f5f67af742b5b7291dfbd..d802d2fd5c7932a5279492c7ffac4ac675c6d5e4 100644 --- a/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-not-numeric-index.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); $DETACHBUFFER(sample.buffer); assert.sameValue(Reflect.set(sample, "foo", "test262"), true); diff --git a/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-symbol.js b/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-symbol.js index 1fbe1b60ca206fe19970237fc56611e2420919f8..18869f683d8f459eb5e46781fb23ea302781a279 100644 --- a/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/Set/detached-buffer-key-is-symbol.js @@ -17,8 +17,8 @@ features: [Symbol, Reflect, TypedArray] var s = Symbol("1"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); $DETACHBUFFER(sample.buffer); assert.sameValue(Reflect.set(sample, s, "test262"), true); diff --git a/test/built-ins/TypedArrays/internals/Set/detached-buffer.js b/test/built-ins/TypedArrays/internals/Set/detached-buffer.js index a373f9fbe3d54becdab8c78655ad782c5893e2af..186259cee4d4b682f40f6af43f6d3fc563ddbffd 100644 --- a/test/built-ins/TypedArrays/internals/Set/detached-buffer.js +++ b/test/built-ins/TypedArrays/internals/Set/detached-buffer.js @@ -25,32 +25,32 @@ includes: [testTypedArray.js, detachArrayBuffer.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); $DETACHBUFFER(sample.buffer); assert.throws(TypeError, function() { - sample[0] = 1; + sample[0] = N(1); }, "valid numeric index"); assert.throws(TypeError, function() { - sample["1.1"] = 1; + sample["1.1"] = N(1); }, "detach buffer runs before checking for 1.1"); assert.throws(TypeError, function() { - sample["-0"] = 1; + sample["-0"] = N(1); }, "detach buffer runs before checking for -0"); assert.throws(TypeError, function() { - sample["-1"] = 1; + sample["-1"] = N(1); }, "detach buffer runs before checking for -1"); assert.throws(TypeError, function() { - sample["1"] = 1; + sample["1"] = N(1); }, "detach buffer runs before checking for key == length"); assert.throws(TypeError, function() { - sample["2"] = 1; + sample["2"] = N(1); }, "detach buffer runs before checking for key > length"); var obj = { diff --git a/test/built-ins/TypedArrays/internals/Set/indexed-value.js b/test/built-ins/TypedArrays/internals/Set/indexed-value.js index 2333d4c44bf56a20e85b2510d3ef5be135ec809a..bb325d11c4e45fb1283f10885ae0cf1dda72a03b 100644 --- a/test/built-ins/TypedArrays/internals/Set/indexed-value.js +++ b/test/built-ins/TypedArrays/internals/Set/indexed-value.js @@ -32,12 +32,12 @@ var throwDesc = { Object.defineProperty(proto, "0", throwDesc); Object.defineProperty(proto, "1", throwDesc); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42, 43]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42, 43])); - assert.sameValue(Reflect.set(sample, "0", 1), true, "sample[0]"); - assert.sameValue(sample[0], 1, "sample[0] value is set"); + assert.sameValue(Reflect.set(sample, "0", N(1)), true, "sample[0]"); + assert.sameValue(sample[0], N(1), "sample[0] value is set"); - assert.sameValue(Reflect.set(sample, "1", 42), true, "sample[1]"); - assert.sameValue(sample[1], 42, "sample[1] value is set"); + assert.sameValue(Reflect.set(sample, "1", N(42)), true, "sample[1]"); + assert.sameValue(sample[1], N(42), "sample[1] value is set"); }); diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-minus-zero.js b/test/built-ins/TypedArrays/internals/Set/key-is-minus-zero.js index a735e8baad35b92f82820cec8ec4a76867f11165..5946ebc7c37d7e30d44db86762513a09c8a95312 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-minus-zero.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-minus-zero.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue(Reflect.set(sample, "-0", 1), false, "-0"); assert.sameValue(sample.hasOwnProperty("-0"), false, "has no property [-0]"); diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-not-canonical-index.js b/test/built-ins/TypedArrays/internals/Set/key-is-not-canonical-index.js index 1fb7a9ec6bc1508d729705eb8216390e932198d4..d89a0f1fb25a7db1611d23ad7f461aa23918fd31 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-not-canonical-index.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-not-canonical-index.js @@ -24,9 +24,9 @@ var keys = [ "0.0000001" ]; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { keys.forEach(function(key) { - var sample = new TA([42]); + var sample = new TA(N([42])); assert.sameValue( Reflect.set(sample, key, "ecma262"), diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-not-integer.js b/test/built-ins/TypedArrays/internals/Set/key-is-not-integer.js index 252220f61d999cf6921e23b68a2c71bc53ad637b..c513faefeef14defcaedc3b4bd993c0ed81c0982 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-not-integer.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-not-integer.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue(Reflect.set(sample, "1.1", 1), false, "1.1"); assert.sameValue(Reflect.set(sample, "0.0001", 1), false, "0.0001"); diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-not-numeric-index.js b/test/built-ins/TypedArrays/internals/Set/key-is-not-numeric-index.js index 462eb752d3436238a1ec39afa9ba437bd8bd135a..03a181965e3ae23748ae457bd7018d5e61237164 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-not-numeric-index.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-not-numeric-index.js @@ -17,8 +17,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue( Reflect.set(sample, "test262", "ecma262"), diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-out-of-bounds.js b/test/built-ins/TypedArrays/internals/Set/key-is-out-of-bounds.js index e5a5d6da854a2ff4396eaf640b97e5c1039db53b..859bdee4f96608cbe82ee44892cd1470fc56dc6f 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-out-of-bounds.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-out-of-bounds.js @@ -24,8 +24,8 @@ includes: [testTypedArray.js] features: [Reflect, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue(Reflect.set(sample, "-1", 1), false, "-1"); assert.sameValue(Reflect.set(sample, "1", 1), false, "1"); diff --git a/test/built-ins/TypedArrays/internals/Set/key-is-symbol.js b/test/built-ins/TypedArrays/internals/Set/key-is-symbol.js index 838ab74e0bbcddf44cf46e5420a675c393fd508d..e27d501c056167c080586a3531b7400189e5caf1 100644 --- a/test/built-ins/TypedArrays/internals/Set/key-is-symbol.js +++ b/test/built-ins/TypedArrays/internals/Set/key-is-symbol.js @@ -18,8 +18,8 @@ features: [Reflect, Symbol, TypedArray] var s1 = Symbol("1"); var s2 = Symbol("2"); -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); assert.sameValue( Reflect.set(sample, s1, "ecma262"), diff --git a/test/built-ins/TypedArrays/internals/Set/tonumber-value-throws.js b/test/built-ins/TypedArrays/internals/Set/tonumber-value-throws.js index 08131f4bf39215edb205dbef0ee83c0def860f03..e90eb47988984d6a2a297db43f1f31e918518614 100644 --- a/test/built-ins/TypedArrays/internals/Set/tonumber-value-throws.js +++ b/test/built-ins/TypedArrays/internals/Set/tonumber-value-throws.js @@ -23,8 +23,8 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var sample = new TA([42]); +testWithTypedArrayConstructors(function(TA, N) { + var sample = new TA(N([42])); var obj = { valueOf: function() { diff --git a/test/built-ins/TypedArrays/length-arg-init-zeros.js b/test/built-ins/TypedArrays/length-arg-init-zeros.js index b361317094d3e4d14f43804a88daaefbc0537e54..384e2399b4306e24a1d4e3aeaa713e52cedf1cec 100644 --- a/test/built-ins/TypedArrays/length-arg-init-zeros.js +++ b/test/built-ins/TypedArrays/length-arg-init-zeros.js @@ -40,16 +40,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var subject = new TA(9); - assert.sameValue(subject[0], 0, 'index 0'); - assert.sameValue(subject[1], 0, 'index 1'); - assert.sameValue(subject[2], 0, 'index 2'); - assert.sameValue(subject[3], 0, 'index 3'); - assert.sameValue(subject[4], 0, 'index 4'); - assert.sameValue(subject[5], 0, 'index 5'); - assert.sameValue(subject[6], 0, 'index 6'); - assert.sameValue(subject[7], 0, 'index 7'); - assert.sameValue(subject[8], 0, 'index 8'); + assert.sameValue(subject[0], N(0), 'index 0'); + assert.sameValue(subject[1], N(0), 'index 1'); + assert.sameValue(subject[2], N(0), 'index 2'); + assert.sameValue(subject[3], N(0), 'index 3'); + assert.sameValue(subject[4], N(0), 'index 4'); + assert.sameValue(subject[5], N(0), 'index 5'); + assert.sameValue(subject[6], N(0), 'index 6'); + assert.sameValue(subject[7], N(0), 'index 7'); + assert.sameValue(subject[8], N(0), 'index 8'); }); diff --git a/test/built-ins/TypedArrays/length-arg-proto-from-ctor-realm.js b/test/built-ins/TypedArrays/length-arg-proto-from-ctor-realm.js index 77cef261627bc415d84998af7aeef55d608ec6eb..f4effc20816086cec9bd64aee9c5a58a6dd9e8f4 100644 --- a/test/built-ins/TypedArrays/length-arg-proto-from-ctor-realm.js +++ b/test/built-ins/TypedArrays/length-arg-proto-from-ctor-realm.js @@ -29,7 +29,7 @@ var other = $262.createRealm().global; var C = new other.Function(); C.prototype = null; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var ta = Reflect.construct(TA, [0], C); assert.sameValue(Object.getPrototypeOf(ta), other[TA.name].prototype); diff --git a/test/built-ins/TypedArrays/object-arg-as-array-returns.js b/test/built-ins/TypedArrays/object-arg-as-array-returns.js index a5e3c3bbc845194f0b07890d3d96be2663189f6f..6e15b4ea4c304dbfa0b04978ffe4cf06ffaab16a 100644 --- a/test/built-ins/TypedArrays/object-arg-as-array-returns.js +++ b/test/built-ins/TypedArrays/object-arg-as-array-returns.js @@ -18,11 +18,11 @@ features: [TypedArray] var obj = [7, 42]; -testWithTypedArrayConstructors(function(TA) { - var typedArray = new TA(obj); +testWithTypedArrayConstructors(function(TA, N) { + var typedArray = new TA(N(obj)); assert.sameValue(typedArray.length, 2); - assert.sameValue(typedArray[0], 7); - assert.sameValue(typedArray[1], 42); + assert.sameValue(typedArray[0], N(7)); + assert.sameValue(typedArray[1], N(42)); assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js b/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js index f9af0defe76e01525dd59de0c4338564411af782..7e2876294245f5ea1c8e7674efa7a87fe4d05164 100644 --- a/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js +++ b/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js @@ -16,15 +16,15 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var obj = (function *() { - yield 7; yield 42; + yield N(7); yield N(42); })(); var typedArray = new TA(obj); assert.sameValue(typedArray.length, 2); - assert.sameValue(typedArray[0], 7); - assert.sameValue(typedArray[1], 42); + assert.sameValue(typedArray[0], N(7)); + assert.sameValue(typedArray[1], N(42)); assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/object-arg-new-instance-extensibility.js b/test/built-ins/TypedArrays/object-arg-new-instance-extensibility.js index 86a2ac837bec2766329afad8d8726fe22e450de0..bd335774b4c5a49faf4effe22a42f6be660cac31 100644 --- a/test/built-ins/TypedArrays/object-arg-new-instance-extensibility.js +++ b/test/built-ins/TypedArrays/object-arg-new-instance-extensibility.js @@ -29,14 +29,14 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -var obj = { - "0": 0, - "1": 1, - "2": 2, - length: 3 -}; - -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { + var obj = { + "0": N(0), + "1": N(1), + "2": N(2), + length: 3 + }; + var sample = new TA(obj); assert(Object.isExtensible(sample)); diff --git a/test/built-ins/TypedArrays/object-arg-returns.js b/test/built-ins/TypedArrays/object-arg-returns.js index 57eec9720cd0ec4b63fadd0f71f060d0cc8a8965..cb06ba2207c3b60778f43d6e081b23350324c032 100644 --- a/test/built-ins/TypedArrays/object-arg-returns.js +++ b/test/built-ins/TypedArrays/object-arg-returns.js @@ -42,4 +42,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(typedArray[1], 0); assert.sameValue(typedArray[4], 0); } -}); +}, + // Cannot create Big*64Arrays from non-safe integers. + numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArrays/object-arg-throws-from-property.js b/test/built-ins/TypedArrays/object-arg-throws-from-property.js index f9d384b5cf242ec6e2df0470b795e1aa7d11ee41..4a0d60825f6b7156d88322f2e3e648175485126d 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-from-property.js +++ b/test/built-ins/TypedArrays/object-arg-throws-from-property.js @@ -31,7 +31,9 @@ Object.defineProperty(obj, "2", { } }); -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { + obj[0] = N(0); + obj[1] = N(0); assert.throws(Test262Error, function() { new TA(obj); }); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive-typeerror.js b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive-typeerror.js index 215bf75fc01570233d3fe7e6e06bbde1648e6c70..3aee05e56603359b2952f8d6b97fddf5121462fb 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive-typeerror.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive-typeerror.js @@ -54,7 +54,7 @@ includes: [testTypedArray.js] features: [Symbol.toPrimitive, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new Int8Array(1); var toPrimitive = 0; var valueOf = 0; @@ -69,7 +69,7 @@ testWithTypedArrayConstructors(function(TA) { }; assert.throws(TypeError, function() { - new TA([8, sample]); + new TA([N(8), sample]); }, "abrupt completion from sample @@toPrimitive"); assert.sameValue(toPrimitive, 1, "toPrimitive was called once"); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive.js b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive.js index 7a7170b6f1de92fcff6181b7185c002a08ecb08d..516586863e5094f8ec5472290a3995a253db4f34 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-to-primitive.js @@ -52,7 +52,7 @@ includes: [testTypedArray.js] features: [Symbol.toPrimitive, TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new Int8Array(1); var toPrimitive = 0; var valueOf = 0; @@ -67,7 +67,7 @@ testWithTypedArrayConstructors(function(TA) { }; assert.throws(Test262Error, function() { - new TA([8, sample]); + new TA([N(8), sample]); }, "abrupt completion from sample @@toPrimitive"); assert.sameValue(toPrimitive, 1, "toPrimitive was called once"); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-tostring.js b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-tostring.js index 482e1159571e1a06c59bb849ddd06a735b56cc34..3e2d84e75b371c5628f8e8803ecbc54a49947869 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-tostring.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-tostring.js @@ -64,7 +64,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new Int8Array(1); var valueOf = 0; var toString = 0; @@ -80,7 +80,7 @@ testWithTypedArrayConstructors(function(TA) { }; assert.throws(Test262Error, function() { - new TA([8, sample]); + new TA([N(8), sample]); }, "abrupt completion from ToNumber(sample)"); assert.sameValue(valueOf, 1, "valueOf called once"); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof-typeerror.js b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof-typeerror.js index 767dd21825299ee6cc5795a9e5616f415531c594..c58fe24252cfa3e5ec8954e907d4fb13253edf4d 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof-typeerror.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof-typeerror.js @@ -65,7 +65,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new Int8Array(1); var valueOf = 0; var toString = 0; @@ -81,7 +81,7 @@ testWithTypedArrayConstructors(function(TA) { }; assert.throws(TypeError, function() { - new TA([8, sample]); + new TA([N(8), sample]); }, "abrupt completion from ToNumber(sample)"); assert.sameValue(valueOf, 1, "valueOf called once"); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof.js b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof.js index f9baf7758facc39c96b53c8a02ebd48912d4597f..ae4515f3497b9746081e138560e6f402f1411dc6 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-obj-valueof.js @@ -65,7 +65,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var sample = new Int8Array(1); var valueOf = 0; @@ -75,7 +75,7 @@ testWithTypedArrayConstructors(function(TA) { }; assert.throws(Test262Error, function() { - new TA([8, sample]); + new TA([N(8), sample]); }, "abrupt completion from ToNumber(sample)"); assert.sameValue(valueOf, 1, "valueOf called once"); diff --git a/test/built-ins/TypedArrays/object-arg-throws-setting-property.js b/test/built-ins/TypedArrays/object-arg-throws-setting-property.js index 93f85dc9820749e571199ac23f03868fd71a7252..489234c901fe2740d163138e2c92dfbe213ac617 100644 --- a/test/built-ins/TypedArrays/object-arg-throws-setting-property.js +++ b/test/built-ins/TypedArrays/object-arg-throws-setting-property.js @@ -31,7 +31,9 @@ var obj = { length: 4 }; -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { + obj[0] = N(0); + obj[1] = N(0); assert.throws(Test262Error, function() { new TA(obj); }); diff --git a/test/built-ins/TypedArrays/of/argument-number-value-throws.js b/test/built-ins/TypedArrays/of/argument-number-value-throws.js index bda57f8cd45f5724fb90b913dc56ec5ec8682e88..3d8a49deddfdfc7da6dacff1bf00922f1f7bb3f1 100644 --- a/test/built-ins/TypedArrays/of/argument-number-value-throws.js +++ b/test/built-ins/TypedArrays/of/argument-number-value-throws.js @@ -16,23 +16,21 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -var lastValue; +testWithTypedArrayConstructors(function(TA, N) { + var lastValue = false; -var obj1 = { - valueOf() { - lastValue = "obj1"; - return 42; - } -}; -var obj2 = { - valueOf() { - lastValue = "obj2"; - throw new Test262Error(); - } -}; - -testWithTypedArrayConstructors(function(TA) { - lastValue = false; + var obj1 = { + valueOf() { + lastValue = "obj1"; + return N(42); + } + }; + var obj2 = { + valueOf() { + lastValue = "obj2"; + throw new Test262Error(); + } + }; assert.throws(Test262Error, function() { TA.of(obj1, obj2, obj1); diff --git a/test/built-ins/TypedArrays/of/custom-ctor-returns-other-instance.js b/test/built-ins/TypedArrays/of/custom-ctor-returns-other-instance.js index e116b1db7e174a5538e02e244df76f2d10338047..6417c73d5eab1603a4b13cf39e5e0a13973e4fc3 100644 --- a/test/built-ins/TypedArrays/of/custom-ctor-returns-other-instance.js +++ b/test/built-ins/TypedArrays/of/custom-ctor-returns-other-instance.js @@ -18,16 +18,16 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var result; var custom = new TA(3); var ctor = function() { return custom; }; - result = TypedArray.of.call(ctor, 1, 2, 3); + result = TypedArray.of.call(ctor, N(1), N(2), N(3)); assert.sameValue(result, custom, "using iterator, same length"); - result = TypedArray.of.call(ctor, 1, 2); + result = TypedArray.of.call(ctor, N(1), N(2)); assert.sameValue(result, custom, "using iterator, higher length"); }); diff --git a/test/built-ins/TypedArrays/of/new-instance-using-custom-ctor.js b/test/built-ins/TypedArrays/of/new-instance-using-custom-ctor.js index 7cc95230eb31a6439572f8a44d481fd55175ecc3..fbcc55b27e6ddd15f29e1c974f8327b4c58eaba9 100644 --- a/test/built-ins/TypedArrays/of/new-instance-using-custom-ctor.js +++ b/test/built-ins/TypedArrays/of/new-instance-using-custom-ctor.js @@ -8,7 +8,7 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { +testWithTypedArrayConstructors(function(TA, N) { var called = 0; var ctor = function(len) { @@ -18,11 +18,11 @@ testWithTypedArrayConstructors(function(TA) { }; - var result = TA.of.call(ctor, 42, 43, 42); + var result = TA.of.call(ctor, N(42), N(43), N(42)); assert.sameValue(result.length, 3); - assert.sameValue(result[0], 42); - assert.sameValue(result[1], 43); - assert.sameValue(result[2], 42); + assert.sameValue(result[0], N(42)); + assert.sameValue(result[1], N(43)); + assert.sameValue(result[2], N(42)); assert.sameValue(result.constructor, TA); assert.sameValue(called, 1); }); diff --git a/test/built-ins/TypedArrays/of/new-instance.js b/test/built-ins/TypedArrays/of/new-instance.js index e83ad648d95dae047ca52502d463cb5ee90b8504..a0fbe0150eaea8e5b5b44f3a6a6336b381c7a71c 100644 --- a/test/built-ins/TypedArrays/of/new-instance.js +++ b/test/built-ins/TypedArrays/of/new-instance.js @@ -23,12 +23,12 @@ includes: [testTypedArray.js] features: [TypedArray] ---*/ -testWithTypedArrayConstructors(function(TA) { - var result = TA.of(42, 43, null); +testWithTypedArrayConstructors(function(TA, N) { + var result = TA.of(N(42), N(43), N(false)); assert.sameValue(result.length, 3); - assert.sameValue(result[0], 42); - assert.sameValue(result[1], 43); - assert.sameValue(result[2], 0); + assert.sameValue(result[0], N(42)); + assert.sameValue(result[1], N(43)); + assert.sameValue(result[2], N(0)); assert.sameValue(result.constructor, TA); assert.sameValue(Object.getPrototypeOf(result), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js index 411248ffd413d2365792dfbf8c6de2ca20ed991f..34cb4dee6841c644e005905e628ef467d427bdda 100644 --- a/test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js +++ b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js @@ -16,9 +16,13 @@ features: [TypedArray] var sample1 = new Int8Array(7); var sample2 = new Int16Array(7); +var sample3 = new BigInt64Array(7); +var sample4 = new BigUint64Array(7); testWithTypedArrayConstructors(function(TA) { - var sample = TA === Int8Array ? sample2 : sample1; + var sample = TA === Int8Array ? sample2 : + TA === BigInt64Array ? sample4 : + TA === BigUint64Array ? sample3 : sample1; var typedArray = new TA(sample); assert.sameValue(typedArray.length, 7); diff --git a/test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js b/test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js index 357730df55210ce2136ce0c3d7bc7a5d348eb087..128ec40217e3ffafc98f605b64122e7fbd9b4553 100644 --- a/test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js +++ b/test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js @@ -28,4 +28,4 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(typedArray.length, len); assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); -}); +}, numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js b/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js index 8af612edcbd527c6a08ad5f20be8cb05ed149990..2745fc5e2512b91f3d11c59f998e727cfc831e4b 100644 --- a/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js +++ b/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js @@ -45,4 +45,4 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); -}); +}, numericTypedArrayConstructors); diff --git a/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js b/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js index b31bd96e4de54ba328c206b61f84ca0dd36c4a03..ec1997e91aba2de918ae9665e7b1bba87be6a457 100644 --- a/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js @@ -44,4 +44,4 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); -}); +}, numericTypedArrayConstructors); diff --git a/test/harness/testTypedArray.js b/test/harness/testTypedArray.js index 066de8eb8c3c395008c46798bfb2a2abd17acea4..bb00168573c706abd0f0a36a051339a115c10205 100644 --- a/test/harness/testTypedArray.js +++ b/test/harness/testTypedArray.js @@ -24,6 +24,12 @@ var TAConstructors = [ Uint8Array, Uint8ClampedArray ]; + +if (typeof BigInt !== "undefined") { + TAConstructors.push(BigInt64Array); + TAConstructors.push(BigUint64Array); +} + var length = TAConstructors.length; assert(