Changeset 31746 in webkit for trunk/JavaScriptCore/kjs/object_object.cpp
- Timestamp:
- Apr 8, 2008, 7:17:49 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/object_object.cpp
r31208 r31746 110 110 JSValue* objectProtoFuncLookupGetter(ExecState* exec, JSObject* thisObj, const List& args) 111 111 { 112 Identifier propertyName = Identifier(args[0]->toString(exec)); 113 JSObject* obj = thisObj; 114 while (true) { 115 JSValue* v = obj->getDirect(propertyName); 116 if (v) { 117 if (v->type() != GetterSetterType) 118 return jsUndefined(); 119 JSObject* funcObj = static_cast<GetterSetterImp*>(v)->getGetter(); 120 if (!funcObj) 121 return jsUndefined(); 122 return funcObj; 123 } 124 125 if (!obj->prototype() || !obj->prototype()->isObject()) 126 return jsUndefined(); 127 obj = static_cast<JSObject*>(obj->prototype()); 128 } 112 return thisObj->lookupGetter(exec, Identifier(args[0]->toString(exec))); 129 113 } 130 114 131 115 JSValue* objectProtoFuncLookupSetter(ExecState* exec, JSObject* thisObj, const List& args) 132 116 { 133 Identifier propertyName = Identifier(args[0]->toString(exec)); 134 JSObject* obj = thisObj; 135 while (true) { 136 JSValue* v = obj->getDirect(propertyName); 137 if (v) { 138 if (v->type() != GetterSetterType) 139 return jsUndefined(); 140 JSObject* funcObj = static_cast<GetterSetterImp*>(v)->getSetter(); 141 if (!funcObj) 142 return jsUndefined(); 143 return funcObj; 144 } 145 146 if (!obj->prototype() || !obj->prototype()->isObject()) 147 return jsUndefined(); 148 obj = static_cast<JSObject*>(obj->prototype()); 149 } 117 return thisObj->lookupSetter(exec, Identifier(args[0]->toString(exec))); 150 118 } 151 119
Note:
See TracChangeset
for help on using the changeset viewer.