Changeset 98889 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Oct 31, 2011, 3:24:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r98593 r98889 349 349 } 350 350 351 void JSObject::defineGetter( ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes)351 void JSObject::defineGetter(JSObject* thisObject, ExecState* exec, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes) 352 352 { 353 353 if (propertyName == exec->propertyNames().underscoreProto) { … … 356 356 } 357 357 358 JSValue object = getDirect(exec->globalData(), propertyName);358 JSValue object = thisObject->getDirect(exec->globalData(), propertyName); 359 359 if (object && object.isGetterSetter()) { 360 ASSERT( structure()->hasGetterSetterProperties());360 ASSERT(thisObject->structure()->hasGetterSetterProperties()); 361 361 asGetterSetter(object)->setGetter(exec->globalData(), getterFunction); 362 362 return; … … 366 366 PutPropertySlot slot; 367 367 GetterSetter* getterSetter = GetterSetter::create(exec); 368 putDirectInternal(globalData, propertyName, getterSetter, attributes | Getter, true, slot, 0);368 thisObject->putDirectInternal(globalData, propertyName, getterSetter, attributes | Getter, true, slot, 0); 369 369 370 370 // putDirect will change our Structure if we add a new property. For … … 372 372 // if we override an existing non-getter or non-setter. 373 373 if (slot.type() != PutPropertySlot::NewProperty) { 374 if (! structure()->isDictionary())375 setStructure(exec->globalData(), Structure::getterSetterTransition(globalData,structure()));376 } 377 378 structure()->setHasGetterSetterProperties(true);374 if (!thisObject->structure()->isDictionary()) 375 thisObject->setStructure(exec->globalData(), Structure::getterSetterTransition(globalData, thisObject->structure())); 376 } 377 378 thisObject->structure()->setHasGetterSetterProperties(true); 379 379 getterSetter->setGetter(globalData, getterFunction); 380 380 } … … 730 730 attributes &= ~ReadOnly; 731 731 if (descriptor.getter() && descriptor.getter().isObject()) 732 target-> defineGetter(exec, propertyName, asObject(descriptor.getter()), attributes);732 target->methodTable()->defineGetter(target, exec, propertyName, asObject(descriptor.getter()), attributes); 733 733 if (exec->hadException()) 734 734 return false;
Note:
See TracChangeset
for help on using the changeset viewer.