Changeset 11923 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 7, 2006, 2:32:25 AM (19 years ago)
Author:
andersca
Message:

2006-01-07 Anders Carlsson <[email protected]>

Reviewed by Maciej.

  • kjs/object.h: (KJS::JSObject::isEqualToNull): Add new function which returns true if an object should be treated as null when doing comparisons.
  • kjs/operations.cpp: (KJS::equal): Use isEqualToNull.
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r11922 r11923  
     12006-01-07  Anders Carlsson  <[email protected]>
     2
     3        Reviewed by Maciej.
     4       
     5        - fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6373
     6        REGRESSION: JavaScript hang when comparing large array to null
     7       
     8        * kjs/object.h:
     9        (KJS::JSObject::isEqualToNull):
     10        Add new function which returns true if an object should be treated as null when
     11        doing comparisons.
     12       
     13        * kjs/operations.cpp:
     14        (KJS::equal):
     15        Use isEqualToNull.
     16
    1172006-01-07  Alexey Proskuryakov  <[email protected]>
    218
    319        Reviewed by Maciej.
    420
    5         - Fix WebCore development build
    6         http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
     21            - Fix WebCore development build
     22            http://bugzilla.opendarwin.org/show_bug.cgi?id=6408
    723
    824        * kxmlcore/Assertions.h: Use __VA_ARGS__ in variadic macros.
     
    1733        Changes mostly thanks to Maks Orlovich, tweaked a little by me.
    1834
    19         * kjs/create_hash_table: Use the same hash as the one used buy Identifier.
     35        * kjs/create_hash_table: Use the same hash as the one used by Identifier.
    2036        * kjs/function.cpp:
    2137        (KJS::FunctionImp::processParameters): Use the new List::copyFrom
  • trunk/JavaScriptCore/kjs/object.h

    r11773 r11923  
    492492    UString toString(ExecState *exec) const;
    493493    JSObject *toObject(ExecState *exec) const;
    494 
     494   
    495495    bool getPropertyAttributes(const Identifier& propertyName, int& attributes) const;
     496   
     497    // Returns whether the object should be treated as null when doing equality comparisons
     498    virtual bool isEqualToNull(ExecState *) const { return false; }
    496499   
    497500    // This get function only looks at the property map.
  • trunk/JavaScriptCore/kjs/operations.cpp

    r11795 r11923  
    130130            if ((t1 == StringType || t1 == NumberType) && t2 >= ObjectType)
    131131                return equal(exec, v1, v2->toPrimitive(exec));
    132             if (t1 == NullType && t2 >= ObjectType)
    133                 return equal(exec, v1, v2->toPrimitive(exec, NullType));
     132            if (t1 == NullType && t2 == ObjectType)
     133                return static_cast<JSObject *>(v2)->isEqualToNull(exec);
    134134            if (t1 >= ObjectType && (t2 == StringType || t2 == NumberType))
    135135                return equal(exec, v1->toPrimitive(exec), v2);
    136             if (t1 >= ObjectType && t2 == NullType)
    137                 return equal(exec, v1->toPrimitive(exec, NullType), v2);
     136            if (t1 == ObjectType && t2 == NullType)
     137                return static_cast<JSObject *>(v1)->isEqualToNull(exec);
    138138            if (t1 != t2)
    139139                return false;
Note: See TracChangeset for help on using the changeset viewer.