[Webkit-unassigned] [Bug 104145] New: Number.prototype.{toPrecision, toExponential} should accept out-of-range input for NaN/Infinity

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Dec 5 11:22:15 PST 2012


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

           Summary: Number.prototype.{toPrecision,toExponential} should
                    accept out-of-range input for NaN/Infinity
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: andre.bargull at gmail.com


Steps to reproduce:

Test case:
---
js> Number.prototype.toExponential.call(NaN, 555)
typein:63: RangeError: precision 555 out of range
js> Number.prototype.toPrecision.call(NaN, 555)
typein:64: RangeError: precision 555 out of range
---



Expected results:

According to [15.7.4.6  Number.prototype.toExponential (fractionDigits)] step 4 resp. step 6 and according to [15.7.4.7  Number.prototype.toPrecision (precision)] step 4 resp. step 7, toExponential()/toPrecision() return "NaN" (or "Infinity") if the this-argument is `NaN` (or `Infinity`). The actual range check on the input argument happens after (!) handling `NaN`/`Infinity`.

-- 
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