Modified: trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp (154312 => 154313)
--- trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-08-20 05:34:46 UTC (rev 154312)
+++ trunk/Source/_javascript_Core/runtime/JSGlobalObject.cpp 2013-08-20 05:47:14 UTC (rev 154313)
@@ -641,13 +641,7 @@
return symbolTableGet(thisObject, propertyName, slot);
}
-bool JSGlobalObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object);
- if (getStaticFunctionDescriptor<Base>(exec, ExecState::globalObjectTable(exec), thisObject, propertyName, descriptor))
- return true;
- return symbolTableGet(thisObject, propertyName, descriptor);
-}
+GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSGlobalObject)
void JSGlobalObject::clearRareData(JSCell* cell)
{
Modified: trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h (154312 => 154313)
--- trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h 2013-08-20 05:34:46 UTC (rev 154312)
+++ trunk/Source/_javascript_Core/runtime/JSSymbolTableObject.h 2013-08-20 05:47:14 UTC (rev 154313)
@@ -79,7 +79,7 @@
return false;
SymbolTableEntry::Fast entry = iter->value;
ASSERT(!entry.isNull());
- slot.setValue(object, entry.getAttributes(), object->registerAt(entry.getIndex()).get());
+ slot.setValue(object, entry.getAttributes() | DontDelete, object->registerAt(entry.getIndex()).get());
return true;
}
@@ -111,7 +111,7 @@
return false;
SymbolTableEntry::Fast entry = iter->value;
ASSERT(!entry.isNull());
- slot.setValue(object, entry.getAttributes(), object->registerAt(entry.getIndex()).get());
+ slot.setValue(object, entry.getAttributes() | DontDelete, object->registerAt(entry.getIndex()).get());
slotIsWriteable = !entry.isReadOnly();
return true;
}
Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (154312 => 154313)
--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2013-08-20 05:34:46 UTC (rev 154312)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp 2013-08-20 05:47:14 UTC (rev 154313)
@@ -161,22 +161,22 @@
if (entry->attributes() & JSC::Function) {
if (entry->function() == jsDOMWindowPrototypeFunctionBlur) {
if (!allowsAccess) {
- slot.setCustom(thisObject, entry->attributes(), nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
return true;
}
} else if (entry->function() == jsDOMWindowPrototypeFunctionClose) {
if (!allowsAccess) {
- slot.setCustom(thisObject, entry->attributes(), nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
return true;
}
} else if (entry->function() == jsDOMWindowPrototypeFunctionFocus) {
if (!allowsAccess) {
- slot.setCustom(thisObject, entry->attributes(), nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
return true;
}
} else if (entry->function() == jsDOMWindowPrototypeFunctionPostMessage) {
if (!allowsAccess) {
- slot.setCustom(thisObject, entry->attributes(), nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
return true;
}
} else if (entry->function() == jsDOMWindowPrototypeFunctionShowModalDialog) {
@@ -198,7 +198,7 @@
entry = JSDOMWindow::info()->propHashTable(exec)->entry(exec, propertyName);
if (entry) {
- slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());
+ slot.setCustom(thisObject, allowsAccess ? entry->attributes() : ReadOnly | DontDelete | DontEnum, entry->propertyGetter());
return true;
}
@@ -331,79 +331,8 @@
return Base::getOwnPropertySlotByIndex(thisObject, exec, index, slot);
}
-bool JSDOMWindow::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor)
-{
- JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(object);
- // Never allow cross-domain getOwnPropertyDescriptor
- if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, thisObject->impl()))
- return false;
+GET_OWN_PROPERTY_DESCRIPTOR_IMPL(JSDOMWindow)
- const HashEntry* entry;
-
- // We don't want any properties other than "close" and "closed" on a closed window.
- if (!thisObject->impl()->frame()) {
- // The following code is safe for cross-domain and same domain use.
- // It ignores any custom properties that might be set on the DOMWindow (including a custom prototype).
- entry = s_info.propHashTable(exec)->entry(exec, propertyName);
- if (entry && !(entry->attributes() & JSC::Function) && entry->propertyGetter() == jsDOMWindowClosed) {
- descriptor.setDescriptor(jsBoolean(true), ReadOnly | DontDelete | DontEnum);
- return true;
- }
- entry = JSDOMWindowPrototype::info()->propHashTable(exec)->entry(exec, propertyName);
- if (entry && (entry->attributes() & JSC::Function) && entry->function() == jsDOMWindowPrototypeFunctionClose) {
- PropertySlot slot(thisObject);
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
- return true;
- }
- descriptor.setUndefined();
- return true;
- }
-
- entry = JSDOMWindow::info()->propHashTable(exec)->entry(exec, propertyName);
- if (entry) {
- PropertySlot slot(thisObject);
- slot.setCustom(thisObject, entry->attributes(), entry->propertyGetter());
- descriptor.setDescriptor(slot.getValue(exec, propertyName), entry->attributes());
- return true;
- }
-
- // Check for child frames by name before built-in properties to
- // match Mozilla. This does not match IE, but some sites end up
- // naming frames things that conflict with window properties that
- // are in Moz but not IE. Since we have some of these, we have to do
- // it the Moz way.
- if (thisObject->impl()->frame()->tree()->scopedChild(propertyNameToAtomicString(propertyName))) {
- PropertySlot slot(thisObject);
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, childFrameGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
- return true;
- }
-
- unsigned i = propertyName.asIndex();
- if (i < thisObject->impl()->frame()->tree()->scopedChildCount()) {
- ASSERT(i != PropertyName::NotAnIndex);
- PropertySlot slot(thisObject);
- slot.setCustomIndex(thisObject, ReadOnly | DontDelete | DontEnum, i, indexGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
- return true;
- }
-
- // Allow shortcuts like 'Image1' instead of document.images.Image1
- Document* document = thisObject->impl()->frame()->document();
- if (document->isHTMLDocument()) {
- AtomicStringImpl* atomicPropertyName = findAtomicString(propertyName);
- if (atomicPropertyName && toHTMLDocument(document)->hasWindowNamedItem(atomicPropertyName)) {
- PropertySlot slot(thisObject);
- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, namedItemGetter);
- descriptor.setDescriptor(slot.getValue(exec, propertyName), ReadOnly | DontDelete | DontEnum);
- return true;
- }
- }
-
- return Base::getOwnPropertyDescriptor(thisObject, exec, propertyName, descriptor);
-}
-
void JSDOMWindow::put(JSCell* cell, ExecState* exec, PropertyName propertyName, JSValue value, PutPropertySlot& slot)
{
JSDOMWindow* thisObject = jsCast<JSDOMWindow*>(cell);