Changeset 99018 in webkit for trunk/Source/JavaScriptCore/runtime/JSObject.cpp
- Timestamp:
- Nov 1, 2011, 5:36:20 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/runtime/JSObject.cpp
r98932 r99018 403 403 } 404 404 405 void JSObject::defineSetter( ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes)405 void JSObject::defineSetter(JSObject* thisObject, ExecState* exec, const Identifier& propertyName, JSObject* setterFunction, unsigned attributes) 406 406 { 407 407 if (propertyName == exec->propertyNames().underscoreProto) { … … 410 410 } 411 411 412 JSValue object = getDirect(exec->globalData(), propertyName);412 JSValue object = thisObject->getDirect(exec->globalData(), propertyName); 413 413 if (object && object.isGetterSetter()) { 414 ASSERT( structure()->hasGetterSetterProperties());414 ASSERT(thisObject->structure()->hasGetterSetterProperties()); 415 415 asGetterSetter(object)->setSetter(exec->globalData(), setterFunction); 416 416 return; … … 419 419 PutPropertySlot slot; 420 420 GetterSetter* getterSetter = GetterSetter::create(exec); 421 putDirectInternal(exec->globalData(), propertyName, getterSetter, attributes | Setter, true, slot, 0);421 thisObject->putDirectInternal(exec->globalData(), propertyName, getterSetter, attributes | Setter, true, slot, 0); 422 422 423 423 // putDirect will change our Structure if we add a new property. For … … 425 425 // if we override an existing non-getter or non-setter. 426 426 if (slot.type() != PutPropertySlot::NewProperty) { 427 if (! structure()->isDictionary())428 setStructure(exec->globalData(), Structure::getterSetterTransition(exec->globalData(),structure()));429 } 430 431 structure()->setHasGetterSetterProperties(true);427 if (!thisObject->structure()->isDictionary()) 428 thisObject->setStructure(exec->globalData(), Structure::getterSetterTransition(exec->globalData(), thisObject->structure())); 429 } 430 431 thisObject->structure()->setHasGetterSetterProperties(true); 432 432 getterSetter->setSetter(exec->globalData(), setterFunction); 433 433 } … … 737 737 return false; 738 738 if (descriptor.setter() && descriptor.setter().isObject()) 739 target-> defineSetter(exec, propertyName, asObject(descriptor.setter()), attributes);739 target->methodTable()->defineSetter(target, exec, propertyName, asObject(descriptor.setter()), attributes); 740 740 return !exec->hadException(); 741 741 }
Note:
See TracChangeset
for help on using the changeset viewer.