BigInt: fix TypedArray fncs expecting BigInt for cmp

This commit is contained in:
Valerie R Young 2018-03-13 13:47:29 -04:00
parent fcb5207932
commit a9827c945d
14 changed files with 17 additions and 17 deletions

View File

@ -33,6 +33,6 @@ var end = Symbol(1);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA();
assert.throws(TypeError, function() {
sample.fill(1, 0, end);
sample.fill(1n, 0, end);
});
});

View File

@ -32,6 +32,6 @@ var start = Symbol(1);
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA();
assert.throws(TypeError, function() {
sample.fill(1, start);
sample.fill(1n, start);
});
});

View File

@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.includes(0);
sample.includes(0n);
});
});

View File

@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
sample = new TA(42);
assert.sameValue(sample.includes(0, 42), false);
assert.sameValue(sample.includes(0, 43), false);
assert.sameValue(sample.includes(0n, 42), false);
assert.sameValue(sample.includes(0n, 43), false);
});

View File

@ -33,7 +33,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(sample.includes(0), false, "returns false");
assert.sameValue(sample.includes(), false, "returns false - no arg");
assert.sameValue(
sample.includes(0, fromIndex), false,
sample.includes(0n, fromIndex), false,
"length is checked before ToInteger(fromIndex)"
);
});

View File

@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.indexOf(0);
sample.indexOf(0n);
});
});

View File

@ -25,6 +25,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample;
sample = new TA(42);
assert.sameValue(sample.indexOf(0, 42), -1);
assert.sameValue(sample.indexOf(0, 43), -1);
assert.sameValue(sample.indexOf(0n, 42), -1);
assert.sameValue(sample.indexOf(0n, 43), -1);
});

View File

@ -29,9 +29,9 @@ var fromIndex = {
testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA();
assert.sameValue(sample.indexOf(0), -1, "returns -1");
assert.sameValue(sample.indexOf(0n), -1, "returns -1");
assert.sameValue(
sample.indexOf(0, fromIndex), -1,
sample.indexOf(0n, fromIndex), -1,
"length is checked before ToInteger(fromIndex)"
);
});

View File

@ -27,6 +27,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
assert.throws(TypeError, function() {
sample.indexOf(7, fromIndex);
sample.indexOf(7n, fromIndex);
});
});

View File

@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
assert.throws(Test262Error, function() {
sample.indexOf(7, fromIndex);
sample.indexOf(7n, fromIndex);
});
});

View File

@ -23,6 +23,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
$DETACHBUFFER(sample.buffer);
assert.throws(TypeError, function() {
sample.lastIndexOf(0);
sample.lastIndexOf(0n);
});
});

View File

@ -31,7 +31,7 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA();
assert.sameValue(sample.lastIndexOf(0), -1, "returns -1");
assert.sameValue(
sample.lastIndexOf(0, fromIndex), -1,
sample.lastIndexOf(0n, fromIndex), -1,
"length is checked before ToInteger(fromIndex)"
);
});

View File

@ -27,6 +27,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
assert.throws(TypeError, function() {
sample.lastIndexOf(7, fromIndex);
sample.lastIndexOf(7n, fromIndex);
});
});

View File

@ -31,6 +31,6 @@ testWithBigIntTypedArrayConstructors(function(TA) {
var sample = new TA(1);
assert.throws(Test262Error, function() {
sample.lastIndexOf(7, fromIndex);
sample.lastIndexOf(7n, fromIndex);
});
});