Ignore:
Timestamp:
May 4, 2015, 11:47:33 AM (10 years ago)
Author:
[email protected]
Message:

JSCallbackObject does not maintain symmetry between accesses for getOwnPropertySlot and put
https://bugs.webkit.org/show_bug.cgi?id=144265

Reviewed by Geoffrey Garen.

JSCallbackObject will defer to a parent's implementation of getOwnPropertySlot
for a static function if the parent has that property slot. JSCallbackObject::put
did not maintain this symmetry of also calling ::put on the parent if the parent
has the property. We should ensure that this symmetry exists.

  • API/JSCallbackObjectFunctions.h:

(JSC::JSCallbackObject<Parent>::put):

  • API/tests/testapi.c:
  • API/tests/testapi.js:

(globalStaticFunction2):
(this.globalStaticFunction2):
(iAmNotAStaticFunction):
(this.iAmNotAStaticFunction):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h

    r183005 r183754  
    271271            if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) {
    272272                if (StaticFunctionEntry* entry = staticFunctions->get(name)) {
     273                    PropertySlot getSlot(thisObject);
     274                    if (Parent::getOwnPropertySlot(thisObject, exec, propertyName, getSlot))
     275                        return Parent::put(thisObject, exec, propertyName, value, slot);
    273276                    if (entry->attributes & kJSPropertyAttributeReadOnly)
    274277                        return;
Note: See TracChangeset for help on using the changeset viewer.