Ignore:
Timestamp:
May 24, 2013, 3:00:21 PM (12 years ago)
Author:
[email protected]
Message:

We broke !(0/0)
https://bugs.webkit.org/show_bug.cgi?id=116736

Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

  • parser/ASTBuilder.h:

(JSC::ASTBuilder::createLogicalNot):

  • runtime/JSCJSValueInlines.h:

(JSC::JSValue::pureToBoolean):

Source/WTF:

  • wtf/MathExtras.h:

(isNotZeroAndOrdered):
(isZeroOrUnordered):

LayoutTests:

  • fast/js/constant-fold-not-nan.html: Added.
  • fast/js/constant-fold-not-nan-expected.txt: Added.
  • fast/js/jsc-test-list:
  • fast/js/script-tests/constant-fold-not-nan.js: Added.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r149236 r150659  
    799799        return asInt32() ? TrueTriState : FalseTriState;
    800800    if (isDouble())
    801         return (asDouble() > 0.0 || asDouble() < 0.0) ? TrueTriState : FalseTriState; // false for NaN
     801        return isNotZeroAndOrdered(asDouble()) ? TrueTriState : FalseTriState; // false for NaN
    802802    if (isCell())
    803803        return asCell()->pureToBoolean();
Note: See TracChangeset for help on using the changeset viewer.