Open
Description
This appears to be by design in the underlying JavaScript library (emphasis mine):
You can create a bigInt by calling the bigInt function. You can pass in
- a string, which it will parse as an bigInt and throw an "Invalid integer" error if the parsing fails.
- a Javascript number, which it will parse as an bigInt and throw an "Invalid integer" error if the parsing fails.
- another bigInt.
- nothing, and it will return bigInt.zero.
The stage 3 draft BigInt specification for ES requires this too:
EDITOR'S NOTE
StringToBigInt("")
is0n
according to the logic in 3.1.3.1.
This is not what I would do if it were up to me, but since this library is mostly just a binding to the underlying JavaScript library, perhaps the best way forward is to leave this as-is and clarify this behaviour in the documentation?
Metadata
Metadata
Assignees
Labels
No labels