Changeset 196678 in webkit
- Timestamp:
- Feb 16, 2016 6:34:36 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r196676 r196678 1 2016-02-16 Gavin Barraclough <barraclough@apple.com> 2 3 JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=154257 5 6 Reviewed by Chris Dumez. 7 8 * runtime/Lookup.h: 9 (JSC::getStaticPropertySlot): 10 (JSC::getStaticFunctionSlot): 11 (JSC::getStaticValueSlot): 12 - this could all do with a little more love. 13 But enforce the basic precedence: 14 (1) regular storage properties always win over static table properties. 15 (2) if properties have been reified, don't consult the static tables. 16 (3) only if the property is not present on the object & not reified 17 should the static hashtable be consulted. 18 1 19 2016-02-16 Gavin Barraclough <barraclough@apple.com> 2 20 -
trunk/Source/JavaScriptCore/runtime/Lookup.h
r196648 r196678 211 211 inline bool getStaticPropertySlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot) 212 212 { 213 const HashTableValue* entry = table.entry(propertyName); 214 215 if (!entry) // not found, forward to parent 216 return ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot); 213 if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot)) 214 return true; 215 216 if (thisObj->staticFunctionsReified()) 217 return false; 218 219 auto* entry = table.entry(propertyName); 220 if (!entry) 221 return false; 217 222 218 223 if (entry->attributes() & BuiltinOrFunctionOrAccessor) … … 239 244 return true; 240 245 241 const HashTableValue* entry = table.entry(propertyName); 246 if (thisObj->staticFunctionsReified()) 247 return false; 248 249 auto* entry = table.entry(propertyName); 242 250 if (!entry) 243 251 return false; … … 253 261 inline bool getStaticValueSlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot) 254 262 { 255 const HashTableValue* entry = table.entry(propertyName); 256 257 if (!entry) // not found, forward to parent 258 return ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot); 263 if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot)) 264 return true; 265 266 if (thisObj->staticFunctionsReified()) 267 return false; 268 269 auto* entry = table.entry(propertyName); 270 if (!entry) 271 return false; 259 272 260 273 ASSERT(!(entry->attributes() & BuiltinOrFunctionOrAccessor)); -
trunk/Source/WebCore/ChangeLog
r196676 r196678 1 2016-02-16 Gavin Barraclough <barraclough@apple.com> 2 3 JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot 4 https://bugs.webkit.org/show_bug.cgi?id=154257 5 6 Reviewed by Chris Dumez. 7 8 * bindings/js/JSDOMWindowCustom.cpp: 9 (WebCore::JSDOMWindow::getOwnPropertySlot): 10 - JSDOMWindow::getOwnPropertySlot should just call getStaticPropertySlot 11 1 12 2016-02-16 Gavin Barraclough <barraclough@apple.com> 2 13 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r196676 r196678 253 253 slot.setWatchpointSet(thisObject->m_windowCloseWatchpoints); 254 254 255 // (2) Regular own properties.256 // FIXME: we should probably be able to use getStaticPropertySlot here.257 if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))258 return true;259 260 255 // FIXME: These are all bogus. Keeping these here make some tests pass that check these properties 261 256 // are own properties of the window, but introduces other problems instead (e.g. if you overwrite 262 257 // & delete then the original value is restored!) Should be removed. 263 258 if (propertyName == exec->propertyNames().blur) { 264 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>); 259 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 260 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>); 265 261 return true; 266 262 } 267 263 if (propertyName == exec->propertyNames().close) { 268 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>); 264 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 265 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>); 269 266 return true; 270 267 } 271 268 if (propertyName == exec->propertyNames().focus) { 272 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>); 269 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 270 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>); 273 271 return true; 274 272 } 275 273 if (propertyName == exec->propertyNames().postMessage) { 276 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>); 277 return true; 278 } 279 280 if (!thisObject->staticFunctionsReified()) { 281 if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) { 282 if (entry->attributes() & BuiltinOrFunctionOrAccessor) 283 return setUpStaticFunctionSlot(exec, entry, thisObject, propertyName, slot); 284 slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter()); 285 return true; 286 } 287 } 288 274 if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot)) 275 slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>); 276 return true; 277 } 278 // (2) Regular own properties. 279 if (getStaticPropertySlot<JSDOMWindow, Base>(exec, *JSDOMWindow::info()->staticPropHashTable, thisObject, propertyName, slot)) 280 return true; 289 281 // FIXME: this looks pretty bogus. It seems highly likely that if !canShowModalDialog the 290 282 // funtion should still be present, or should be omitted entirely - present but reads as
Note: See TracChangeset
for help on using the changeset viewer.