@mathias Why don't you use `BigInt.parse`, `Number.parse` instead of `fromString`? With `parse` you are going to be a consistent with `JSON` API and SyntaxError would make more sense than now.
It’s not gonna be consistent with JSON either way as there’s no {BigInt,Number}#stringify.
-
-
Sure, but throwing yet another runtime SyntaxError from different method name is confusing. If there were `ValueError` then it would make more sense.
-
ValueError is not a native error type in ECMAScript, though: https://tc39.github.io/ecma262/#sec-native-error-types-used-in-this-standard … Options are: - EvalError - RangeError - ReferenceError - SyntaxError - TypeError - URIError SyntaxError is the only one that makes sense, IMHO.
- 2 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.