Modified: trunk/Source/_javascript_Core/runtime/Lookup.h (196677 => 196678)
--- trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-17 02:20:52 UTC (rev 196677)
+++ trunk/Source/_javascript_Core/runtime/Lookup.h 2016-02-17 02:34:36 UTC (rev 196678)
@@ -210,11 +210,16 @@
template <class ThisImp, class ParentImp>
inline bool getStaticPropertySlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
{
- const HashTableValue* entry = table.entry(propertyName);
+ if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot))
+ return true;
- if (!entry) // not found, forward to parent
- return ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot);
+ if (thisObj->staticFunctionsReified())
+ return false;
+ auto* entry = table.entry(propertyName);
+ if (!entry)
+ return false;
+
if (entry->attributes() & BuiltinOrFunctionOrAccessor)
return setUpStaticFunctionSlot(exec, entry, thisObj, propertyName, slot);
@@ -238,7 +243,10 @@
if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot))
return true;
- const HashTableValue* entry = table.entry(propertyName);
+ if (thisObj->staticFunctionsReified())
+ return false;
+
+ auto* entry = table.entry(propertyName);
if (!entry)
return false;
@@ -252,11 +260,16 @@
template <class ThisImp, class ParentImp>
inline bool getStaticValueSlot(ExecState* exec, const HashTable& table, ThisImp* thisObj, PropertyName propertyName, PropertySlot& slot)
{
- const HashTableValue* entry = table.entry(propertyName);
+ if (ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot))
+ return true;
- if (!entry) // not found, forward to parent
- return ParentImp::getOwnPropertySlot(thisObj, exec, propertyName, slot);
+ if (thisObj->staticFunctionsReified())
+ return false;
+ auto* entry = table.entry(propertyName);
+ if (!entry)
+ return false;
+
ASSERT(!(entry->attributes() & BuiltinOrFunctionOrAccessor));
if (entry->attributes() & ConstantInteger) {
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (196677 => 196678)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-17 02:20:52 UTC (rev 196677)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2016-02-17 02:34:36 UTC (rev 196678)
@@ -252,40 +252,32 @@
// (Particularly, is it correct that this exists here but not in getOwnPropertySlotByIndex?)
slot.setWatchpointSet(thisObject->m_windowCloseWatchpoints);
- // (2) Regular own properties.
- // FIXME: we should probably be able to use getStaticPropertySlot here.
- if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
- return true;
-
// FIXME: These are all bogus. Keeping these here make some tests pass that check these properties
// are own properties of the window, but introduces other problems instead (e.g. if you overwrite
// & delete then the original value is restored!) Should be removed.
if (propertyName == exec->propertyNames().blur) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
+ if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
return true;
}
if (propertyName == exec->propertyNames().close) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
+ if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
return true;
}
if (propertyName == exec->propertyNames().focus) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
+ if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
return true;
}
if (propertyName == exec->propertyNames().postMessage) {
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
+ if (!Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
return true;
}
-
- if (!thisObject->staticFunctionsReified()) {
- if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) {
- if (entry->attributes() & BuiltinOrFunctionOrAccessor)
- return setUpStaticFunctionSlot(exec, entry, thisObject, propertyName, slot);
- slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
- return true;
- }
- }
-
+ // (2) Regular own properties.
+ if (getStaticPropertySlot<JSDOMWindow, Base>(exec, *JSDOMWindow::info()->staticPropHashTable, thisObject, propertyName, slot))
+ return true;
// FIXME: this looks pretty bogus. It seems highly likely that if !canShowModalDialog the
// funtion should still be present, or should be omitted entirely - present but reads as
// undefined with unspecified attributes is likely wrong.