From 496771cd64374cbf2ca1f207fcd02e47a8133bae Mon Sep 17 00:00:00 2001 From: Valerie <spectranaut@gmail.com> Date: Mon, 12 Mar 2018 15:22:29 -0400 Subject: [PATCH] BigInt: fix error type in BigInt from string conversion (#1487) --- .../TypedArray/prototype/set/BigInt/string-tobigint.js | 8 ++++---- .../ctors-bigint/object-arg/string-tobigint.js | 8 ++++---- .../TypedArrays/internals/Set/BigInt/string-tobigint.js | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/test/built-ins/TypedArray/prototype/set/BigInt/string-tobigint.js b/test/built-ins/TypedArray/prototype/set/BigInt/string-tobigint.js index 720cd8740b..aaa22d03c4 100644 --- a/test/built-ins/TypedArray/prototype/set/BigInt/string-tobigint.js +++ b/test/built-ins/TypedArray/prototype/set/BigInt/string-tobigint.js @@ -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..."); diff --git a/test/built-ins/TypedArrays/ctors-bigint/object-arg/string-tobigint.js b/test/built-ins/TypedArrays/ctors-bigint/object-arg/string-tobigint.js index 90b8a41fa4..5798167dbb 100644 --- a/test/built-ins/TypedArrays/ctors-bigint/object-arg/string-tobigint.js +++ b/test/built-ins/TypedArrays/ctors-bigint/object-arg/string-tobigint.js @@ -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..."); diff --git a/test/built-ins/TypedArrays/internals/Set/BigInt/string-tobigint.js b/test/built-ins/TypedArrays/internals/Set/BigInt/string-tobigint.js index 020ac0c758..41a2349b60 100644 --- a/test/built-ins/TypedArrays/internals/Set/BigInt/string-tobigint.js +++ b/test/built-ins/TypedArrays/internals/Set/BigInt/string-tobigint.js @@ -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..."); -- GitLab