Closed jrust closed 7 years ago
I guess the goal of @Nimelrian when using those functions was to align the splice
function to JS specs. Can you ensure that moving to the global version does not change that (I know for instance that Number.isNaN
and isNaN
don't perform the same thing exactly.
And, if we can go back to the globals, parseInt(n, 10)
should probably become +n
, it's way easier.
Thanks for detailing where the change came from. I read through the ToNumber specification and tested splice in Chrome and adapted baobab's splice to further conform to it. It actually turns out that using parseInt resulted in some incorrect behavior because it parses booleans and empty strings as NaN whereas the spec allows those. Reworked the commit and its message with the new behavior and some tests.
Looks like I missed some of the more specific parts of the specification there. Thanks for the fix!
Merging right now and publishing a new version soon :)
v2.4.3 is published on npm.
Great, thanks!
Unfortunately neither Safari or IE support the versions of isNaN and parseInt that are on the Number object.