Ignore:
Timestamp:
Jan 13, 2009, 5:44:28 PM (16 years ago)
Author:
Beth Dakin
Message:

JavaScriptCore:

2009-01-13 Beth Dakin <Beth Dakin>

Reviewed by Darin Adler and Oliver Hunt.

<rdar://problem/6489314> REGRESSION: Business widget's front side
fails to render correctly when flipping widget

The problem here is that parseInt was parsing NaN as 0. This patch
corrects that by parsing NaN as NaN. This matches our old behavior
and Firefox.

  • runtime/JSGlobalObjectFunctions.cpp: (JSC::globalFuncParseInt):

LayoutTests:

2009-01-13 Beth Dakin <Beth Dakin>

Reviewed by Darin Adler and Oliver Hunt.

Updated test and results for <rdar://problem/6489314> REGRESSION:
Business widget's front side fails to render correctly when
flipping widget

parseInt(NaN) should be NaN.

  • fast/js/numeric-conversion-expected.txt:
  • fast/js/resources/numeric-conversion.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp

    r39851 r39882  
    303303            return value;
    304304        double d = value->uncheckedGetNumber();
    305         if (!isfinite(d))
    306             return js0();
    307         return jsNumber(exec, floor(d));
     305        if (isfinite(d))
     306            return jsNumber(exec, floor(d));
     307        if (isnan(d))
     308            return jsNaN(&exec->globalData());
     309        return js0();
    308310    }
    309311
Note: See TracChangeset for help on using the changeset viewer.