Changeset 12489 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Jan 30, 2006, 11:41:01 PM (19 years ago)
Author:
andersca
Message:

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

Reviewed by Darin.

Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
REGRESSION: United.com menus messed up due to document.all/MSIE sniff


  • kjs/nodes.cpp: (typeStringForValue): Return "undefined" if the given object should masquerade as undefined.


  • kjs/object.h: (KJS::JSObject::masqueradeAsUndefined): Rename from isEqualToNull.


  • kjs/operations.cpp: (KJS::equal): Update for name change.
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r12473 r12489  
     12006-01-30  Anders Carlsson  <[email protected]>
     2
     3        Reviewed by Darin.
     4
     5        Fix http://bugzilla.opendarwin.org/show_bug.cgi?id=6907
     6        REGRESSION: United.com menus messed up due to document.all/MSIE sniff
     7       
     8        * kjs/nodes.cpp:
     9        (typeStringForValue):
     10        Return "undefined" if the given object should masquerade as undefined.
     11       
     12        * kjs/object.h:
     13        (KJS::JSObject::masqueradeAsUndefined):
     14        Rename from isEqualToNull.
     15       
     16        * kjs/operations.cpp:
     17        (KJS::equal):
     18        Update for name change.
     19
    1202006-01-29  Maciej Stachowiak  <[email protected]>
    221
  • trunk/JavaScriptCore/kjs/nodes.cpp

    r12317 r12489  
    849849        return jsString("string");
    850850    default:
    851         if (v->isObject() && static_cast<JSObject*>(v)->implementsCall())
    852             return jsString("function");
    853         else
    854             return jsString("object");
     851        if (v->isObject()) {
     852            // Return "undefined" for objects that should be treated
     853            // as null when doing comparisons.
     854            if (static_cast<JSObject*>(v)->masqueradeAsUndefined())
     855                return jsString("undefined");           
     856            else if (static_cast<JSObject*>(v)->implementsCall())
     857                return jsString("function");
     858        }
     859       
     860        return jsString("object");
    855861    }
    856862}
  • trunk/JavaScriptCore/kjs/object.h

    r12317 r12489  
    495495    bool getPropertyAttributes(const Identifier& propertyName, int& attributes) const;
    496496   
    497     // Returns whether the object should be treated as null when doing equality comparisons
    498     virtual bool isEqualToNull(ExecState *) const { return false; }
     497    // Returns whether the object should be treated as undefined when doing equality comparisons
     498    virtual bool masqueradeAsUndefined() const { return false; }
    499499   
    500500    // This get function only looks at the property map.
  • trunk/JavaScriptCore/kjs/operations.cpp

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