Changeset 39882 in webkit


Ignore:
Timestamp:
Jan 13, 2009 5:44:28 PM (15 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:
Location:
trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r39879 r39882  
     12009-01-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Darin Adler and Oliver Hunt.
     4
     5        <rdar://problem/6489314> REGRESSION: Business widget's front side
     6        fails to render correctly when flipping widget
     7
     8        The problem here is that parseInt was parsing NaN as 0. This patch
     9        corrects that by parsing NaN as NaN. This matches our old behavior
     10        and Firefox.
     11
     12        * runtime/JSGlobalObjectFunctions.cpp:
     13        (JSC::globalFuncParseInt):
     14
    1152009-01-13  Gavin Barraclough  <barraclough@apple.com>
    216
  • 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
  • trunk/LayoutTests/ChangeLog

    r39877 r39882  
     12009-01-13  Beth Dakin  <bdakin@apple.com>
     2
     3        Reviewed by Darin Adler and Oliver Hunt.
     4
     5        Updated test and results for <rdar://problem/6489314> REGRESSION:
     6        Business widget's front side fails to render correctly when
     7        flipping widget
     8
     9        parseInt(NaN) should be NaN.
     10        * fast/js/numeric-conversion-expected.txt:
     11        * fast/js/resources/numeric-conversion.js:
     12
    1132009-01-13  Anders Carlsson  <andersca@apple.com>
    214
  • trunk/LayoutTests/fast/js/numeric-conversion-expected.txt

    r36434 r39882  
    1818PASS parseInt('9007199254740992e2000').toString() is '9007199254740992'
    1919PASS parseInt('9007199254740992.0e2000').toString() is '9007199254740992'
    20 PASS parseInt(NaN) is 0
     20PASS parseInt(NaN) is NaN
    2121PASS parseInt(-Infinity) is 0
    2222PASS parseInt(Infinity) is 0
  • trunk/LayoutTests/fast/js/resources/numeric-conversion.js

    r36434 r39882  
    2323shouldBe("parseInt('9007199254740992.0e2000').toString()", "'9007199254740992'");
    2424
    25 shouldBe("parseInt(NaN)", "0");
     25shouldBe("parseInt(NaN)", "NaN");
    2626shouldBe("parseInt(-Infinity)", "0");
    2727shouldBe("parseInt(Infinity)", "0");
Note: See TracChangeset for help on using the changeset viewer.