Skip to content

Commit 5e963cd

Browse files
committed
stale comments
1 parent e8e8050 commit 5e963cd

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

jscomp/ml/bigint_utils.ml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
000n -> 0n
88
001n -> 1n
99
01_000_000n -> 1000000n
10-
0x1 -> 0x1n
11-
0x001n -> 0x001n
1210
-00100n -> -100n
1311
1412
The following values are syntax errors

jscomp/others/js_bigint.res

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,25 +3,32 @@
33
@val
44
/**
55
Parses the given `string` into a `bigint` using JavaScript semantics. Return the
6-
number as a `bigint` if successfully parsed, `null`, `undefined`, `_NaN` otherwise.
6+
number as a `bigint` if successfully parsed. Uncaught syntax exception otherwise.
77
88
## Examples
99
1010
```rescript
1111
/* returns 123n */
12-
Js.Bigint.fromString("123")
12+
Js.Bigint.fromStringExn("123")
1313
1414
/* returns 0n */
15-
Js.Bigint.fromString("")
15+
Js.Bigint.fromStringExn("")
1616
1717
/* returns 17n */
18-
Js.Bigint.fromString("0x11")
18+
Js.Bigint.fromStringExn("0x11")
1919
2020
/* returns 3n */
21-
Js.Bigint.fromString("0b11")
21+
Js.Bigint.fromStringExn("0b11")
2222
2323
/* returns 9n */
24-
Js.Bigint.fromString("0o11")
24+
Js.Bigint.fromStringExn("0o11")
25+
26+
/* catch exception */
27+
try {
28+
Js.Bigint.fromStringExn("a")
29+
} catch {
30+
| _ => ...
31+
}
2532
```
2633
*/
2734
external fromStringExn: string => bigint = "BigInt"

0 commit comments

Comments
 (0)