BigInt: fix error type in BigInt from string conversion (#1487)

This commit is contained in:
Valerie 2018-03-12 15:22:29 -04:00 committed by Leo Balter
parent b1bbf08bdc
commit 496771cd64
3 changed files with 12 additions and 12 deletions

View File

@ -47,19 +47,19 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(typedArray[0], 0n);
assert.sameValue(typedArray[1], 1n);
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray.set(['1n']);
}, "A StringNumericLiteral may not include a BigIntLiteralSuffix.");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray.set(["Infinity"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity..");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray.set(["1.1"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... decimal points...");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray.set(["1e7"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... exponents...");

View File

@ -58,19 +58,19 @@ testWithBigIntTypedArrayConstructors(function(TA) {
assert.sameValue(typedArray[0], 0n);
assert.sameValue(typedArray[1], 1n);
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
new TA(["1n"]);
}, "A StringNumericLiteral may not include a BigIntLiteralSuffix.");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
new TA(["Infinity"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity..");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
new TA(["1.1"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... decimal points...");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
new TA(["1e7"]);
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... exponents...");

View File

@ -70,19 +70,19 @@ testWithBigIntTypedArrayConstructors(function(TA) {
typedArray[0] = '1';
assert.sameValue(typedArray[0], 1n);
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray[0] = '1n';
}, "A StringNumericLiteral may not include a BigIntLiteralSuffix.");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray[0] = "Infinity";
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow Infinity..");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray[0] = "1.1";
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... decimal points...");
assert.throws(TypeError, function() {
assert.throws(SyntaxError, function() {
typedArray[0] = "1e7";
}, "Replace the StrUnsignedDecimalLiteral production with DecimalDigits to not allow... exponents...");