<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>104145</bug_id>
          
          <creation_ts>2012-12-05 11:24:42 -0800</creation_ts>
          <short_desc>Number.prototype.{toPrecision,toExponential} should accept out-of-range input for NaN/Infinity</short_desc>
          <delta_ts>2017-04-25 08:18:58 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="André Bargull">andre.bargull</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>barraclough</cc>
    
    <cc>fpizlo</cc>
    
    <cc>oliver</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>783931</commentid>
    <comment_count>0</comment_count>
    <who name="André Bargull">andre.bargull</who>
    <bug_when>2012-12-05 11:24:42 -0800</bug_when>
    <thetext>Steps to reproduce:

Test case:
---
js&gt; Number.prototype.toExponential.call(NaN, 555)
typein:63: RangeError: precision 555 out of range
js&gt; 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 &quot;NaN&quot; (or &quot;Infinity&quot;) if the this-argument is `NaN` (or `Infinity`). The actual range check on the input argument happens after (!) handling `NaN`/`Infinity`.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1301019</commentid>
    <comment_count>1</comment_count>
    <who name="André Bargull">andre.bargull</who>
    <bug_when>2017-04-25 08:18:58 -0700</bug_when>
    <thetext>Does no longer reproduce at r215724.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>