Changeset 30191 in webkit


Ignore:
Timestamp:
Feb 13, 2008 1:51:59 AM (16 years ago)
Author:
oliver@apple.com
Message:

<rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com

Reviewed by Alexey P.

When converting numeric values to booleans we need to account for NaN

Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r30177 r30191  
     12008-02-13  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Alexey P.
     4
     5        <rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com
     6
     7        When converting numeric values to booleans we need to account for NaN
     8
     9        * kjs/nodes.cpp:
     10        (KJS::MultNode::evaluateToBoolean):
     11        (KJS::ModNode::evaluateToBoolean):
     12
    1132008-02-08  Samuel Weinig  <sam@webkit.org>
    214
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r30102 r30191  
    21362136bool MultNode::evaluateToBoolean(ExecState* exec)
    21372137{
    2138     return inlineEvaluateToNumber(exec);
     2138    double result = inlineEvaluateToNumber(exec);
     2139    return  result > 0.0 || 0.0 > result; // NaN produces false as well
    21392140}
    21402141
     
    22112212bool ModNode::evaluateToBoolean(ExecState* exec)
    22122213{
    2213     return inlineEvaluateToNumber(exec);
     2214    double result = inlineEvaluateToNumber(exec);
     2215    return  result > 0.0 || 0.0 > result; // NaN produces false as well
    22142216}
    22152217
  • trunk/LayoutTests/ChangeLog

    r30176 r30191  
     12008-02-13  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Alexey P.
     4
     5        Tests for <rdar://problem/5737003> REGRESSION (r27747): can't browse pictures on fastcupid.com
     6
     7        Ensure that the basic arithmetic operands can correctly handle the NaN -> boolean conversion
     8
     9        * fast/js/convert-nan-to-bool.html: Added.
     10        * fast/js/convert-nan-to-bool-expected.txt: Added.
     11        * fast/js/resources/convert-nan-to-bool.js: Added.
     12
    1132008-02-12  Dan Bernstein  <mitz@apple.com>
    214
Note: See TracChangeset for help on using the changeset viewer.