Changeset 12489 in webkit for trunk/JavaScriptCore
- Timestamp:
- Jan 30, 2006, 11:41:01 PM (19 years ago)
- Location:
- trunk/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/ChangeLog
r12473 r12489 1 2006-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 1 20 2006-01-29 Maciej Stachowiak <[email protected]> 2 21 -
trunk/JavaScriptCore/kjs/nodes.cpp
r12317 r12489 849 849 return jsString("string"); 850 850 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"); 855 861 } 856 862 } -
trunk/JavaScriptCore/kjs/object.h
r12317 r12489 495 495 bool getPropertyAttributes(const Identifier& propertyName, int& attributes) const; 496 496 497 // Returns whether the object should be treated as nullwhen doing equality comparisons498 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; } 499 499 500 500 // This get function only looks at the property map. -
trunk/JavaScriptCore/kjs/operations.cpp
r12317 r12489 131 131 return equal(exec, v1, v2->toPrimitive(exec)); 132 132 if (t1 == NullType && t2 == ObjectType) 133 return static_cast<JSObject *>(v2)-> isEqualToNull(exec);133 return static_cast<JSObject *>(v2)->masqueradeAsUndefined(); 134 134 if (t1 >= ObjectType && (t2 == StringType || t2 == NumberType)) 135 135 return equal(exec, v1->toPrimitive(exec), v2); 136 136 if (t1 == ObjectType && t2 == NullType) 137 return static_cast<JSObject *>(v1)-> isEqualToNull(exec);137 return static_cast<JSObject *>(v1)->masqueradeAsUndefined(); 138 138 if (t1 != t2) 139 139 return false;
Note:
See TracChangeset
for help on using the changeset viewer.