Changeset 30191 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp


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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.