Skip to content

Commit 742f32f

Browse files
G-Lee1031ptomato
authored andcommitted
combined two files and modified file name
1 parent e759e22 commit 742f32f

File tree

2 files changed

+9
-25
lines changed

2 files changed

+9
-25
lines changed

test/built-ins/BigInt/prototype/toString/radix-tointegerorinfinity-throws-bigint.js

Lines changed: 0 additions & 24 deletions
This file was deleted.

test/built-ins/BigInt/prototype/toString/radix-tointegerorinfinity-throws-toprimitive.js renamed to test/built-ins/BigInt/prototype/toString/radix-tointegerorinfinity-throws-toprimitive-or-bigint.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
/*---
55
esid: sec-bigint.prototype.tostring
66
description: >
7-
ToNumber called by BigInt.prototype.toString throws when ToPrimitive Throws
7+
ToNumber called by BigInt.prototype.toString throws when _radix_ is a BigInt or when ToPrimitive Throws
88
info: |
99
BigInt.prototype.toString ( [ _radix_ ] )
1010
@@ -16,10 +16,18 @@ info: |
1616
1717
ToNumber (_argument_)
1818
19+
2. If _argument_ is either a Symbol or a BigInt, throw a *TypeError* exception.
20+
1921
7. Assert: _argument_ is an Object.
2022
8. Let _primValue_ be ? ToPrimitive(_argument_, ~number~).
2123
features: [BigInt]
2224
---*/
25+
//Check #1
26+
assert.throws(TypeError, function() {
27+
(0n).toString(0n);
28+
}, "If _radix_ is BigInt, BigInt.prototype.toString must throw a TypeError")
29+
30+
//Check #2
2331
assert.throws(TypeError, function() {
2432
BigInt.prototype.toString.call(10n, {valueOf: undefined, toString: undefined})
2533
}, "TypeError is thrown when _radix_ cannot be converted to a primitive")

0 commit comments

Comments
 (0)