Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [BigInt, Symbol.toStringTag, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample[Symbol.toStringTag], TA.name);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ includes: [testTypedArray.js]
features: [BigInt, Symbol.toStringTag, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var ta = new TA();
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var ta = new TA(makeCtorArg(0));
assert.sameValue(ta[Symbol.toStringTag], TA.name, "property value");
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [Symbol.toStringTag, TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample[Symbol.toStringTag], TA.name);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ includes: [testTypedArray.js]
features: [Symbol.toStringTag, TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var ta = new TA();
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var ta = new TA(makeCtorArg(0));
assert.sameValue(ta[Symbol.toStringTag], TA.name, "property value");
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(8);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(8);
var sample = new TA(buffer, 0, 1);
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.buffer, buffer);
}, null, ["passthrough"]);
}, null, ["arraybuffer"], ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ includes: [testTypedArray.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(1);
var ta = new TA(buffer);

assert.sameValue(ta.buffer, buffer);
}, null, ["passthrough"]);
}, null, ["arraybuffer"]);
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(8);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(8);
var sample = new TA(buffer, 0, 1);
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.buffer, buffer);
}, null, ["passthrough"]);
}, null, ["arraybuffer"], ["immutable"]);
6 changes: 3 additions & 3 deletions test/built-ins/TypedArray/prototype/buffer/return-buffer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ includes: [testTypedArray.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(TA.BYTES_PER_ELEMENT);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(1);
var ta = new TA(buffer);

assert.sameValue(ta.buffer, buffer);
}, null, ["passthrough"]);
}, null, ["arraybuffer"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.byteLength, 0);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.byteLength, 0);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(128);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(128);
var sample = new TA(buffer, 8, 1);
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.byteOffset, 0);
}, null, ["passthrough"]);
}, null, ["arraybuffer"], ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ includes: [testTypedArray.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var ta1 = new TA();
assert.sameValue(ta1.byteOffset, 0, "Regular typedArray");

var offset = 4 * TA.BYTES_PER_ELEMENT;

var buffer1 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT);
var buffer1 = makeCtorArg(8);
var ta2 = new TA(buffer1, offset);
assert.sameValue(ta2.byteOffset, offset, "TA(buffer, offset)");

var buffer2 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT);
var buffer2 = makeCtorArg(8);
var sample = new TA(buffer2, offset);
var ta3 = new TA(sample);
assert.sameValue(ta3.byteOffset, 0, "TA(typedArray)");
}, null, ["passthrough"]);
}, null, ["arraybuffer"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var buffer = new ArrayBuffer(128);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var buffer = makeCtorArg(128);
var sample = new TA(buffer, 8, 1);
$DETACHBUFFER(sample.buffer);
assert.sameValue(sample.byteOffset, 0);
}, null, ["passthrough"]);
}, null, ["arraybuffer"], ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,18 @@ includes: [testTypedArray.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var ta1 = new TA();
assert.sameValue(ta1.byteOffset, 0, "Regular typedArray");

var offset = 4 * TA.BYTES_PER_ELEMENT;

var buffer1 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT);
var buffer1 = makeCtorArg(8);
var ta2 = new TA(buffer1, offset);
assert.sameValue(ta2.byteOffset, offset, "TA(buffer, offset)");

var buffer2 = new ArrayBuffer(8 * TA.BYTES_PER_ELEMENT);
var buffer2 = makeCtorArg(8);
var sample = new TA(buffer2, offset);
var ta3 = new TA(sample);
assert.sameValue(ta3.byteOffset, 0, "TA(typedArray)");
}, null, ["passthrough"]);
}, null, ["arraybuffer"]);
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.entries();
});
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ includes: [testTypedArray.js, detachArrayBuffer.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.entries();
});
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
6 changes: 3 additions & 3 deletions test/built-ins/TypedArray/prototype/entries/return-itor.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ features: [TypedArray]

var sample = [0, 42, 64];

testWithTypedArrayConstructors(function(TA) {
var typedArray = new TA(sample);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var typedArray = new TA(makeCtorArg(sample));
var itor = typedArray.entries();

var next = itor.next();
Expand All @@ -33,4 +33,4 @@ testWithTypedArrayConstructors(function(TA) {
next = itor.next();
assert.sameValue(next.value, undefined);
assert.sameValue(next.done, true);
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var loops = 0;
var sample = new TA(2);
var sample = new TA(makeCtorArg(2));

sample.every(function() {
if (loops === 0) {
Expand All @@ -38,4 +38,4 @@ testWithBigIntTypedArrayConstructors(function(TA) {
});

assert.sameValue(loops, 2);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ includes: [testTypedArray.js]
features: [BigInt, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var called = 0;

new TA().every(function() {
new TA(makeCtorArg(0)).every(function() {
called++;
});

assert.sameValue(called, 0);
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ var callbackfn = function() {
throw new Test262Error();
};

testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.every(callbackfn);
});
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ includes: [testTypedArray.js]
features: [BigInt, Symbol, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var called = 0;
var values = [
true,
Expand All @@ -35,12 +35,12 @@ testWithBigIntTypedArrayConstructors(function(TA) {
0.1,
-0.1
];
var sample = new TA(values.length);
var sample = new TA(makeCtorArg(values.length));
var result = sample.every(function() {
called++;
return values.unshift();
});

assert.sameValue(called, sample.length, "callbackfn called for each index");
assert.sameValue(result, true, "return is true");
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ includes: [detachArrayBuffer.js, testTypedArray.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var loops = 0;
var sample = new TA(2);
var sample = new TA(makeCtorArg(2));

sample.every(function() {
if (loops === 0) {
Expand All @@ -38,4 +38,4 @@ testWithTypedArrayConstructors(function(TA) {
});

assert.sameValue(loops, 2);
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ includes: [testTypedArray.js]
features: [TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var called = 0;

new TA().every(function() {
new TA(makeCtorArg(0)).every(function() {
called++;
});

assert.sameValue(called, 0);
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ var callbackfn = function() {
throw new Test262Error();
};

testWithTypedArrayConstructors(function(TA) {
var sample = new TA(1);
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var sample = new TA(makeCtorArg(1));
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.every(callbackfn);
});
}, null, ["passthrough"]);
}, null, null, ["immutable"]);
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ includes: [testTypedArray.js]
features: [Symbol, TypedArray]
---*/

testWithTypedArrayConstructors(function(TA) {
testWithTypedArrayConstructors(function(TA, makeCtorArg) {
var called = 0;
var values = [
true,
Expand All @@ -35,12 +35,12 @@ testWithTypedArrayConstructors(function(TA) {
0.1,
-0.1
];
var sample = new TA(values.length);
var sample = new TA(makeCtorArg(values.length));
var result = sample.every(function() {
called++;
return values.unshift();
});

assert.sameValue(called, sample.length, "callbackfn called for each index");
assert.sameValue(result, true, "return is true");
}, null, ["passthrough"]);
});
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ includes: [testTypedArray.js]
features: [BigInt, Symbol.species, TypedArray]
---*/

testWithBigIntTypedArrayConstructors(function(TA) {
testWithBigIntTypedArrayConstructors(function(TA, makeCtorArg) {
var length = 42;
var sample = new TA(length);
var sample = new TA(makeCtorArg(length));
var calls = 0;
var before = false;

Expand Down
Loading
Loading