diff --git a/test/built-ins/TypedArrays/buffer-argument-bufferbyteoffset-throws-from-modulo-element-size.js b/test/built-ins/TypedArrays/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-bufferbyteoffset-throws-from-modulo-element-size.js rename to test/built-ins/TypedArrays/buffer-arg-bufferbyteoffset-throws-from-modulo-element-size.js diff --git a/test/built-ins/TypedArrays/buffer-argument-byteoffset-is-negative-throws.js b/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-throws.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-byteoffset-is-negative-throws.js rename to test/built-ins/TypedArrays/buffer-arg-byteoffset-is-negative-throws.js diff --git a/test/built-ins/TypedArrays/buffer-argument-byteoffset-is-symbol-throws.js b/test/built-ins/TypedArrays/buffer-arg-byteoffset-is-symbol-throws.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-byteoffset-is-symbol-throws.js rename to test/built-ins/TypedArrays/buffer-arg-byteoffset-is-symbol-throws.js diff --git a/test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js b/test/built-ins/TypedArrays/buffer-arg-byteoffset-throws-from-modulo-element-size.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js rename to test/built-ins/TypedArrays/buffer-arg-byteoffset-throws-from-modulo-element-size.js diff --git a/test/built-ins/TypedArrays/buffer-argument-byteoffset-to-number-throws.js b/test/built-ins/TypedArrays/buffer-arg-byteoffset-to-number-throws.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-byteoffset-to-number-throws.js rename to test/built-ins/TypedArrays/buffer-arg-byteoffset-to-number-throws.js diff --git a/test/built-ins/TypedArrays/get-prototype-with-buffer-argument-returns-abrupt.js b/test/built-ins/TypedArrays/buffer-arg-custom-proto-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/get-prototype-with-buffer-argument-returns-abrupt.js rename to test/built-ins/TypedArrays/buffer-arg-custom-proto-access-throws.js diff --git a/test/built-ins/TypedArrays/buffer-argument-defined-length-and-offset.js b/test/built-ins/TypedArrays/buffer-arg-defined-length-and-offset.js similarity index 82% rename from test/built-ins/TypedArrays/buffer-argument-defined-length-and-offset.js rename to test/built-ins/TypedArrays/buffer-arg-defined-length-and-offset.js index e305ab731e..0b8f5ff0cd 100644 --- a/test/built-ins/TypedArrays/buffer-argument-defined-length-and-offset.js +++ b/test/built-ins/TypedArrays/buffer-arg-defined-length-and-offset.js @@ -20,16 +20,12 @@ testWithTypedArrayConstructors(function(TA) { var ta1 = new TA(buffer, offset, 2); assert.sameValue(ta1.length, 2, "ta1.length"); assert.sameValue(ta1.buffer, buffer, "ta1.buffer"); - assert.sameValue( - Object.getPrototypeOf(ta1), TA.prototype, - "Object.getPrototypeOf(ta1)" - ); + assert.sameValue(ta1.constructor, TA); + assert.sameValue(Object.getPrototypeOf(ta1), TA.prototype); var ta2 = new TA(buffer, offset, 0); assert.sameValue(ta2.length, 0, "ta2.length"); assert.sameValue(ta2.buffer, buffer, "ta2.buffer"); - assert.sameValue( - Object.getPrototypeOf(ta2), TA.prototype, - "Object.getPrototypeOf(ta2)" - ); + assert.sameValue(ta2.constructor, TA); + assert.sameValue(Object.getPrototypeOf(ta2), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/buffer-argument-defined-length.js b/test/built-ins/TypedArrays/buffer-arg-defined-length.js similarity index 92% rename from test/built-ins/TypedArrays/buffer-argument-defined-length.js rename to test/built-ins/TypedArrays/buffer-arg-defined-length.js index 125c224c9b..f30447bec7 100644 --- a/test/built-ins/TypedArrays/buffer-argument-defined-length.js +++ b/test/built-ins/TypedArrays/buffer-arg-defined-length.js @@ -22,10 +22,12 @@ testWithTypedArrayConstructors(function(TA) { var ta1 = new TA(buffer, 0, length); assert.sameValue(ta1.length, length); assert.sameValue(ta1.buffer, buffer); + assert.sameValue(ta1.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta1), TA.prototype); var ta2 = new TA(buffer, 0, 0); assert.sameValue(ta2.length, 0); assert.sameValue(ta2.buffer, buffer); + assert.sameValue(ta2.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta2), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/buffer-argument-defined-negative-length.js b/test/built-ins/TypedArrays/buffer-arg-defined-negative-length.js similarity index 81% rename from test/built-ins/TypedArrays/buffer-argument-defined-negative-length.js rename to test/built-ins/TypedArrays/buffer-arg-defined-negative-length.js index 8bb321f3da..c1cfec4afc 100644 --- a/test/built-ins/TypedArrays/buffer-argument-defined-negative-length.js +++ b/test/built-ins/TypedArrays/buffer-arg-defined-negative-length.js @@ -16,26 +16,29 @@ includes: [testTypedArray.js] testWithTypedArrayConstructors(function(TA) { var bpe = TA.BYTES_PER_ELEMENT; - var length = 4; - var buffer = new ArrayBuffer(bpe * length * 4); + var buffer = new ArrayBuffer(bpe * 2); var ta1 = new TA(buffer, 0, -1); assert.sameValue(ta1.length, 0); assert.sameValue(ta1.buffer, buffer); + assert.sameValue(ta1.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta1), TA.prototype); var ta2 = new TA(buffer, 0, -Infinity); assert.sameValue(ta2.length, 0); assert.sameValue(ta2.buffer, buffer); + assert.sameValue(ta2.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta2), TA.prototype); - var ta3 = new TA(buffer, 8, -1); + var ta3 = new TA(buffer, bpe, -1); assert.sameValue(ta3.length, 0); assert.sameValue(ta3.buffer, buffer); + assert.sameValue(ta3.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta3), TA.prototype); - var ta4 = new TA(buffer, 8, -Infinity); + var ta4 = new TA(buffer, bpe, -Infinity); assert.sameValue(ta4.length, 0); assert.sameValue(ta4.buffer, buffer); + assert.sameValue(ta4.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta4), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/buffer-argument-defined-offset.js b/test/built-ins/TypedArrays/buffer-arg-defined-offset.js similarity index 92% rename from test/built-ins/TypedArrays/buffer-argument-defined-offset.js rename to test/built-ins/TypedArrays/buffer-arg-defined-offset.js index bc7e49fc68..82d28924bd 100644 --- a/test/built-ins/TypedArrays/buffer-argument-defined-offset.js +++ b/test/built-ins/TypedArrays/buffer-arg-defined-offset.js @@ -20,10 +20,12 @@ testWithTypedArrayConstructors(function(TA) { var ta1 = new TA(buffer, bpe * 2); assert.sameValue(ta1.length, 2); assert.sameValue(ta1.buffer, buffer); + assert.sameValue(ta1.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta1), TA.prototype); var ta2 = new TA(buffer, 0); assert.sameValue(ta2.length, 4); assert.sameValue(ta2.buffer, buffer); + assert.sameValue(ta2.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta2), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/buffer-argument-excessive-length-throws.js b/test/built-ins/TypedArrays/buffer-arg-excessive-length-throws.js similarity index 89% rename from test/built-ins/TypedArrays/buffer-argument-excessive-length-throws.js rename to test/built-ins/TypedArrays/buffer-arg-excessive-length-throws.js index 439b550879..7313edf2b1 100644 --- a/test/built-ins/TypedArrays/buffer-argument-excessive-length-throws.js +++ b/test/built-ins/TypedArrays/buffer-arg-excessive-length-throws.js @@ -20,10 +20,11 @@ info: > includes: [testTypedArray.js] ---*/ -var buffer = new ArrayBuffer(8); - testWithTypedArrayConstructors(function(TA) { + var bpe = TA.BYTES_PER_ELEMENT; + var buffer = new ArrayBuffer(bpe); + assert.throws(RangeError, function() { - new TA(buffer, 0, 16); + new TA(buffer, 0, bpe * 2); }); }); diff --git a/test/built-ins/TypedArrays/buffer-argument-excessive-offset-throws.js b/test/built-ins/TypedArrays/buffer-arg-excessive-offset-throws.js similarity index 87% rename from test/built-ins/TypedArrays/buffer-argument-excessive-offset-throws.js rename to test/built-ins/TypedArrays/buffer-arg-excessive-offset-throws.js index 9270c51ebc..26c12c27ef 100644 --- a/test/built-ins/TypedArrays/buffer-argument-excessive-offset-throws.js +++ b/test/built-ins/TypedArrays/buffer-arg-excessive-offset-throws.js @@ -20,14 +20,15 @@ info: > includes: [testTypedArray.js] ---*/ -var buffer = new ArrayBuffer(8); - testWithTypedArrayConstructors(function(TA) { + var bpe = TA.BYTES_PER_ELEMENT; + var buffer = new ArrayBuffer(bpe); + assert.throws(RangeError, function() { - new TA(buffer, 16); + new TA(buffer, bpe * 2); }); assert.throws(RangeError, function() { - new TA(buffer, 16, undefined); + new TA(buffer, bpe * 2, undefined); }); }); diff --git a/test/built-ins/TypedArrays/undefined-newtarget-invoked-with-arraybuffer.js b/test/built-ins/TypedArrays/buffer-arg-invoked-with-undefined-newtarget.js similarity index 100% rename from test/built-ins/TypedArrays/undefined-newtarget-invoked-with-arraybuffer.js rename to test/built-ins/TypedArrays/buffer-arg-invoked-with-undefined-newtarget.js diff --git a/test/built-ins/TypedArrays/buffer-argument-is-referenced.js b/test/built-ins/TypedArrays/buffer-arg-is-referenced.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-is-referenced.js rename to test/built-ins/TypedArrays/buffer-arg-is-referenced.js diff --git a/test/built-ins/TypedArrays/buffer-argument-returns-abrupt-from-length.js b/test/built-ins/TypedArrays/buffer-arg-length-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-returns-abrupt-from-length.js rename to test/built-ins/TypedArrays/buffer-arg-length-access-throws.js diff --git a/test/built-ins/TypedArrays/buffer-argument-returns-abrupt-from-length-symbol.js b/test/built-ins/TypedArrays/buffer-arg-length-is-symbol-throws.js similarity index 100% rename from test/built-ins/TypedArrays/buffer-argument-returns-abrupt-from-length-symbol.js rename to test/built-ins/TypedArrays/buffer-arg-length-is-symbol-throws.js diff --git a/test/built-ins/TypedArrays/buffer-single-argument-single.js b/test/built-ins/TypedArrays/buffer-arg-returns-new-instance.js similarity index 87% rename from test/built-ins/TypedArrays/buffer-single-argument-single.js rename to test/built-ins/TypedArrays/buffer-arg-returns-new-instance.js index 62892b4c36..2fcbf0a6fa 100644 --- a/test/built-ins/TypedArrays/buffer-single-argument-single.js +++ b/test/built-ins/TypedArrays/buffer-arg-returns-new-instance.js @@ -3,7 +3,7 @@ /*--- id: sec-typedarray-buffer-byteoffset-length description: > - Return new typedArray from undefined defined offset + Return new typedArray from undefined offset and length info: > 22.2.4.5 TypedArray ( buffer [ , byteOffset [ , length ] ] ) @@ -20,11 +20,13 @@ testWithTypedArrayConstructors(function(TA) { var ta1 = new TA(buffer1); assert.sameValue(ta1.length, 4); assert.sameValue(ta1.buffer, buffer1); + assert.sameValue(ta1.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta1), TA.prototype); var buffer2 = new ArrayBuffer(0); var ta2 = new TA(buffer2); assert.sameValue(ta2.length, 0); assert.sameValue(ta2.buffer, buffer2); + assert.sameValue(ta2.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta2), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-object.js b/test/built-ins/TypedArrays/buffer-arg-use-custom-proto-if-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-object.js rename to test/built-ins/TypedArrays/buffer-arg-use-custom-proto-if-object.js index e4efc7980a..2dc855cd9c 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-object.js +++ b/test/built-ins/TypedArrays/buffer-arg-use-custom-proto-if-object.js @@ -43,5 +43,6 @@ newTarget.prototype = proto; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [buffer], newTarget); + assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-not-object.js b/test/built-ins/TypedArrays/buffer-arg-use-default-proto-if-custom-proto-is-not-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-not-object.js rename to test/built-ins/TypedArrays/buffer-arg-use-default-proto-if-custom-proto-is-not-object.js index db24d0bedd..ea90fbd350 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-buffer-argument-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/buffer-arg-use-default-proto-if-custom-proto-is-not-object.js @@ -41,5 +41,6 @@ newTarget.prototype = null; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [buffer], newTarget); + assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-length-argument-returns-abrupt.js b/test/built-ins/TypedArrays/length-arg-custom-proto-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/get-prototype-with-length-argument-returns-abrupt.js rename to test/built-ins/TypedArrays/length-arg-custom-proto-access-throws.js diff --git a/test/built-ins/TypedArrays/length-is-float-throws-rangeerror.js b/test/built-ins/TypedArrays/length-arg-is-float-throws-rangeerror.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-float-throws-rangeerror.js rename to test/built-ins/TypedArrays/length-arg-is-float-throws-rangeerror.js diff --git a/test/built-ins/TypedArrays/length-is-infinity-throws-rangeerror.js b/test/built-ins/TypedArrays/length-arg-is-infinity-throws-rangeerror.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-infinity-throws-rangeerror.js rename to test/built-ins/TypedArrays/length-arg-is-infinity-throws-rangeerror.js diff --git a/test/built-ins/TypedArrays/length-is-nan-throws-rangeerror.js b/test/built-ins/TypedArrays/length-arg-is-nan-throws-rangeerror.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-nan-throws-rangeerror.js rename to test/built-ins/TypedArrays/length-arg-is-nan-throws-rangeerror.js diff --git a/test/built-ins/TypedArrays/length-is-negative-number-throws-rangeerror.js b/test/built-ins/TypedArrays/length-arg-is-negative-number-throws-rangeerror.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-negative-number-throws-rangeerror.js rename to test/built-ins/TypedArrays/length-arg-is-negative-number-throws-rangeerror.js diff --git a/test/built-ins/TypedArrays/length-is-not-valid-buffer-size-throws-rangeerror.js b/test/built-ins/TypedArrays/length-arg-is-not-valid-buffer-size-throws-rangeerror.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-not-valid-buffer-size-throws-rangeerror.js rename to test/built-ins/TypedArrays/length-arg-is-not-valid-buffer-size-throws-rangeerror.js diff --git a/test/built-ins/TypedArrays/length-is-symbol-throws.js b/test/built-ins/TypedArrays/length-arg-is-symbol-throws.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-symbol-throws.js rename to test/built-ins/TypedArrays/length-arg-is-symbol-throws.js diff --git a/test/built-ins/TypedArrays/length-is-undefined-throws.js b/test/built-ins/TypedArrays/length-arg-is-undefined-throws.js similarity index 100% rename from test/built-ins/TypedArrays/length-is-undefined-throws.js rename to test/built-ins/TypedArrays/length-arg-is-undefined-throws.js diff --git a/test/built-ins/TypedArrays/length-arg-minus-signal-zero.js b/test/built-ins/TypedArrays/length-arg-minus-signal-zero.js new file mode 100644 index 0000000000..56e685150f --- /dev/null +++ b/test/built-ins/TypedArrays/length-arg-minus-signal-zero.js @@ -0,0 +1,28 @@ +// Copyright (C) 2016 the V8 project authors. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. +/*--- +id: sec-typedarray-length +description: > + Does not throw when length is -0 +info: > + 22.2.4.2 TypedArray ( length ) + + This description applies only if the TypedArray function is called with at + least one argument and the Type of the first argument is not Object. + + ... + 4. Let numberLength be ? ToNumber(length). + 5. Let elementLength be ToLength(numberLength). + 6. If SameValueZero(numberLength, elementLength) is false, throw a RangeError + exception. + ... +includes: [testTypedArray.js] +---*/ + +testWithTypedArrayConstructors(function(TA) { + var typedArray = new TA(-0); + + assert.sameValue(typedArray.length, 0, "length"); + assert.sameValue(typedArray.constructor, TA); + assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); +}); diff --git a/test/built-ins/TypedArrays/called-with-length-return-object.js b/test/built-ins/TypedArrays/length-arg-returns-object.js similarity index 88% rename from test/built-ins/TypedArrays/called-with-length-return-object.js rename to test/built-ins/TypedArrays/length-arg-returns-object.js index 4ee88b9f3b..0b12fc0c72 100644 --- a/test/built-ins/TypedArrays/called-with-length-return-object.js +++ b/test/built-ins/TypedArrays/length-arg-returns-object.js @@ -28,8 +28,5 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(length, 4, "length"); assert.sameValue(typedArray.constructor, TA); - assert.sameValue( - Object.getPrototypeOf(typedArray), TA.prototype, - "Object.getPrototypeOf(typedArray)" - ); + assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/undefined-newtarget-invoked-with-length.js b/test/built-ins/TypedArrays/length-arg-undefined-newtarget-throws.js similarity index 100% rename from test/built-ins/TypedArrays/undefined-newtarget-invoked-with-length.js rename to test/built-ins/TypedArrays/length-arg-undefined-newtarget-throws.js diff --git a/test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-object.js b/test/built-ins/TypedArrays/length-arg-use-custom-proto-if-object.js similarity index 96% rename from test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-object.js rename to test/built-ins/TypedArrays/length-arg-use-custom-proto-if-object.js index aa3faf6b87..23689ffd02 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-object.js +++ b/test/built-ins/TypedArrays/length-arg-use-custom-proto-if-object.js @@ -39,5 +39,6 @@ newTarget.prototype = proto; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [1], newTarget); + assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-not-object.js b/test/built-ins/TypedArrays/length-arg-use-default-proto-if-custom-proto-is-not-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-not-object.js rename to test/built-ins/TypedArrays/length-arg-use-default-proto-if-custom-proto-is-not-object.js index 7276dbfb14..b805c76599 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-length-argument-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/length-arg-use-default-proto-if-custom-proto-is-not-object.js @@ -37,5 +37,6 @@ newTarget.prototype = null; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [1], newTarget); + assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-no-arguments-returns-abrupt.js b/test/built-ins/TypedArrays/no-args-custom-proto-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/get-prototype-with-no-arguments-returns-abrupt.js rename to test/built-ins/TypedArrays/no-args-custom-proto-access-throws.js diff --git a/test/built-ins/TypedArrays/called-with-no-arguments-return-object.js b/test/built-ins/TypedArrays/no-args-returns-object.js similarity index 100% rename from test/built-ins/TypedArrays/called-with-no-arguments-return-object.js rename to test/built-ins/TypedArrays/no-args-returns-object.js diff --git a/test/built-ins/TypedArrays/undefined-newtarget-invoked-with-no-arguments.js b/test/built-ins/TypedArrays/no-args-undefined-newtarget-throws.js similarity index 100% rename from test/built-ins/TypedArrays/undefined-newtarget-invoked-with-no-arguments.js rename to test/built-ins/TypedArrays/no-args-undefined-newtarget-throws.js diff --git a/test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-object.js b/test/built-ins/TypedArrays/no-args-use-custom-proto-if-object.js similarity index 96% rename from test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-object.js rename to test/built-ins/TypedArrays/no-args-use-custom-proto-if-object.js index 779775fb80..a2a645fa6b 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-object.js +++ b/test/built-ins/TypedArrays/no-args-use-custom-proto-if-object.js @@ -39,5 +39,6 @@ newTarget.prototype = proto; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [], newTarget); + assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-not-object.js b/test/built-ins/TypedArrays/no-args-use-default-proto-if-custom-proto-is-not-object.js similarity index 96% rename from test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-not-object.js rename to test/built-ins/TypedArrays/no-args-use-default-proto-if-custom-proto-is-not-object.js index 2cb363d3aa..c56e8f20a0 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-no-arguments-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/no-args-use-default-proto-if-custom-proto-is-not-object.js @@ -37,5 +37,6 @@ newTarget.prototype = null; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [], newTarget); + assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/object-argument-as-array-returns.js b/test/built-ins/TypedArrays/object-arg-as-array-returns.js similarity index 94% rename from test/built-ins/TypedArrays/object-argument-as-array-returns.js rename to test/built-ins/TypedArrays/object-arg-as-array-returns.js index eca1a8eae9..8c532e2b7b 100644 --- a/test/built-ins/TypedArrays/object-argument-as-array-returns.js +++ b/test/built-ins/TypedArrays/object-arg-as-array-returns.js @@ -22,5 +22,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(typedArray.length, 2); assert.sameValue(typedArray[0], 7); assert.sameValue(typedArray[1], 42); + assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/object-argument-as-generator-iterable-returns.js b/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js similarity index 94% rename from test/built-ins/TypedArrays/object-argument-as-generator-iterable-returns.js rename to test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js index 1ce0a86936..2837e91e5a 100644 --- a/test/built-ins/TypedArrays/object-argument-as-generator-iterable-returns.js +++ b/test/built-ins/TypedArrays/object-arg-as-generator-iterable-returns.js @@ -24,5 +24,6 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(typedArray.length, 2); assert.sameValue(typedArray[0], 7); assert.sameValue(typedArray[1], 42); + assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-object-argument-returns-abrupt.js b/test/built-ins/TypedArrays/object-arg-custom-proto-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/get-prototype-with-object-argument-returns-abrupt.js rename to test/built-ins/TypedArrays/object-arg-custom-proto-access-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-iterating-throws.js b/test/built-ins/TypedArrays/object-arg-iterating-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-iterating-throws.js rename to test/built-ins/TypedArrays/object-arg-iterating-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-iterator-not-callable-throws.js b/test/built-ins/TypedArrays/object-arg-iterator-not-callable-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-iterator-not-callable-throws.js rename to test/built-ins/TypedArrays/object-arg-iterator-not-callable-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-iterator-throws.js b/test/built-ins/TypedArrays/object-arg-iterator-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-iterator-throws.js rename to test/built-ins/TypedArrays/object-arg-iterator-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-length-excessive-throws.js b/test/built-ins/TypedArrays/object-arg-length-excessive-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-length-excessive-throws.js rename to test/built-ins/TypedArrays/object-arg-length-excessive-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-length-is-symbol-throws.js b/test/built-ins/TypedArrays/object-arg-length-is-symbol-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-length-is-symbol-throws.js rename to test/built-ins/TypedArrays/object-arg-length-is-symbol-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-length-throws.js b/test/built-ins/TypedArrays/object-arg-length-throws.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-length-throws.js rename to test/built-ins/TypedArrays/object-arg-length-throws.js diff --git a/test/built-ins/TypedArrays/object-argument-returns.js b/test/built-ins/TypedArrays/object-arg-returns.js similarity index 93% rename from test/built-ins/TypedArrays/object-argument-returns.js rename to test/built-ins/TypedArrays/object-arg-returns.js index 97d86287dd..6ac5b219a8 100644 --- a/test/built-ins/TypedArrays/object-argument-returns.js +++ b/test/built-ins/TypedArrays/object-arg-returns.js @@ -27,11 +27,12 @@ var obj = { testWithTypedArrayConstructors(function(TA) { var typedArray = new TA(obj); - assert.sameValue(typedArray.length, 4); + assert.sameValue(typedArray.length, 5); assert.sameValue(typedArray[0], 0); assert.sameValue(typedArray[2], 42); assert.sameValue(typedArray[3], 7); assert.sameValue(typedArray[5], undefined); + assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); if (TA === Float32Array || TA === Float64Array) { diff --git a/test/built-ins/TypedArrays/object-argument-throws-from-property.js b/test/built-ins/TypedArrays/object-arg-throws-from-property.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-throws-from-property.js rename to test/built-ins/TypedArrays/object-arg-throws-from-property.js diff --git a/test/built-ins/TypedArrays/object-argument-throws-setting-property.js b/test/built-ins/TypedArrays/object-arg-throws-setting-property.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-throws-setting-property.js rename to test/built-ins/TypedArrays/object-arg-throws-setting-property.js diff --git a/test/built-ins/TypedArrays/object-argument-throws-setting-symbol-property.js b/test/built-ins/TypedArrays/object-arg-throws-setting-symbol-property.js similarity index 100% rename from test/built-ins/TypedArrays/object-argument-throws-setting-symbol-property.js rename to test/built-ins/TypedArrays/object-arg-throws-setting-symbol-property.js diff --git a/test/built-ins/TypedArrays/undefined-newtarget-invoked-with-object.js b/test/built-ins/TypedArrays/object-arg-undefined-newtarget-throws.js similarity index 100% rename from test/built-ins/TypedArrays/undefined-newtarget-invoked-with-object.js rename to test/built-ins/TypedArrays/object-arg-undefined-newtarget-throws.js diff --git a/test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-object.js b/test/built-ins/TypedArrays/object-arg-use-custom-proto-if-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-object.js rename to test/built-ins/TypedArrays/object-arg-use-custom-proto-if-object.js index 92c12d6f0f..1596d8d08e 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-object.js +++ b/test/built-ins/TypedArrays/object-arg-use-custom-proto-if-object.js @@ -42,5 +42,6 @@ newTarget.prototype = proto; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [], newTarget); + assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-not-object.js b/test/built-ins/TypedArrays/object-arg-use-default-proto-if-custom-proto-is-not-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-not-object.js rename to test/built-ins/TypedArrays/object-arg-use-default-proto-if-custom-proto-is-not-object.js index b2adc26a1b..c8c7acfc42 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-object-argument-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/object-arg-use-default-proto-if-custom-proto-is-not-object.js @@ -41,5 +41,6 @@ var o = []; testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [o], newTarget); + assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-returns-abrupt.js b/test/built-ins/TypedArrays/typedarray-arg-custom-proto-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-returns-abrupt.js rename to test/built-ins/TypedArrays/typedarray-arg-custom-proto-access-throws.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-get-constructor.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-access-throws.js similarity index 98% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-get-constructor.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-access-throws.js index 59483279f8..06ccdda33d 100644 --- a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-get-constructor.js +++ b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-access-throws.js @@ -30,7 +30,7 @@ testWithTypedArrayConstructors(function(TA) { var sample = new (TA === Int8Array ? sample2 : sample1); Object.defineProperty(sample.buffer, "constructor", { - get: function() { + get() { throw new Test262Error(); } }); diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-custom.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-custom-species.js similarity index 92% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-custom.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-custom-species.js index 240a2b58c7..14436bf552 100644 --- a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-custom.js +++ b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-custom-species.js @@ -46,7 +46,7 @@ testWithTypedArrayConstructors(function(TA) { ctor[Symbol.species].prototype = custom; - var tarray = new TA(sample); - assert.sameValue(Object.getPrototypeOf(tarray.buffer), custom); + var typedArray = new TA(sample); + assert.sameValue(Object.getPrototypeOf(typedArray.buffer), custom); assert.sameValue(called, 0); }); diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-not-object-throws.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-not-object-throws.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-species.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-species.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-access-throws.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-not-ctor-throws.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-not-ctor-throws.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-null.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-null.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-null.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-null.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-prototype-abrupt.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-prototype-throws.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-prototype-abrupt.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-prototype-throws.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-undefined.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-undefined.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-undefined.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-buffer-ctor-species-undefined.js diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-returns-new-typedarray.js b/test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js similarity index 100% rename from test/built-ins/TypedArrays/other-typedarray-ctor-argument-returns-new-typedarray.js rename to test/built-ins/TypedArrays/typedarray-arg-other-ctor-returns-new-typedarray.js diff --git a/test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js b/test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js similarity index 100% rename from test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js rename to test/built-ins/TypedArrays/typedarray-arg-returns-new-instance.js diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-get-constructor.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-access-throws.js similarity index 100% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-get-constructor.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-access-throws.js diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-custom.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-custom.js similarity index 93% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-custom.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-custom.js index 5189f01b20..09053c47d0 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-custom.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-custom.js @@ -54,7 +54,7 @@ testWithTypedArrayConstructors(function(TA) { ctor[Symbol.species].prototype = custom; - var tarray = new TA(sample); - assert.sameValue(Object.getPrototypeOf(tarray.buffer), custom); + var typedArray = new TA(sample); + assert.sameValue(Object.getPrototypeOf(typedArray.buffer), custom); assert.sameValue(called, 0); }); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-not-ctor.js similarity index 96% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-not-ctor.js index 1f0414068b..163c155e96 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-not-ctor.js @@ -37,11 +37,11 @@ features: [Symbol.species] testWithTypedArrayConstructors(function(TA) { var sample = new TA(); var ctor = {}; - var o = { m() {} }; + var m = { m() {} }; sample.buffer.constructor = ctor; - ctor[Symbol.species] = o.m; + ctor[Symbol.species] = m; assert.throws(TypeError, function() { new TA(sample); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-null.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-null.js similarity index 100% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-null.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-null.js diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-prototype-abrupt.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-prototype-throws.js similarity index 98% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-prototype-abrupt.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-prototype-throws.js index 5eace03d87..fa60b0d58c 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-prototype-abrupt.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-prototype-throws.js @@ -51,7 +51,7 @@ testWithTypedArrayConstructors(function(TA) { ctor[Symbol.species] = function(){}.bind(null); Object.defineProperty(ctor[Symbol.species], "prototype", { - get: function() { + get() { throw new Test262Error(); } }); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-species.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-throws.js similarity index 98% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-species.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-throws.js index 04de7110ee..1ed0a51461 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-species.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-throws.js @@ -38,7 +38,7 @@ testWithTypedArrayConstructors(function(TA) { sample.buffer.constructor = ctor; Object.defineProperty(ctor, Symbol.species, { - get: function() { + get() { throw new Test262Error(); } }); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-undefined.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-undefined.js similarity index 94% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-undefined.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-undefined.js index e07620e5d1..4fbdb7dce4 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-ctor-species-undefined.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-species-undefined.js @@ -40,9 +40,9 @@ testWithTypedArrayConstructors(function(TA) { sample.buffer.constructor = ctor; ctor[Symbol.species] = undefined; - var a = new TA(sample); + var typedArray = new TA(sample); assert.sameValue( - Object.getPrototypeOf(a.buffer), + Object.getPrototypeOf(typedArray.buffer), ArrayBuffer.prototype, "buffer ctor is not called when species is undefined" ); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-value-not-obj-throws.js similarity index 69% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-value-not-obj-throws.js index f85aa5da7a..6309a97ef3 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js +++ b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-buffer-ctor-value-not-obj-throws.js @@ -36,58 +36,29 @@ features: [Symbol] testWithTypedArrayConstructors(function(TA) { var sample = new TA(); - Object.defineProperty(sample.buffer, "constructor", { - get: function() { - return 1; - }, - configurable: true - }); + sample.buffer.constructor = 1; assert.throws(TypeError, function() { new TA(sample); }); - Object.defineProperty(sample.buffer, "constructor", { - get: function() { - return true; - }, - configurable: true - }); - + sample.buffer.constructor = true; assert.throws(TypeError, function() { new TA(sample); }); - Object.defineProperty(sample.buffer, "constructor", { - get: function() { - return ''; - }, - configurable: true - }); - + sample.buffer.constructor = ''; assert.throws(TypeError, function() { new TA(sample); }); - Object.defineProperty(sample.buffer, "constructor", { - get: function() { - return null; - }, - configurable: true - }); - + sample.buffer.constructor = null; assert.throws(TypeError, function() { new TA(sample); }); var s = Symbol('1'); - Object.defineProperty(sample.buffer, "constructor", { - get: function() { - return s; - }, - configurable: true - }); - + sample.buffer.constructor = s; assert.throws(TypeError, function() { new TA(sample); }); diff --git a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-returns-new-cloned-typedarray.js b/test/built-ins/TypedArrays/typedarray-arg-same-ctor-returns-new-cloned-typedarray.js similarity index 100% rename from test/built-ins/TypedArrays/same-typedarray-ctor-argument-returns-new-cloned-typedarray.js rename to test/built-ins/TypedArrays/typedarray-arg-same-ctor-returns-new-cloned-typedarray.js diff --git a/test/built-ins/TypedArrays/undefined-newtarget-invoked-with-typedarray.js b/test/built-ins/TypedArrays/typedarray-arg-undefined-newtarget-throws.js similarity index 100% rename from test/built-ins/TypedArrays/undefined-newtarget-invoked-with-typedarray.js rename to test/built-ins/TypedArrays/typedarray-arg-undefined-newtarget-throws.js diff --git a/test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-object.js b/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js similarity index 96% rename from test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-object.js rename to test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js index 0aae23913b..9a558e875f 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-object.js +++ b/test/built-ins/TypedArrays/typedarray-arg-use-custom-proto-if-object.js @@ -43,5 +43,6 @@ var sample = new Int8Array(8); testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [sample], newTarget); + assert.sameValue(ta.constructor, Object); assert.sameValue(Object.getPrototypeOf(ta), proto); }); diff --git a/test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-not-object.js b/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js similarity index 97% rename from test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-not-object.js rename to test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js index f9788039ce..f8248f39d8 100644 --- a/test/built-ins/TypedArrays/get-prototype-with-typedarray-argument-proto-is-not-object.js +++ b/test/built-ins/TypedArrays/typedarray-arg-use-default-proto-if-custom-proto-is-not-object.js @@ -41,5 +41,6 @@ var sample = new Int8Array(8); testWithTypedArrayConstructors(function(TA) { var ta = Reflect.construct(TA, [sample], newTarget); + assert.sameValue(ta.constructor, TA); assert.sameValue(Object.getPrototypeOf(ta), TA.prototype); });