void JSTestActiveDOMObjectOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) { JSTestActiveDOMObject* jsTestActiveDOMObject = jsCast<JSTestActiveDOMObject*>(handle.slot()->asCell()); DOMWrapperWorld& world = *static_cast<DOMWrapperWorld*>(context); uncacheWrapper(world, &jsTestActiveDOMObject->impl(), jsTestActiveDOMObject); jsTestActiveDOMObject->releaseImpl(); }
JSValue jsTestActiveDOMObjectConstructor(ExecState* exec, JSValue slotBase, PropertyName) { JSTestActiveDOMObject* domObject = jsCast<JSTestActiveDOMObject*>(asObject(slotBase)); if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, domObject->impl())) return jsUndefined(); return JSTestActiveDOMObject::getConstructor(exec, domObject->globalObject()); }
bool JSTestActiveDOMObject::getOwnPropertyDescriptor(JSObject* object, ExecState* exec, PropertyName propertyName, PropertyDescriptor& descriptor) { JSTestActiveDOMObject* thisObject = jsCast<JSTestActiveDOMObject*>(object); ASSERT_GC_OBJECT_INHERITS(thisObject, &s_info); if (!shouldAllowAccessToFrame(exec, thisObject->impl()->frame())) return false; return getStaticValueDescriptor<JSTestActiveDOMObject, Base>(exec, &JSTestActiveDOMObjectTable, thisObject, propertyName, descriptor); }
EncodedJSValue jsTestActiveDOMObjectConstructor(ExecState* state, JSObject*, EncodedJSValue thisValue, PropertyName) { JSTestActiveDOMObject* domObject = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); if (!domObject) return throwVMTypeError(state); if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, domObject->impl())) return JSValue::encode(jsUndefined()); return JSValue::encode(JSTestActiveDOMObject::getConstructor(state->vm(), domObject->globalObject())); }
static inline JSValue jsTestActiveDOMObjectExcitingAttrGetter(ExecState& state, JSTestActiveDOMObject& thisObject, ThrowScope& throwScope) { UNUSED_PARAM(throwScope); UNUSED_PARAM(state); if (!BindingSecurity::shouldAllowAccessToDOMWindow(&state, thisObject.wrapped().window(), ThrowSecurityError)) return jsUndefined(); auto& impl = thisObject.wrapped(); JSValue result = toJS<IDLLong>(state, throwScope, impl.excitingAttr()); return result; }
JSValue jsTestActiveDOMObjectExcitingAttr(ExecState* exec, JSValue slotBase, PropertyName) { JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(slotBase)); if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl())) return jsUndefined(); UNUSED_PARAM(exec); TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl()); JSValue result = jsNumber(impl->excitingAttr()); return result; }
EncodedJSValue jsTestActiveDOMObjectExcitingAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName) { UNUSED_PARAM(exec); UNUSED_PARAM(slotBase); UNUSED_PARAM(thisValue); JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(slotBase); if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl())) return JSValue::encode(jsUndefined()); TestActiveDOMObject& impl = castedThis->impl(); JSValue result = jsNumber(impl.excitingAttr()); return JSValue::encode(result); }
void setJSTestActiveDOMObjectConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) { JSValue value = JSValue::decode(encodedValue); JSTestActiveDOMObject* domObject = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); if (UNLIKELY(!domObject)) { throwVMTypeError(state); return; } if (!shouldAllowAccessToFrame(state, domObject->wrapped().frame())) return; // Shadowing a built-in constructor domObject->putDirect(state->vm(), state->propertyNames().constructor, value); }
EncodedJSValue jsTestActiveDOMObjectExcitingAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName) { UNUSED_PARAM(state); UNUSED_PARAM(slotBase); UNUSED_PARAM(thisValue); JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); if (UNLIKELY(!castedThis)) { return throwGetterTypeError(*state, "TestActiveDOMObject", "excitingAttr"); } if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->wrapped())) return JSValue::encode(jsUndefined()); auto& impl = castedThis->wrapped(); JSValue result = jsNumber(impl.excitingAttr()); return JSValue::encode(result); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(ExecState* state) { JSValue thisValue = state->thisValue(); JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(thisValue); if (UNLIKELY(!castedThis)) return throwThisTypeError(*state, "TestActiveDOMObject", "postMessage"); ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info()); auto& impl = castedThis->impl(); if (UNLIKELY(state->argumentCount() < 1)) return throwVMError(state, createNotEnoughArgumentsError(state)); String message = state->argument(0).toString(state)->value(state); if (UNLIKELY(state->hadException())) return JSValue::encode(jsUndefined()); impl.postMessage(message); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestActiveDOMObject::s_info)) return throwVMTypeError(exec); JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info); TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createNotEnoughArgumentsError(exec)); const String& message(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); if (exec->hadException()) return JSValue::encode(jsUndefined()); impl->postMessage(message); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionPostMessage(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(thisValue); if (UNLIKELY(!castedThis)) return throwVMTypeError(exec); ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info()); TestActiveDOMObject& impl = castedThis->impl(); if (exec->argumentCount() < 1) return throwVMError(exec, createNotEnoughArgumentsError(exec)); const String& message(exec->argument(0).isEmpty() ? String() : exec->argument(0).toString(exec)->value(exec)); if (UNLIKELY(exec->hadException())) return JSValue::encode(jsUndefined()); impl.postMessage(message); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(ExecState* state) { JSValue thisValue = state->thisValue(); JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(thisValue); if (UNLIKELY(!castedThis)) return throwThisTypeError(*state, "TestActiveDOMObject", "excitingFunction"); ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestActiveDOMObject::info()); if (!BindingSecurity::shouldAllowAccessToDOMWindow(state, castedThis->impl())) return JSValue::encode(jsUndefined()); auto& impl = castedThis->impl(); if (UNLIKELY(state->argumentCount() < 1)) return throwVMError(state, createNotEnoughArgumentsError(state)); Node* nextChild = JSNode::toWrapped(state->argument(0)); if (UNLIKELY(state->hadException())) return JSValue::encode(jsUndefined()); impl.excitingFunction(nextChild); return JSValue::encode(jsUndefined()); }
EncodedJSValue JSC_HOST_CALL jsTestActiveDOMObjectPrototypeFunctionExcitingFunction(ExecState* exec) { JSValue thisValue = exec->hostThisValue(); if (!thisValue.inherits(&JSTestActiveDOMObject::s_info)) return throwVMTypeError(exec); JSTestActiveDOMObject* castedThis = jsCast<JSTestActiveDOMObject*>(asObject(thisValue)); ASSERT_GC_OBJECT_INHERITS(castedThis, &JSTestActiveDOMObject::s_info); if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl())) return JSValue::encode(jsUndefined()); TestActiveDOMObject* impl = static_cast<TestActiveDOMObject*>(castedThis->impl()); if (exec->argumentCount() < 1) return throwVMError(exec, createNotEnoughArgumentsError(exec)); Node* nextChild(toNode(exec->argument(0))); if (exec->hadException()) return JSValue::encode(jsUndefined()); impl->excitingFunction(nextChild); return JSValue::encode(jsUndefined()); }
EncodedJSValue jsTestActiveDOMObjectExcitingAttr(ExecState* exec, JSObject* slotBase, EncodedJSValue thisValue, PropertyName) { JSTestActiveDOMObject* castedThis = jsDynamicCast<JSTestActiveDOMObject*>(JSValue::decode(thisValue)); UNUSED_PARAM(slotBase); if (UNLIKELY(!castedThis)) { if (jsDynamicCast<JSTestActiveDOMObjectPrototype*>(slotBase)) { ScriptExecutionContext* scriptExecutionContext = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject())->scriptExecutionContext(); scriptExecutionContext->addConsoleMessage(MessageSource::JS, MessageLevel::Error, String("Deprecated attempt to access property 'excitingAttr' on a non-TestActiveDOMObject object.")); return JSValue::encode(jsUndefined()); } return throwVMTypeError(exec); } if (!BindingSecurity::shouldAllowAccessToDOMWindow(exec, castedThis->impl())) return JSValue::encode(jsUndefined()); UNUSED_PARAM(exec); TestActiveDOMObject& impl = castedThis->impl(); JSValue result = jsNumber(impl.excitingAttr()); return JSValue::encode(result); }