[Webkit-unassigned] [Bug 131707] Simple ES6 feature: Number constructor extras

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 22 03:25:54 PDT 2014


https://bugs.webkit.org/show_bug.cgi?id=131707





--- Comment #18 from Diego Pino <dpino at igalia.com>  2014-09-22 03:25:54 PST ---
(From update of attachment 238436)
View in context: https://bugs.webkit.org/attachment.cgi?id=238436&action=review

>> Source/JavaScriptCore/runtime/NumberConstructor.cpp:228
>> +        isInteger = trunc(number) == number && std::abs(number) <= 9007199254740991LL;
> 
> Should be 9007199254740991.0, not 9007199254740991LL.
> 
> I think this might return true for -0 and I believe it should return false.

isSafeInteger(-0) returns true, but I think it makes sense. That's the reason why the range of safe integers is [-9007199254740991, 9007199254740991] and not [-9007199254740992, 9007199254740991]. Zero is a signed number in the range of safe integers, so Number.isSafeInteger(-0) must return true. The same applies for is isFinite() and isInteger(). To confirm, I also tested these cases in V8 and SpiderMonkey and both return isFinite(-0), isInteger(-0) and isSafeInteger(-0) true.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list