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.
File:
1 edited

Legend:

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