@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.
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.
-
-
is detailed SyntaxError makes sence for parsing primitive types? 99% of ppl will wrap parse code into try/catch and return null if error. And that try/catch will deoptimize code. I always prefer parse(string) -> Maybe<Result> aka Result | null for that cases
-
“try/catch will deoptimize code” — this hasn’t been true in
@v8js since the introduction of TurboFan.
End of conversation
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.