tc39 / proposal-number-fromstring

{BigInt,Number}.fromString(string, radix)
https://mathiasbynens.github.io/proposal-number-fromstring/
65 stars 7 forks source link

Compare and contrast with HTML's number-parsing algorithm #11

Open domenic opened 6 years ago

domenic commented 6 years ago

I don't think HTML's number-parsing algorithm should be adapted wholesale; I think symmetry with Number.prototype.toString is a more important consideration. (And HTML assumes radix 10.) But in the past people have complained about e.g. mismatches between HTML's date-parsing and ES's date-parsing, so it'd be good to discuss the differences.

Reference:

Of note are leading plus signs and other mismatches already filed.

mathiasbynens commented 3 years ago

Related upstream issue: https://github.com/tc39/ecma262/issues/2119 (Not about parsing specifically, but in the same spirit.)