ljharb / es-abstract

ECMAScript spec abstract operations.
MIT License
114 stars 30 forks source link

Number constructor whitspace handling deficiencies #3

Closed Xotic750 closed 9 years ago

Xotic750 commented 9 years ago

See https://github.com/paulmillr/es6-shim/pull/368

ljharb commented 9 years ago

I'm confused - how does ToNumber interact with trim?

Xotic750 commented 9 years ago

Sorry, probably just my bad language. But what we are talking about here is the internal trimming of whitespace when the Number constructor is used as a casting operator. Number(' 2 ') === 2 So just like with trim, different environments handle internal trimming differently and inconsistently.

ljharb commented 9 years ago

After implementing the fix for es6-shim based on your tests, I totally get it now. Thanks for explaining further!

Xotic750 commented 9 years ago

You're welcome. ;)