RESOLVED WORKSFORME 104145
Number.prototype.{toPrecision,toExponential} should accept out-of-range input for NaN/Infinity
https://bugs.webkit.org/show_bug.cgi?id=104145
Summary Number.prototype.{toPrecision,toExponential} should accept out-of-range input...
André Bargull
Reported 2012-12-05 11:24:42 PST
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`.
Attachments
André Bargull
Comment 1 2017-04-25 08:18:58 PDT
Does no longer reproduce at r215724.
Note You need to log in before you can comment on or make changes to this bug.