diff --git a/test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js b/test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js index 6bab1c7e1e..0f0819e0ce 100644 --- a/test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js +++ b/test/built-ins/TypedArrays/buffer-argument-byteoffset-throws-from-modulo-element-size.js @@ -12,7 +12,7 @@ info: > object has an [[ArrayBufferData]] internal slot. ... - 9. If offset modulo elementSize ≠ 0, throw a RangeError exception. + 10. If offset modulo elementSize ≠ 0, throw a RangeError exception. ... includes: [testTypedArray.js] ---*/ diff --git a/test/built-ins/TypedArrays/buffer-argument-is-referenced.js b/test/built-ins/TypedArrays/buffer-argument-is-referenced.js index ef331db521..d9fbc5ead5 100644 --- a/test/built-ins/TypedArrays/buffer-argument-is-referenced.js +++ b/test/built-ins/TypedArrays/buffer-argument-is-referenced.js @@ -20,10 +20,12 @@ includes: [testTypedArray.js] testWithTypedArrayConstructors(function(TA) { var bpe = TA.BYTES_PER_ELEMENT; - var buffer = new ArrayBuffer(bpe * 4); + var buffer = new ArrayBuffer(bpe); var ta1 = new TA(buffer); var ta2 = new TA(buffer); + assert.sameValue(ta1.buffer, buffer); + assert.sameValue(ta2.buffer, buffer); assert.sameValue(ta1.buffer, ta2.buffer); }); diff --git a/test/built-ins/TypedArrays/called-with-length-return-object.js b/test/built-ins/TypedArrays/called-with-length-return-object.js index 669c113550..4ee88b9f3b 100644 --- a/test/built-ins/TypedArrays/called-with-length-return-object.js +++ b/test/built-ins/TypedArrays/called-with-length-return-object.js @@ -24,10 +24,10 @@ includes: [testTypedArray.js] testWithTypedArrayConstructors(function(TA) { var typedArray = new TA(4); - var bytesPerElement = TA.BYTES_PER_ELEMENT; var length = typedArray.length; assert.sameValue(length, 4, "length"); + assert.sameValue(typedArray.constructor, TA); assert.sameValue( Object.getPrototypeOf(typedArray), TA.prototype, "Object.getPrototypeOf(typedArray)" diff --git a/test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js b/test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js index 232692fb69..6971dfcb18 100644 --- a/test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js +++ b/test/built-ins/TypedArrays/called-with-typedarray-return-new-instance.js @@ -22,7 +22,6 @@ var typedArraySample = new Int8Array(length); testWithTypedArrayConstructors(function(TA) { var typedArray = new TA(typedArraySample); - var bytesPerElement = TA.BYTES_PER_ELEMENT; assert.notSameValue(typedArray, typedArraySample); assert.sameValue(typedArray.length, length); diff --git a/test/built-ins/TypedArrays/object-argument-length-excessive-throws.js b/test/built-ins/TypedArrays/object-argument-length-excessive-throws.js index 1f802c2dd6..f1d3034155 100644 --- a/test/built-ins/TypedArrays/object-argument-length-excessive-throws.js +++ b/test/built-ins/TypedArrays/object-argument-length-excessive-throws.js @@ -16,7 +16,6 @@ info: > 6. Perform ? AllocateTypedArrayBuffer(O, len). ... includes: [testTypedArray.js] -features: [Symbol] ---*/ var obj = { diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js b/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js index c8721e25c5..b082b0439d 100644 --- a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js +++ b/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-ctor-species-not-ctor.js @@ -30,15 +30,17 @@ features: [Symbol.species] var sample1 = new Int8Array(); var sample2 = new Int16Array(); +var ctor = function() { + throw new Test262Error(); +}; +var m = { m() {} }.m; +ctor[Symbol.species] = m; + testWithTypedArrayConstructors(function(TA) { var sample = TA === Int8Array ? sample2 : sample1; - var ctor = {}; - var o = { m() {} }; sample.buffer.constructor = ctor; - ctor[Symbol.species] = o.m; - assert.throws(TypeError, function() { new TA(sample); }); diff --git a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js b/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js index 5055fa2f84..5ceb8d3686 100644 --- a/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js +++ b/test/built-ins/TypedArrays/other-typedarray-ctor-argument-buffer-returns-abrupt-from-constructor-value.js @@ -32,58 +32,29 @@ var sample2 = new Int16Array(); testWithTypedArrayConstructors(function(TA) { var sample = TA === Int8Array ? sample2 : sample1; - 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 - }); - + var s = Symbol("1"); + 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/same-typedarray-ctor-argument-returns-new-cloned-typedarray.js index 4f67a1b930..5d78db9db2 100644 --- a/test/built-ins/TypedArrays/same-typedarray-ctor-argument-returns-new-cloned-typedarray.js +++ b/test/built-ins/TypedArrays/same-typedarray-ctor-argument-returns-new-cloned-typedarray.js @@ -25,5 +25,7 @@ testWithTypedArrayConstructors(function(TA) { assert.sameValue(typedArray.length, 7); assert.notSameValue(typedArray, sample); + assert.notSameValue(typedArray.buffer, sample.buffer); + assert.sameValue(typedArray.constructor, TA); assert.sameValue(Object.getPrototypeOf(typedArray), TA.prototype); });