On Thu, Dec 13, 2012 at 7:50 PM, Luke Hoban <[email protected]> wrote:
>>> From: [email protected]
>>> [mailto:[email protected]] On Behalf Of John-David Dalton
>>> Subject: Number.isNaN
>
>>> I noticed that ES6 `Number.isNaN` checks `Type(number)` of Number, would
>>> it make sense to instead check that the [[BuiltinBrand]] is
>>> BuiltinNumberWrapper similar to `Array.isArray`'s check. This would also
>>> allow `Number.isNaN(Object(NaN))` to return `true`. Thoughts?
>
> The current draft spec [0] uses a ToNumber coercion and checks whether this
> results is NaN. So "Number.isNaN(Object(NaN))" will return "true".
In that case, the current spec is wrong. The purpose of introducing
Number.isNaN is to repair the following bug in the global isNaN:
isNaN("foo") // returns true
>
> Luke
>
> [0] http://wiki.ecmascript.org/doku.php?id=harmony:specification_drafts
>
> _______________________________________________
> es-discuss mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/es-discuss
--
Cheers,
--MarkM
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss