Changeset 30191 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Feb 13, 2008, 1:51:59 AM (17 years ago)
Author:
[email protected]
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/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r30177 r30191  
     12008-02-13  Oliver Hunt  <[email protected]>
     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  <[email protected]>
    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
Note: See TracChangeset for help on using the changeset viewer.