Esempio n. 1
0
bool JSHTMLDocument::getOwnPropertySlot(JSObject* object, ExecState* exec, PropertyName propertyName, PropertySlot& slot)
{
    JSHTMLDocument* thisObject = jsCast<JSHTMLDocument*>(object);
    ASSERT_GC_OBJECT_INHERITS(thisObject, info());

    if (propertyName == "open") {
        if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
            return true;

        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsHTMLDocumentPrototypeFunctionOpen, 2>);
        return true;
    }

    JSValue value;
    if (thisObject->nameGetter(exec, propertyName, value)) {
        slot.setValue(thisObject, ReadOnly | DontDelete | DontEnum, value);
        return true;
    }

    if (const HashTableValue* entry = JSHTMLDocument::info()->staticPropHashTable->entry(propertyName)) {
        slot.setCacheableCustom(thisObject, entry->attributes(), entry->propertyGetter());
        return true;
    }

    return Base::getOwnPropertySlot(thisObject, exec, propertyName, slot);
}