Changeset 183754 in webkit
- Timestamp:
- May 4, 2015 11:47:33 AM (9 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/API/JSCallbackObjectFunctions.h
r183005 r183754 271 271 if (OpaqueJSClassStaticFunctionsTable* staticFunctions = jsClass->staticFunctions(exec)) { 272 272 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); 273 276 if (entry->attributes & kJSPropertyAttributeReadOnly) 274 277 return; -
trunk/Source/JavaScriptCore/API/tests/testapi.c
r182297 r183754 961 961 static JSStaticFunction globalObject_staticFunctions[] = { 962 962 { "globalStaticFunction", globalObject_call, kJSPropertyAttributeNone }, 963 { "globalStaticFunction2", globalObject_call, kJSPropertyAttributeNone }, 963 964 { "gc", functionGC, kJSPropertyAttributeNone }, 964 965 { 0, 0, 0 } -
trunk/Source/JavaScriptCore/API/tests/testapi.js
r165676 r183754 75 75 shouldBe("globalStaticValue", 3); 76 76 shouldBe("globalStaticFunction()", 4); 77 shouldBe("this.globalStaticFunction()", 4); 78 79 function globalStaticFunction2() { 80 return 10; 81 } 82 shouldBe("globalStaticFunction2();", 10); 83 this.globalStaticFunction2 = function() { return 20; } 84 shouldBe("globalStaticFunction2();", 20); 85 shouldBe("this.globalStaticFunction2();", 20); 86 87 function iAmNotAStaticFunction() { return 10; } 88 shouldBe("iAmNotAStaticFunction();", 10); 89 this.iAmNotAStaticFunction = function() { return 20; } 90 shouldBe("iAmNotAStaticFunction();", 20); 77 91 78 92 shouldBe("typeof MyObject", "function"); // our object implements 'call' -
trunk/Source/JavaScriptCore/ChangeLog
r183753 r183754 1 2015-05-04 Saam Barati <saambarati1@gmail.com> 2 3 JSCallbackObject does not maintain symmetry between accesses for getOwnPropertySlot and put 4 https://bugs.webkit.org/show_bug.cgi?id=144265 5 6 Reviewed by Geoffrey Garen. 7 8 JSCallbackObject will defer to a parent's implementation of getOwnPropertySlot 9 for a static function if the parent has that property slot. JSCallbackObject::put 10 did not maintain this symmetry of also calling ::put on the parent if the parent 11 has the property. We should ensure that this symmetry exists. 12 13 * API/JSCallbackObjectFunctions.h: 14 (JSC::JSCallbackObject<Parent>::put): 15 * API/tests/testapi.c: 16 * API/tests/testapi.js: 17 (globalStaticFunction2): 18 (this.globalStaticFunction2): 19 (iAmNotAStaticFunction): 20 (this.iAmNotAStaticFunction): 21 1 22 2015-05-04 Andreas Kling <akling@apple.com> 2 23
Note: See TracChangeset
for help on using the changeset viewer.