paulmillr / es6-shim

ECMAScript 6 compatibility shims for legacy JS engines
http://paulmillr.com
MIT License
3.11k stars 387 forks source link

Investigating shimming `Number` constructor for new numeric literals in strings #358

Closed ljharb closed 8 years ago

ljharb commented 8 years ago

@zloirock pointed out that while 0b1 isn't polyfillable, Number('0b1') certainly is (spec)

I'm not confident that it's acceptable to have the Number constructor not be in lockstep with numeric literal syntax, but if it is, then we should definitely implement this.

I've asked @bterlson and @allenwb for clarification in https://twitter.com/ljharb/status/631525546120232960

ljharb commented 8 years ago

Based on https://twitter.com/bterlson/status/631527587047604224 contrasted with https://twitter.com/bterlson/status/631528295910215680, I think this is sensible to implement.

I'll give it a day or two in case anyone has a differing opinion, and then I'll push it up.