Beispiel #1
0
void JSattributeOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
{
    JSattribute* jsattribute = jsCast<JSattribute*>(handle.slot()->asCell());
    DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context);
    uncacheWrapper(world, &jsattribute->impl(), jsattribute);
    jsattribute->releaseImpl();
}
Beispiel #2
0
EncodedJSValue jsattributeReadonly(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
{
    JSattribute* castedThis = jsDynamicCast<JSattribute*>(JSValue::decode(slotBase));
    UNUSED_PARAM(exec);
    attribute& impl = castedThis->impl();
    JSValue result = jsStringWithCache(exec, impl.readonly());
    return JSValue::encode(result);
}
Beispiel #3
0
EncodedJSValue jsattributeConstructor(ExecState* exec, EncodedJSValue thisValue, EncodedJSValue, PropertyName)
{
    JSattribute* domObject = jsDynamicCast<JSattribute*>(JSValue::decode(thisValue));
    if (!domObject)
        return throwVMTypeError(exec);
    if (!domObject)
        return throwVMTypeError(exec);
    return JSValue::encode(JSattribute::getConstructor(exec->vm(), domObject->globalObject()));
}
Beispiel #4
0
EncodedJSValue jsattributeReadonly(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
{
    UNUSED_PARAM(state);
    UNUSED_PARAM(slotBase);
    UNUSED_PARAM(thisValue);
    JSattribute* castedThis = jsDynamicCast<JSattribute*>(JSValue::decode(thisValue));
    if (UNLIKELY(!castedThis))
        return throwGetterTypeError(*state, "attribute", "readonly");
    auto& impl = castedThis->wrapped();
    JSValue result = jsStringWithCache(state, impl.readonly());
    return JSValue::encode(result);
}
Beispiel #5
0
EncodedJSValue jsattributeReadonly(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
{
    UNUSED_PARAM(exec);
    UNUSED_PARAM(slotBase);
    UNUSED_PARAM(thisValue);
    JSattribute* castedThis = jsDynamicCast<JSattribute*>(JSValue::decode(thisValue));
    if (UNLIKELY(!castedThis)) {
        if (jsDynamicCast<JSattributePrototype*>(slotBase))
            return reportDeprecatedGetterError(*exec, "attribute", "readonly");
        return throwGetterTypeError(*exec, "attribute", "readonly");
    }
    attribute& impl = castedThis->impl();
    JSValue result = jsStringWithCache(exec, impl.readonly());
    return JSValue::encode(result);
}
Beispiel #6
0
EncodedJSValue jsattributeReadonly(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
{
    JSattribute* castedThis = jsDynamicCast<JSattribute*>(JSValue::decode(thisValue));
    UNUSED_PARAM(slotBase);
    if (!castedThis) {
        if (jsDynamicCast<JSattributePrototype*>(slotBase)) {
            ScriptExecutionContext* scriptExecutionContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext();
            scriptExecutionContext->addConsoleMessage(MessageSource::JS, MessageLevel::Error, String("Deprecated attempt to access property 'readonly' on a non-attribute object."));
            return JSValue::encode(jsUndefined());
        }
        return throwVMTypeError(exec);
    }
    UNUSED_PARAM(exec);
    attribute& impl = castedThis->impl();
    JSValue result = jsStringWithCache(exec, impl.readonly());
    return JSValue::encode(result);
}
Beispiel #7
0
EncodedJSValue jsattributeConstructor(ExecState* exec, EncodedJSValue slotBase, EncodedJSValue, PropertyName)
{
    JSattribute* domObject = jsDynamicCast<JSattribute*>(JSValue::decode(slotBase));
    return JSValue::encode(JSattribute::getConstructor(exec->vm(), domObject->globalObject()));
}