diff --git a/test/built-ins/BigInt/parseInt/all-decimal-digits.js b/test/built-ins/BigInt/parseInt/all-decimal-digits.js deleted file mode 100644 index 83c3547b8eb92fae8d0b720c1b47c83c27e875b4..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/all-decimal-digits.js +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: 01234567890 parsed in different radices -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("01234567890", 2), 1n); -assert.sameValue(BigInt.parseInt("01234567890", 3), 5n); -assert.sameValue(BigInt.parseInt("01234567890", 4), 27n); -assert.sameValue(BigInt.parseInt("01234567890", 5), 194n); -assert.sameValue(BigInt.parseInt("01234567890", 6), 1865n); -assert.sameValue(BigInt.parseInt("01234567890", 7), 22875n); -assert.sameValue(BigInt.parseInt("01234567890", 8), 342391n); -assert.sameValue(BigInt.parseInt("01234567890", 9), 6053444n); -assert.sameValue(BigInt.parseInt("01234567890", 10), 1234567890n); diff --git a/test/built-ins/BigInt/parseInt/arg-boolean.js b/test/built-ins/BigInt/parseInt/arg-boolean.js deleted file mode 100644 index d9588e0a5b8730ddd9a3df743313faba345bb476..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/arg-boolean.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Boolean argument -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - 1. Let inputString be ? ToString(string). - 2. Let S be a newly created substring of inputString consisting of - the first code unit that is not a StrWhiteSpaceChar and all code - units following that code unit. (In other words, remove leading - white space.) If inputString does not contain any such code unit, - let S be the empty string. - [...] - 11. If S contains a code unit that is not a radix-R digit, let Z be - the substring of S consisting of all code units before the first - such code unit; otherwise, let Z be S. - 12. If Z is empty, return NaN. -features: [BigInt, arrow-function] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt(true)); -assert.throws(SyntaxError, () => BigInt.parseInt(false)); -assert.throws(SyntaxError, () => BigInt.parseInt(new Boolean(true))); -assert.throws(SyntaxError, () => BigInt.parseInt(new Boolean(false))); diff --git a/test/built-ins/BigInt/parseInt/arg-number.js b/test/built-ins/BigInt/parseInt/arg-number.js deleted file mode 100644 index 5a5b379d68fa66924fca1fd15a5b28c9b7934f7a..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/arg-number.js +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Number argument -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - 1. Let inputString be ? ToString(string). -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt(-1), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt(Infinity)); -assert.throws(SyntaxError, () => BigInt.parseInt(NaN)); -assert.sameValue(BigInt.parseInt(-0), 0n); -assert.sameValue(BigInt.parseInt(new Number(-1)), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt(new Number(Infinity))); -assert.throws(SyntaxError, () => BigInt.parseInt(new Number(NaN))); -assert.sameValue(BigInt.parseInt(new Number(-0)), 0n); diff --git a/test/built-ins/BigInt/parseInt/arg-primitive-coercion.js b/test/built-ins/BigInt/parseInt/arg-primitive-coercion.js deleted file mode 100644 index 30270926019f654cd79b6658c8609b8bd8cdcefd..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/arg-primitive-coercion.js +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Argument converted using ToPrimitive with hint Number -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - 1. Let inputString be ? ToString(string). -features: [BigInt, arrow-function] ----*/ - -var object = {valueOf() {return 1}}; -assert.throws(SyntaxError, () => BigInt.parseInt(object)); - -var object = {valueOf() {return 1}, toString() {return 0}}; -assert.sameValue(BigInt.parseInt(object), 0n); - -var object = {valueOf() {return 1}, toString() {return {}}}; -assert.sameValue(BigInt.parseInt(object), 1n); - -var object = {valueOf() {throw new Test262Error()}, toString() {return 1}}; -assert.sameValue(BigInt.parseInt(object), 1n); - -var object = {toString() {return 1}}; -assert.sameValue(BigInt.parseInt(object), 1n); - -var object = {valueOf() {return {}}, toString() {return 1}}; -assert.sameValue(BigInt.parseInt(object), 1n); - -var object = {valueOf() {return 1}, toString() {throw new Test262Error()}}; -assert.throws(Test262Error, () => BigInt.parseInt(object)); - -var object = {valueOf() {return {}}, toString() {return {}}}; -assert.throws(TypeError, () => BigInt.parseInt(object)); diff --git a/test/built-ins/BigInt/parseInt/arg-string-obj.js b/test/built-ins/BigInt/parseInt/arg-string-obj.js deleted file mode 100644 index 3e81edefdcdde7378e54410b1af7659c0d1c1c2e..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/arg-string-obj.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: String object argument -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - 1. Let inputString be ? ToString(string). -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt(new String("-1")), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt(new String("Infinity"))); -assert.throws(SyntaxError, () => BigInt.parseInt(new String("NaN"))); -assert.throws(SyntaxError, () => BigInt.parseInt(new String("true"))); -assert.throws(SyntaxError, () => BigInt.parseInt(new String("false"))); diff --git a/test/built-ins/BigInt/parseInt/arg-undefined-null.js b/test/built-ins/BigInt/parseInt/arg-undefined-null.js deleted file mode 100644 index 094e554e759e31005d12dfcaba8e0dde6f0e9b00..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/arg-undefined-null.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Undefined or null argument -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 2. Let S be a newly created substring of inputString consisting of - the first code unit that is not a StrWhiteSpaceChar and all code - units following that code unit. (In other words, remove leading - white space.) If inputString does not contain any such code unit, - let S be the empty string. - [...] - 11. If S contains a code unit that is not a radix-R digit, let Z be - the substring of S consisting of all code units before the first - such code unit; otherwise, let Z be S. - 12. If Z is empty, return NaN. -features: [BigInt, arrow-function] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt(undefined)); -assert.throws(SyntaxError, () => BigInt.parseInt(null)); diff --git a/test/built-ins/BigInt/parseInt/binary-negative.js b/test/built-ins/BigInt/parseInt/binary-negative.js deleted file mode 100644 index 728743d20056ee561f2135ad706aba9cad9e0c45..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/binary-negative.js +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Negative binary argument with radix 2 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. - - The parseInt function is the %parseInt% intrinsic object. When the - parseInt function is called, the following steps are taken: - - [...] - 4. If S is not empty and the first code unit of S is the code unit - 0x002D (HYPHEN-MINUS), let sign be -1. - [...] - 16. Return sign × number. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("-1", 2), -1n); -assert.sameValue(BigInt.parseInt("-11", 2), -3n); -assert.sameValue(BigInt.parseInt("-111", 2), -7n); -assert.sameValue(BigInt.parseInt("-1111", 2), -15n); -assert.sameValue(BigInt.parseInt("-11111", 2), -31n); -assert.sameValue(BigInt.parseInt("-111111", 2), -63n); -assert.sameValue(BigInt.parseInt("-1111111", 2), -127n); -assert.sameValue(BigInt.parseInt("-11111111", 2), -255n); -assert.sameValue(BigInt.parseInt("-111111111", 2), -511n); -assert.sameValue(BigInt.parseInt("-1111111111", 2), -1023n); -assert.sameValue(BigInt.parseInt("-11111111111", 2), -2047n); -assert.sameValue(BigInt.parseInt("-111111111111", 2), -4095n); -assert.sameValue(BigInt.parseInt("-1111111111111", 2), -8191n); -assert.sameValue(BigInt.parseInt("-11111111111111", 2), -16383n); -assert.sameValue(BigInt.parseInt("-111111111111111", 2), -32767n); -assert.sameValue(BigInt.parseInt("-1111111111111111", 2), -65535n); -assert.sameValue(BigInt.parseInt("-11111111111111111", 2), -131071n); -assert.sameValue(BigInt.parseInt("-111111111111111111", 2), -262143n); -assert.sameValue(BigInt.parseInt("-1111111111111111111", 2), -524287n); -assert.sameValue(BigInt.parseInt("-11111111111111111111", 2), -1048575n); diff --git a/test/built-ins/BigInt/parseInt/binary.js b/test/built-ins/BigInt/parseInt/binary.js deleted file mode 100644 index 5d2e8df0231085d57d2db457c78857e28e0366d7..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/binary.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Binary string argument with radix 2 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("1", 2), 1n); -assert.sameValue(BigInt.parseInt("11", 2), 3n); -assert.sameValue(BigInt.parseInt("111", 2), 7n); -assert.sameValue(BigInt.parseInt("1111", 2), 15n); -assert.sameValue(BigInt.parseInt("11111", 2), 31n); -assert.sameValue(BigInt.parseInt("111111", 2), 63n); -assert.sameValue(BigInt.parseInt("1111111", 2), 127n); -assert.sameValue(BigInt.parseInt("11111111", 2), 255n); -assert.sameValue(BigInt.parseInt("111111111", 2), 511n); -assert.sameValue(BigInt.parseInt("1111111111", 2), 1023n); -assert.sameValue(BigInt.parseInt("11111111111", 2), 2047n); -assert.sameValue(BigInt.parseInt("111111111111", 2), 4095n); -assert.sameValue(BigInt.parseInt("1111111111111", 2), 8191n); -assert.sameValue(BigInt.parseInt("11111111111111", 2), 16383n); -assert.sameValue(BigInt.parseInt("111111111111111", 2), 32767n); -assert.sameValue(BigInt.parseInt("1111111111111111", 2), 65535n); -assert.sameValue(BigInt.parseInt("11111111111111111", 2), 131071n); -assert.sameValue(BigInt.parseInt("111111111111111111", 2), 262143n); -assert.sameValue(BigInt.parseInt("1111111111111111111", 2), 524287n); -assert.sameValue(BigInt.parseInt("11111111111111111111", 2), 1048575n); diff --git a/test/built-ins/BigInt/parseInt/decimal-negative.js b/test/built-ins/BigInt/parseInt/decimal-negative.js deleted file mode 100644 index b0857afc2a59344f50e9c6885d8f7da9b5009fec..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/decimal-negative.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Negative decimal string argument with radix 10 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 4. If S is not empty and the first code unit of S is the code unit - 0x002D (HYPHEN-MINUS), let sign be -1. - [...] - 16. Return sign × number. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("-1", 10), -1n); -assert.sameValue(BigInt.parseInt("-10", 10), -10n); -assert.sameValue(BigInt.parseInt("-100", 10), -100n); -assert.sameValue(BigInt.parseInt("-1000", 10), -1000n); -assert.sameValue(BigInt.parseInt("-10000", 10), -10000n); -assert.sameValue(BigInt.parseInt("-100000", 10), -100000n); -assert.sameValue(BigInt.parseInt("-1000000", 10), -1000000n); -assert.sameValue(BigInt.parseInt("-10000000", 10), -10000000n); -assert.sameValue(BigInt.parseInt("-100000000", 10), -100000000n); -assert.sameValue(BigInt.parseInt("-1000000000", 10), -1000000000n); -assert.sameValue(BigInt.parseInt("-10000000000", 10), -10000000000n); -assert.sameValue(BigInt.parseInt("-100000000000", 10), -100000000000n); -assert.sameValue(BigInt.parseInt("-1000000000000", 10), -1000000000000n); -assert.sameValue(BigInt.parseInt("-10000000000000", 10), -10000000000000n); -assert.sameValue(BigInt.parseInt("-100000000000000", 10), -100000000000000n); -assert.sameValue(BigInt.parseInt("-1000000000000000", 10), -1000000000000000n); -assert.sameValue(BigInt.parseInt("-10000000000000000", 10), -10000000000000000n); -assert.sameValue(BigInt.parseInt("-100000000000000000", 10), -100000000000000000n); -assert.sameValue(BigInt.parseInt("-1000000000000000000", 10), -1000000000000000000n); -assert.sameValue(BigInt.parseInt("-10000000000000000000", 10), -10000000000000000000n); diff --git a/test/built-ins/BigInt/parseInt/empty-with-radix.js b/test/built-ins/BigInt/parseInt/empty-with-radix.js deleted file mode 100644 index 9c5ac378bbe0b4a5661739a58d9aaebf53905880..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/empty-with-radix.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: SyntaxError thrown for invalid strings -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 2. Let S be a newly created substring of inputString consisting of - the first code unit that is not a StrWhiteSpaceChar and all code - units following that code unit. (In other words, remove leading - white space.) If inputString does not contain any such code unit, - let S be the empty string. - [...] - 11. If S contains a code unit that is not a radix-R digit, let Z be - the substring of S consisting of all code units before the first - such code unit; otherwise, let Z be S. - 12. If Z is empty, return NaN. -features: [BigInt, arrow-function] ----*/ - -for (var i = 2; i <= 36; i++) { - assert.throws(SyntaxError, () => BigInt.parseInt("$0x", i), "$0x radix " + i); - assert.throws(SyntaxError, () => BigInt.parseInt("$0X", i), "$0X radix " + i); - assert.throws(SyntaxError, () => BigInt.parseInt("$$$", i), "$$$ radix " + i); - assert.throws(SyntaxError, () => BigInt.parseInt("", i), "the empty string, radix " + i); - assert.throws(SyntaxError, () => BigInt.parseInt(" ", i), "a string with a single space, radix " + i); -} diff --git a/test/built-ins/BigInt/parseInt/empty.js b/test/built-ins/BigInt/parseInt/empty.js deleted file mode 100644 index 409495b663d04e427aee7562e8d008141387c0a7..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/empty.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: SyntaxError thrown for invalid strings -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 2. Let S be a newly created substring of inputString consisting of - the first code unit that is not a StrWhiteSpaceChar and all code - units following that code unit. (In other words, remove leading - white space.) If inputString does not contain any such code unit, - let S be the empty string. - [...] - 11. If S contains a code unit that is not a radix-R digit, let Z be - the substring of S consisting of all code units before the first - such code unit; otherwise, let Z be S. - 12. If Z is empty, return NaN. -features: [BigInt, arrow-function] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt("$0x"), "$0x"); -assert.throws(SyntaxError, () => BigInt.parseInt("$0X"), "$0X"); -assert.throws(SyntaxError, () => BigInt.parseInt("$$$"), "$$$"); -assert.throws(SyntaxError, () => BigInt.parseInt(""), "the empty string"); -assert.throws(SyntaxError, () => BigInt.parseInt(" "), "a string with a single space"); diff --git a/test/built-ins/BigInt/parseInt/hex-prefix-lc.js b/test/built-ins/BigInt/parseInt/hex-prefix-lc.js deleted file mode 100644 index 294412c7fed24411ee04fadbdb2423f22207b268..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/hex-prefix-lc.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: String argument with hexadecimal prefix and zero radix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("0x0", 0), 0x0n); - -assert.sameValue(BigInt.parseInt("0x1", 0), 0x1n); - -assert.sameValue(BigInt.parseInt("0x2", 0), 0x2n); - -assert.sameValue(BigInt.parseInt("0x3", 0), 0x3n); - -assert.sameValue(BigInt.parseInt("0x4", 0), 0x4n); - -assert.sameValue(BigInt.parseInt("0x5", 0), 0x5n); - -assert.sameValue(BigInt.parseInt("0x6", 0), 0x6n); - -assert.sameValue(BigInt.parseInt("0x7", 0), 0x7n); - -assert.sameValue(BigInt.parseInt("0x8", 0), 0x8n); - -assert.sameValue(BigInt.parseInt("0x9", 0), 0x9n); - -assert.sameValue(BigInt.parseInt("0xA", 0), 0xAn); - -assert.sameValue(BigInt.parseInt("0xB", 0), 0xBn); - -assert.sameValue(BigInt.parseInt("0xC", 0), 0xCn); - -assert.sameValue(BigInt.parseInt("0xD", 0), 0xDn); - -assert.sameValue(BigInt.parseInt("0xE", 0), 0xEn); - -assert.sameValue(BigInt.parseInt("0xF", 0), 0xFn); - -assert.sameValue(BigInt.parseInt("0xE", 0), 0xEn); - -assert.sameValue(BigInt.parseInt("0xABCDEF", 0), 0xABCDEFn); diff --git a/test/built-ins/BigInt/parseInt/hex-prefix-uc.js b/test/built-ins/BigInt/parseInt/hex-prefix-uc.js deleted file mode 100644 index e14e4582daeb7514606fe5d59147931e32c6216f..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/hex-prefix-uc.js +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: String argument with hexadecimal prefix and zero radix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("0X0", 0), 0x0n); - -assert.sameValue(BigInt.parseInt("0X1"), 0x1n); - -assert.sameValue(BigInt.parseInt("0X2"), 0x2n); - -assert.sameValue(BigInt.parseInt("0X3"), 0x3n); - -assert.sameValue(BigInt.parseInt("0X4"), 0x4n); - -assert.sameValue(BigInt.parseInt("0X5"), 0x5n); - -assert.sameValue(BigInt.parseInt("0X6"), 0x6n); - -assert.sameValue(BigInt.parseInt("0X7"), 0x7n); - -assert.sameValue(BigInt.parseInt("0X8"), 0x8n); - -assert.sameValue(BigInt.parseInt("0X9"), 0x9n); - -assert.sameValue(BigInt.parseInt("0XA"), 0xAn); - -assert.sameValue(BigInt.parseInt("0XB"), 0xBn); - -assert.sameValue(BigInt.parseInt("0XC"), 0xCn); - -assert.sameValue(BigInt.parseInt("0XD"), 0xDn); - -assert.sameValue(BigInt.parseInt("0XE"), 0xEn); - -assert.sameValue(BigInt.parseInt("0XF"), 0xFn); - -assert.sameValue(BigInt.parseInt("0XE"), 0xEn); - -assert.sameValue(BigInt.parseInt("0XABCDEF"), 0xABCDEFn); diff --git a/test/built-ins/BigInt/parseInt/hex.js b/test/built-ins/BigInt/parseInt/hex.js deleted file mode 100644 index 172437c8df91fb1c114699a77ac4779fc1068b8f..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/hex.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Hexadecimal string argument with radix 16 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("0x1", 16), 1n); -assert.sameValue(BigInt.parseInt("0X10", 16), 16n); -assert.sameValue(BigInt.parseInt("0x100", 16), 256n); -assert.sameValue(BigInt.parseInt("0X1000", 16), 4096n); -assert.sameValue(BigInt.parseInt("0x10000", 16), 65536n); -assert.sameValue(BigInt.parseInt("0X100000", 16), 1048576n); -assert.sameValue(BigInt.parseInt("0x1000000", 16), 16777216n); -assert.sameValue(BigInt.parseInt("0x10000000", 16), 268435456n); -assert.sameValue(BigInt.parseInt("0x100000000", 16), 4294967296n); -assert.sameValue(BigInt.parseInt("0x1000000000", 16), 68719476736n); -assert.sameValue(BigInt.parseInt("0x10000000000", 16), 1099511627776n); -assert.sameValue(BigInt.parseInt("0x100000000000", 16), 17592186044416n); -assert.sameValue(BigInt.parseInt("0x1000000000000", 16), 281474976710656n); -assert.sameValue(BigInt.parseInt("0x10000000000000", 16), 4503599627370496n); -assert.sameValue(BigInt.parseInt("0x100000000000000", 16), 72057594037927936n); -assert.sameValue(BigInt.parseInt("0x1000000000000000", 16), 1152921504606846976n); -assert.sameValue(BigInt.parseInt("0x10000000000000000", 16), 18446744073709551616n); -assert.sameValue(BigInt.parseInt("0x100000000000000000", 16), 295147905179352825856n); -assert.sameValue(BigInt.parseInt("0x1000000000000000000", 16), 4722366482869645213696n); -assert.sameValue(BigInt.parseInt("0x10000000000000000000", 16), 75557863725914323419136n); diff --git a/test/built-ins/BigInt/parseInt/leading-cr.js b/test/built-ins/BigInt/parseInt/leading-cr.js deleted file mode 100644 index a3fa1eb8aae346f319c36cf6fa2753e66ad0ed64..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-cr.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+000D) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u000D1"), 1n); -assert.sameValue(BigInt.parseInt("\u000D\u000D-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u000D")); diff --git a/test/built-ins/BigInt/parseInt/leading-ff.js b/test/built-ins/BigInt/parseInt/leading-ff.js deleted file mode 100644 index 496db236d755c962d9d2c7c5d231d94267008786..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-ff.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+000C) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u000C1"), 1n); -assert.sameValue(BigInt.parseInt("\u000C\u000C-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u000C")); diff --git a/test/built-ins/BigInt/parseInt/leading-lf.js b/test/built-ins/BigInt/parseInt/leading-lf.js deleted file mode 100644 index 7ecdf521ed9347bc287ae7dc0ac454034e3b3f7d..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-lf.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+000A) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u000A1"), 1n); -assert.sameValue(BigInt.parseInt("\u000A\u000A-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u000A")); diff --git a/test/built-ins/BigInt/parseInt/leading-ls.js b/test/built-ins/BigInt/parseInt/leading-ls.js deleted file mode 100644 index 42fcca4e1165ecf7c9dca6892e50431a789f2487..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-ls.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+2028) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u20281"), 1n); -assert.sameValue(BigInt.parseInt("\u2028\u2028-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u2028")); diff --git a/test/built-ins/BigInt/parseInt/leading-nbsp.js b/test/built-ins/BigInt/parseInt/leading-nbsp.js deleted file mode 100644 index 95150877e40311f0b73f8b6a0b80e9553bec19b6..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-nbsp.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+00A0) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u00A01"), 1n); -assert.sameValue(BigInt.parseInt("\u00A0\u00A0-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u00A0")); diff --git a/test/built-ins/BigInt/parseInt/leading-ps.js b/test/built-ins/BigInt/parseInt/leading-ps.js deleted file mode 100644 index beed606535676061dc7b4abe21f4eb1576ed1010..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-ps.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+2029) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u20291"), 1n); -assert.sameValue(BigInt.parseInt("\u2029\u2029-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u2029")); diff --git a/test/built-ins/BigInt/parseInt/leading-space.js b/test/built-ins/BigInt/parseInt/leading-space.js deleted file mode 100644 index fce99094439bdf89c1eb840c9ed1b6b1c71c198b..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-space.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+0020) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u00201"), 1n); -assert.sameValue(BigInt.parseInt("\u0020\u0020-1"), -1n); -assert.sameValue(BigInt.parseInt(" 1"), 1n); -assert.sameValue(BigInt.parseInt(" 1"), 1n); -assert.sameValue(BigInt.parseInt(" \u0020 \u0020-1"), -1n) -assert.throws(SyntaxError, () => BigInt.parseInt("\u0020")); diff --git a/test/built-ins/BigInt/parseInt/leading-tab.js b/test/built-ins/BigInt/parseInt/leading-tab.js deleted file mode 100644 index 6a5937045ad5769d1d754e95befc6f15deee340b..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-tab.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+0009) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u00091"), 1n); -assert.sameValue(BigInt.parseInt("\u0009\u0009-1"), -1n); -assert.sameValue(BigInt.parseInt(" 1"), 1n); -assert.sameValue(BigInt.parseInt(" 1"), 1n); -assert.sameValue(BigInt.parseInt(" \u0009 \u0009-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u0009")); diff --git a/test/built-ins/BigInt/parseInt/leading-u180e.js b/test/built-ins/BigInt/parseInt/leading-u180e.js deleted file mode 100644 index d23a70063801f7143b2ba6f39490fb46e83ac1a3..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-u180e.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading non-whitespace (U+180E) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - 1. Let inputString be ? ToString(string). - 2. Let S be a newly created substring of inputString consisting of - the first code unit that is not a StrWhiteSpaceChar and all code - units following that code unit. (In other words, remove leading - white space.) If inputString does not contain any such code unit, - let S be the empty string. - [...] - 11. If S contains a code unit that is not a radix-R digit, let Z be - the substring of S consisting of all code units before the first - such code unit; otherwise, let Z be S. - 12. If Z is empty, return NaN. -features: [BigInt, arrow-function] ----*/ - -var mongolianVowelSeparator = "\u180E"; - -assert.throws(SyntaxError, () => BigInt.parseInt(mongolianVowelSeparator + "1"), "Single leading U+180E"); -assert.throws(SyntaxError, () => BigInt.parseInt(mongolianVowelSeparator + mongolianVowelSeparator + mongolianVowelSeparator + "1"), "Multiple leading U+180E"); -assert.throws(SyntaxError, () => BigInt.parseInt(mongolianVowelSeparator), "Only U+180E"); diff --git a/test/built-ins/BigInt/parseInt/leading-vt.js b/test/built-ins/BigInt/parseInt/leading-vt.js deleted file mode 100644 index 84cbb8eb4b06078a2260cc919327346a0b9b20df..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-vt.js +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace (U+000B) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("\u000B1"), 1n); -assert.sameValue(BigInt.parseInt("\u000B\u000B-1"), -1n); -assert.throws(SyntaxError, () => BigInt.parseInt("\u000B")); diff --git a/test/built-ins/BigInt/parseInt/leading-ws.js b/test/built-ins/BigInt/parseInt/leading-ws.js deleted file mode 100644 index efd47037b2ef718a3d9d0a97aadfe888a6717402..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/leading-ws.js +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Leading whitespace -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt, arrow-function] ----*/ - -var uspU = ["\u1680", "\u2000", "\u2001", "\u2002", "\u2003", "\u2004", "\u2005", "\u2006", "\u2007", "\u2008", "\u2009", "\u200A", "\u202F", "\u205F", "\u3000"]; - -for (var index = 0; index < uspU.length; index++) { - assert.sameValue(BigInt.parseInt(uspU[index] + "1"), 1n); - assert.sameValue(BigInt.parseInt(uspU[index] + uspU[index] + uspU[index] + "1"), 1n); - assert.throws(SyntaxError, () => BigInt.parseInt(uspU[index])); -} diff --git a/test/built-ins/BigInt/parseInt/length.js b/test/built-ins/BigInt/parseInt/length.js deleted file mode 100644 index d937521ee4b88e2c8365bfdd3ecea37799de2e00..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/length.js +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: BigInt.parseInt.length property descriptor -info: > - BigInt.parseInt ( string , radix ) - - 17 ECMAScript Standard Built-in Objects - - Every built-in function object, including constructors, has a length - property whose value is an integer. Unless otherwise specified, this - value is equal to the largest number of named arguments shown in the - subclause headings for the function description. Optional parameters - (which are indicated with brackets: [ ]) or rest parameters (which - are shown using the form «...name») are not included in the default - argument count. - - Unless otherwise specified, the length property of a built-in - function object has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] -features: [BigInt] ----*/ - -verifyProperty(BigInt.parseInt, "length", { - value: 2, - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/BigInt/parseInt/mixed-case-signed.js b/test/built-ins/BigInt/parseInt/mixed-case-signed.js deleted file mode 100644 index b70efb49a3272dfe7ec4e03b3ce1529ae948d012..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/mixed-case-signed.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Mixed-case digits and sign -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - The parseInt function is the %parseInt% intrinsic object. When the - parseInt function is called, the following steps are taken: - - [...] - 4. If S is not empty and the first code unit of S is the code unit - 0x002D (HYPHEN-MINUS), let sign be -1. - [...] - 16. Return sign × number. -features: [BigInt] ----*/ - -var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; -var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; -for (var i = 2; i <= 36; i++) { - for (var j = 0; j < 10; j++) { - var str = "+"; - var sign = 1; - if (j % 2 !== 0) { - str = "-"; - sign= -1; - } - var num = 0; - var pow = 1; - var k0 = Math.max(2, i - j); - for (var k = k0; k <= i; k++) { - if (k % 2 === 0) { - str = str + R_digit1[k - 2]; - } else { - str = str + R_digit2[k - 2]; - } - num = num + (i + (k0 - k) - 1) * pow; - pow = pow * i; - } - assert.sameValue(BigInt.parseInt(str, i), BigInt(num * sign)); - } -} diff --git a/test/built-ins/BigInt/parseInt/mixed-case-unsigned.js b/test/built-ins/BigInt/parseInt/mixed-case-unsigned.js deleted file mode 100644 index eca2758acb9082ed75e70b74b59793f3c20fbf79..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/mixed-case-unsigned.js +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Mixed-case digits -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -var R_digit1 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; -var R_digit2 = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; -for (var i = 2; i <= 36; i++) { - for (var j = 0; j < 10; j++) { - var str = ""; - var num = 0; - var pow = 1; - var k0 = Math.max(2, i - j); - for (var k = k0; k <= i; k++) { - if (k % 2 === 0) { - str = str + R_digit1[k - 2]; - } else { - str = str + R_digit2[k - 2]; - } - num = num + (i + (k0 - k) - 1) * pow; - pow = pow * i; - } - assert.sameValue(BigInt.parseInt(str, i), BigInt(num)); - } -} diff --git a/test/built-ins/BigInt/parseInt/name.js b/test/built-ins/BigInt/parseInt/name.js deleted file mode 100644 index 7b7952b309aca719abc55d15b393cbf70ed97a05..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/name.js +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: BigInt.parseInt.name property descriptor -info: > - BigInt.parseInt ( string , radix ) - - 17 ECMAScript Standard Built-in Objects - - Every built-in function object, including constructors, that is not - identified as an anonymous function has a name property whose value - is a String. Unless otherwise specified, this value is the name that - is given to the function in this specification. For functions that - are specified as properties of objects, the name value is the - property name string used to access the function. [...] - - Unless otherwise specified, the name property of a built-in function - object, if it exists, has the attributes { [[Writable]]: false, - [[Enumerable]]: false, [[Configurable]]: true }. -includes: [propertyHelper.js] -features: [BigInt] ----*/ - -verifyProperty(BigInt.parseInt, "name", { - value: "parseInt", - writable: false, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/BigInt/parseInt/no-prototype.js b/test/built-ins/BigInt/parseInt/no-prototype.js deleted file mode 100644 index 690ccecb614012c4c49a3b9f69122d03e2d1e07a..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/no-prototype.js +++ /dev/null @@ -1,21 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: BigInt.parseInt.prototype is undefined - BigInt.parseInt ( string , radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - 9.3 Built-in Function Objects - - Built-in functions that are not constructors do not have a prototype - property unless otherwise specified in the description of a - particular function. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt.prototype, undefined); diff --git a/test/built-ins/BigInt/parseInt/not-constructor.js b/test/built-ins/BigInt/parseInt/not-constructor.js deleted file mode 100644 index 87322a041081b59501c03398f14e1e20bae440c6..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/not-constructor.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: BigInt.parseInt is not a constructor -info: > - BigInt.parseInt ( string , radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - 9.3 Built-in Function Objects - - Built-in function objects that are not identified as constructors do - not implement the [[Construct]] internal method unless otherwise - specified in the description of a particular function. -features: [BigInt, arrow-function] ----*/ - -assert.throws(TypeError, () => new BigInt.parseInt()); diff --git a/test/built-ins/BigInt/parseInt/octal-prefix.js b/test/built-ins/BigInt/parseInt/octal-prefix.js deleted file mode 100644 index 15c7a5e4631ee991d19157a195f08529e6b128f0..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/octal-prefix.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: String argument with octal prefix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to - the specified radix. Leading white space in string is ignored. If - radix is undefined or 0, it is assumed to be 10 except when the - number begins with the code unit pairs 0x or 0X, in which case a - radix of 16 is assumed. If radix is 16, the number may also - optionally begin with the code unit pairs 0x or 0X. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("010"), 10n, "parseInt should no longer accept octal"); diff --git a/test/built-ins/BigInt/parseInt/parseInt.js b/test/built-ins/BigInt/parseInt/parseInt.js deleted file mode 100644 index fefedc5af605380d199150174b98a2bc39ee901f..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/parseInt.js +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -description: BigInt string parsing -esid: pending -features: [BigInt] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt("")); -assert.throws(SyntaxError, () => BigInt.parseInt("@")); -assert.throws(SyntaxError, () => BigInt.parseInt("1", 1)); -assert.throws(SyntaxError, () => BigInt.parseInt("1", 37)); -assert.sameValue(BigInt.parseInt("0xf", 0), 0xfn); -assert.sameValue(BigInt.parseInt("-0"), 0n); -assert.sameValue(BigInt.parseInt(" 0@"), 0n); -assert.sameValue(BigInt.parseInt("kf12oikf12oikf12oi", 36), - 5849853453554480289462428370n); diff --git a/test/built-ins/BigInt/parseInt/prop-desc.js b/test/built-ins/BigInt/parseInt/prop-desc.js deleted file mode 100644 index 5952121d29a21e085904cab3b9147021a1637019..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/prop-desc.js +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: BigInt.parseInt property descriptor -info: > - BigInt.parseInt ( string, radix ) - - 17 ECMAScript Standard Built-in Objects -includes: [propertyHelper.js] -features: [BigInt] ----*/ - -verifyProperty(BigInt, "parseInt", { - writable: true, - enumerable: false, - configurable: true -}); diff --git a/test/built-ins/BigInt/parseInt/radix-37.js b/test/built-ins/BigInt/parseInt/radix-37.js deleted file mode 100644 index 8baa92f5337066324b8b44ab48b69d2b5a6cc913..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-37.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Invalid radix (37) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 8. If R ≠0, then - a. If R < 2 or R > 36, return NaN. -features: [BigInt, arrow-function] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt("0", 37), "0"); -assert.throws(SyntaxError, () => BigInt.parseInt("1", 37), "1"); -assert.throws(SyntaxError, () => BigInt.parseInt("2", 37), "2"); -assert.throws(SyntaxError, () => BigInt.parseInt("3", 37), "3"); -assert.throws(SyntaxError, () => BigInt.parseInt("4", 37), "4"); -assert.throws(SyntaxError, () => BigInt.parseInt("5", 37), "5"); -assert.throws(SyntaxError, () => BigInt.parseInt("6", 37), "6"); -assert.throws(SyntaxError, () => BigInt.parseInt("7", 37), "7"); -assert.throws(SyntaxError, () => BigInt.parseInt("8", 37), "8"); -assert.throws(SyntaxError, () => BigInt.parseInt("9", 37), "9"); -assert.throws(SyntaxError, () => BigInt.parseInt("10", 37), "10"); -assert.throws(SyntaxError, () => BigInt.parseInt("11", 37), "11"); diff --git a/test/built-ins/BigInt/parseInt/radix-boolean.js b/test/built-ins/BigInt/parseInt/radix-boolean.js deleted file mode 100644 index 683e38d2893a5b98a618b23049fe06bb1c8cbc8a..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-boolean.js +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Boolean radix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). - 7. Let stripPrefix be true. - 8. If R ≠0, then - a. If R < 2 or R > 36, return NaN. - b. If R ≠16, let stripPrefix be false. - 9. Else R = 0, - a. Let R be 10. - [...] -features: [BigInt, arrow-function] ----*/ - -assert.sameValue(BigInt.parseInt("11", false), 11n); -assert.throws(SyntaxError, () => BigInt.parseInt("11", true)); -assert.sameValue(BigInt.parseInt("11", new Boolean(false)), 11n); -assert.throws(SyntaxError, () => BigInt.parseInt("11", new Boolean(true))); diff --git a/test/built-ins/BigInt/parseInt/radix-int32.js b/test/built-ins/BigInt/parseInt/radix-int32.js deleted file mode 100644 index 6e0776a65e07acd9aa089c30f4b88477ee0be2d1..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-int32.js +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Radix converted using ToInt32 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("11", 2.1), 0b11n); -assert.sameValue(BigInt.parseInt("11", 2.5), 0b11n); -assert.sameValue(BigInt.parseInt("11", 2.9), 0b11n); -assert.sameValue(BigInt.parseInt("11", 2.000000000001), 0b11n); -assert.sameValue(BigInt.parseInt("11", 2.999999999999), 0b11n); -assert.sameValue(BigInt.parseInt("11", 4294967298), 0b11n); -assert.sameValue(BigInt.parseInt("11", 4294967296), 11n); -assert.throws(SyntaxError, () => BigInt.parseInt("11", -2147483650), "-2147483650"); -assert.sameValue(BigInt.parseInt("11", -4294967294), 0b11n); -assert.sameValue(BigInt.parseInt("11", NaN), 11n); -assert.sameValue(BigInt.parseInt("11", +0), 11n); -assert.sameValue(BigInt.parseInt("11", -0), 11n); -assert.sameValue(BigInt.parseInt("11", Number.POSITIVE_INFINITY), 11n); -assert.sameValue(BigInt.parseInt("11", Number.NEGATIVE_INFINITY), 11n); diff --git a/test/built-ins/BigInt/parseInt/radix-number-obj.js b/test/built-ins/BigInt/parseInt/radix-number-obj.js deleted file mode 100644 index e311a659f73d86b935594bea8c36931126e25cbb..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-number-obj.js +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Number object radix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("11", new Number(2)), 0b11n); -assert.sameValue(BigInt.parseInt("11", new Number(Infinity)), 11n); diff --git a/test/built-ins/BigInt/parseInt/radix-one.js b/test/built-ins/BigInt/parseInt/radix-one.js deleted file mode 100644 index 1a5e1694cbc84dadd8db804447ee373ddef06658..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-one.js +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Invalid radix (1) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 8. If R ≠0, then - a. If R < 2 or R > 36, return NaN. -features: [BigInt, arrow-function] ----*/ - -assert.throws(SyntaxError, () => BigInt.parseInt("0", 1), "0"); -assert.throws(SyntaxError, () => BigInt.parseInt("1", 1), "1"); -assert.throws(SyntaxError, () => BigInt.parseInt("2", 1), "2"); -assert.throws(SyntaxError, () => BigInt.parseInt("3", 1), "3"); -assert.throws(SyntaxError, () => BigInt.parseInt("4", 1), "4"); -assert.throws(SyntaxError, () => BigInt.parseInt("5", 1), "5"); -assert.throws(SyntaxError, () => BigInt.parseInt("6", 1), "6"); -assert.throws(SyntaxError, () => BigInt.parseInt("7", 1), "7"); -assert.throws(SyntaxError, () => BigInt.parseInt("8", 1), "8"); -assert.throws(SyntaxError, () => BigInt.parseInt("9", 1), "9"); -assert.throws(SyntaxError, () => BigInt.parseInt("10", 1), "10"); -assert.throws(SyntaxError, () => BigInt.parseInt("11", 1), "11"); diff --git a/test/built-ins/BigInt/parseInt/radix-primitive-coercion.js b/test/built-ins/BigInt/parseInt/radix-primitive-coercion.js deleted file mode 100644 index 11490fb4c4fc5a59b77e13425d561cea741662b9..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-primitive-coercion.js +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Radix converted using ToInt32 -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). -features: [BigInt, arrow-function] ----*/ - -var object = {valueOf() {return 2}}; -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {valueOf() {return 2}, toString() {return 1}}; -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {valueOf() {return 2}, toString() {return {}}}; -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {valueOf() {return 2}, toString() {throw new Test262Error()}}; -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {toString() {return 2}}; -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {valueOf() {return {}}, toString() {return 2}} -assert.sameValue(BigInt.parseInt("11", object), 0b11n); - -var object = {valueOf() {throw new Test262Error()}, toString() {return 2}}; -assert.throws(Test262Error, () => BigInt.parseInt("11", object)); - -var object = {valueOf() {return {}}, toString() {return {}}}; -assert.throws(TypeError, () => BigInt.parseInt("11", object)); diff --git a/test/built-ins/BigInt/parseInt/radix-string.js b/test/built-ins/BigInt/parseInt/radix-string.js deleted file mode 100644 index d41406f5ee65f3e9a6156900a88d803e4edc0e5d..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-string.js +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: String radix -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("11", "2"), 0b11n); -assert.sameValue(BigInt.parseInt("11", "0"), 11n); -assert.sameValue(BigInt.parseInt("11", ""), 11n); -assert.sameValue(BigInt.parseInt("11", new String("2")), 0b11n); -assert.sameValue(BigInt.parseInt("11", new String("Infinity")), 11n); -assert.sameValue(BigInt.parseInt("11", new String("")), 11n); diff --git a/test/built-ins/BigInt/parseInt/radix-undefined-or-null.js b/test/built-ins/BigInt/parseInt/radix-undefined-or-null.js deleted file mode 100644 index 73cfdf8fe59f0c6c96c8411a3479485ba7e0e9db..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-undefined-or-null.js +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Radix is undefined or null -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). - [...] - 9. Else R = 0, - a. Let R be 10. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("11", undefined), 11n); -assert.sameValue(BigInt.parseInt("11", null), 11n); diff --git a/test/built-ins/BigInt/parseInt/radix-undefined.js b/test/built-ins/BigInt/parseInt/radix-undefined.js deleted file mode 100644 index 10036e58465c67e04f3a3a4a83039618b702e15e..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-undefined.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Radix is undefined -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). - [...] - 9. Else R = 0, - a. Let R be 10. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("0"), 0n); - -assert.sameValue(BigInt.parseInt("1"), 1n); - -assert.sameValue(BigInt.parseInt("2"), 2n); - -assert.sameValue(BigInt.parseInt("3"), 3n); - -assert.sameValue(BigInt.parseInt("4"), 4n); - -assert.sameValue(BigInt.parseInt("5"), 5n); - -assert.sameValue(BigInt.parseInt("6"), 6n); - -assert.sameValue(BigInt.parseInt("7"), 7n); - -assert.sameValue(BigInt.parseInt("8"), 8n); - -assert.sameValue(BigInt.parseInt("9"), 9n); - -assert.sameValue(BigInt.parseInt("10"), 10n); - -assert.sameValue(BigInt.parseInt("11"), 11n); - -assert.sameValue(BigInt.parseInt("9999"), 9999n); diff --git a/test/built-ins/BigInt/parseInt/radix-zero.js b/test/built-ins/BigInt/parseInt/radix-zero.js deleted file mode 100644 index 586661f45811b41d362acc88a232fc7cbbd41af7..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/radix-zero.js +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Radix is zero -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - [...] - 6. Let R be ? ToInt32(radix). - [...] - 9. Else R = 0, - a. Let R be 10. -features: [BigInt] ----*/ - -assert.sameValue(BigInt.parseInt("0", 0), 0n); - -assert.sameValue(BigInt.parseInt("1", 0), 1n); - -assert.sameValue(BigInt.parseInt("2", 0), 2n); - -assert.sameValue(BigInt.parseInt("3", 0), 3n); - -assert.sameValue(BigInt.parseInt("4", 0), 4n); - -assert.sameValue(BigInt.parseInt("5", 0), 5n); - -assert.sameValue(BigInt.parseInt("6", 0), 6n); - -assert.sameValue(BigInt.parseInt("7", 0), 7n); - -assert.sameValue(BigInt.parseInt("8", 0), 8n); - -assert.sameValue(BigInt.parseInt("9", 0), 9n); - -assert.sameValue(BigInt.parseInt("10", 0), 10n); - -assert.sameValue(BigInt.parseInt("11", 0), 11n); - -assert.sameValue(BigInt.parseInt("9999", 0), 9999n); diff --git a/test/built-ins/BigInt/parseInt/trailing-code-point.js b/test/built-ins/BigInt/parseInt/trailing-code-point.js deleted file mode 100644 index cf3039426ab257a20a5697514d8a89b6b09d2929..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-code-point.js +++ /dev/null @@ -1,85 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Trailing non-digit UTF-16 code point -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -includes: [decimalToHexString.js] -features: [BigInt] ----*/ - -var errorCount = 0; -var count = 0; -var indexP; -var indexO = 0; -for (var index = 0; index <= 65535; index++) { - if ((index < 0x0030) || (index > 0x0039) && - (index < 0x0041) || (index > 0x005A) && - (index < 0x0061) || (index > 0x007A)) { - var hex = decimalToHexString(index); - if (BigInt.parseInt("1Z" + String.fromCharCode(index), 36) !== 71n) { - if (indexO === 0) { - indexO = index; - } else { - if ((index - indexP) !== 1) { - if ((indexP - indexO) !== 0) { - var hexP = decimalToHexString(indexP); - var hexO = decimalToHexString(indexO); - $ERROR('#' + hexO + '-' + hexP + ' '); - } - else { - var hexP = decimalToHexString(indexP); - $ERROR('#' + hexP + ' '); - } - indexO = index; - } - } - indexP = index; - errorCount++; - } - count++; - } -} - -if (errorCount > 0) { - if ((indexP - indexO) !== 0) { - var hexP = decimalToHexString(indexP); - var hexO = decimalToHexString(indexO); - $ERROR('#' + hexO + '-' + hexP + ' '); - } else { - var hexP = decimalToHexString(indexP); - $ERROR('#' + hexP + ' '); - } - $ERROR('Total error: ' + errorCount + ' bad Unicode character in ' + count + ' '); -} diff --git a/test/built-ins/BigInt/parseInt/trailing-invalid-digit-lc.js b/test/built-ins/BigInt/parseInt/trailing-invalid-digit-lc.js deleted file mode 100644 index d6b1c609a0e5af437569fc2fb53cc916d71ea587..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-invalid-digit-lc.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Single digit and invalid trailing digit (lowercase) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; -for (var i = 2; i <= 35; i++) { - assert.sameValue(BigInt.parseInt(R_digit[i - 2] + R_digit[i - 1], i), BigInt(i - 1)); -} diff --git a/test/built-ins/BigInt/parseInt/trailing-invalid-digit-uc.js b/test/built-ins/BigInt/parseInt/trailing-invalid-digit-uc.js deleted file mode 100644 index 587aa6d38c00bb8d727b70d8bc2c945c7a84f1f4..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-invalid-digit-uc.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Single digit with trailing invalid digit (uppercase) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; -for (var i = 2; i <= 35; i++) { - assert.sameValue(BigInt.parseInt(R_digit[i - 2] + R_digit[i - 1], i), BigInt(i - 1)); -} diff --git a/test/built-ins/BigInt/parseInt/trailing-non-digit-and-digit.js b/test/built-ins/BigInt/parseInt/trailing-non-digit-and-digit.js deleted file mode 100644 index 5b6f2c1606f56a2ad2a48986f831299aa4b3f91b..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-non-digit-and-digit.js +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: 10 with trailing non-digit -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -for (var i = 2; i <= 36; i++) { - assert.sameValue(BigInt.parseInt("10$1", i), BigInt(i)); -} diff --git a/test/built-ins/BigInt/parseInt/trailing-non-digit-lc.js b/test/built-ins/BigInt/parseInt/trailing-non-digit-lc.js deleted file mode 100644 index d4e9a95e92bc4a6405c85e2e894ebd47248a1925..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-non-digit-lc.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Single digit with trailing non-digit (lowercase) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]; -for (var i = 2; i <= 36; i++) { - assert.sameValue(BigInt.parseInt(R_digit[i - 2] + "$", i), BigInt(i - 1)); -} diff --git a/test/built-ins/BigInt/parseInt/trailing-non-digit-uc.js b/test/built-ins/BigInt/parseInt/trailing-non-digit-uc.js deleted file mode 100644 index 456b7bc3bb5df45d79bf6552be9969a0c3a06c08..0000000000000000000000000000000000000000 --- a/test/built-ins/BigInt/parseInt/trailing-non-digit-uc.js +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (C) 2017 Igalia, S.L. All rights reserved. -// This code is governed by the BSD license found in the LICENSE file. - -/*--- -esid: sec-bigint-parseint-string-radix -description: Single digit with trailing non-digit (uppercase) -info: > - BigInt.parseInt ( string, radix ) - - The parseInt function produces a BigInt value dictated by - interpretation of the contents of the string argument according to - the specified radix. - - The algorithm is the same as 18.2.5 but with the following edits: - - * For all cases which result in returning NaN, throw a SyntaxError - exception. - * For all cases which result in returning -0, return 0n. - * Replace the second to last step, which casts mathInt to a Number, - with casting mathInt to a BigInt. - - 18.2.5 parseInt ( string, radix ) - - The parseInt function produces an integer value dictated by - interpretation of the contents of the string argument according to the - specified radix. Leading white space in string is ignored. If radix is - undefined or 0, it is assumed to be 10 except when the number begins - with the code unit pairs 0x or 0X, in which case a radix of 16 is - assumed. If radix is 16, the number may also optionally begin with the - code unit pairs 0x or 0X. - - [...] - - NOTE: parseInt may interpret only a leading portion of string as an - integer value; it ignores any code units that cannot be interpreted as - part of the notation of an integer, and no indication is given that - any such code units were ignored. -features: [BigInt] ----*/ - -var R_digit = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]; -for (var i = 2; i <= 36; i++) { - assert.sameValue(BigInt.parseInt(R_digit[i - 2] + "$", i), BigInt(i - 1)); -}