| /* |
| This file is part of the WebKit open source project. |
| This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| |
| This library is free software; you can redistribute it and/or |
| modify it under the terms of the GNU Library General Public |
| License as published by the Free Software Foundation; either |
| version 2 of the License, or (at your option) any later version. |
| |
| This library is distributed in the hope that it will be useful, |
| but WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| Library General Public License for more details. |
| |
| You should have received a copy of the GNU Library General Public License |
| along with this library; see the file COPYING.LIB. If not, write to |
| the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| Boston, MA 02110-1301, USA. |
| */ |
| |
| #include "config.h" |
| |
| #if ENABLE(Condition1) || ENABLE(Condition2) |
| |
| #include "JSTestInterface.h" |
| |
| #include "ExceptionCode.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include "TestObj.h" |
| #include "TestSupplemental.h" |
| #include <runtime/Error.h> |
| #include <runtime/FunctionPrototype.h> |
| #include <wtf/GetPtr.h> |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| #include "TestSupplementalBuiltins.h" |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23) |
| #include "JSNode.h" |
| #include "JSTestObj.h" |
| #include "Node.h" |
| #include "URL.h" |
| #include <runtime/JSString.h> |
| #endif |
| |
| using namespace JSC; |
| |
| namespace WebCore { |
| |
| // Functions |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(JSC::ExecState*); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(JSC::ExecState*); |
| #endif |
| |
| // Attributes |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceConstructorImplementsStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceImplementsStr1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceImplementsStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceImplementsStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceImplementsStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceImplementsStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| JSC::EncodedJSValue jsTestInterfaceImplementsNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceImplementsNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceConstructorSupplementalStaticAttr(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceSupplementalStr1(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceSupplementalStr2(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceSupplementalStr3(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| JSC::EncodedJSValue jsTestInterfaceSupplementalNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceSupplementalNode(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| #endif |
| JSC::EncodedJSValue jsTestInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestInterfaceConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSTestInterfacePrototype : public JSC::JSNonFinalObject { |
| public: |
| typedef JSC::JSNonFinalObject Base; |
| static JSTestInterfacePrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSTestInterfacePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestInterfacePrototype>(vm.heap)) JSTestInterfacePrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| DECLARE_INFO; |
| static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| { |
| return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| } |
| |
| private: |
| JSTestInterfacePrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| typedef JSDOMConstructor<JSTestInterface> JSTestInterfaceConstructor; |
| |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSTestInterfaceConstructorTableValues[] = |
| { |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsStaticAttr", DontDelete, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorImplementsStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorImplementsStaticAttr) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStaticReadOnlyAttr", DontDelete | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStaticAttr", DontDelete, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructorSupplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructorSupplementalStaticAttr) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsMethod4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionImplementsMethod4), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod4", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfaceConstructorFunctionSupplementalMethod4), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| }; |
| |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| COMPILE_ASSERT(1 == TestInterface::IMPLEMENTSCONSTANT1, TestInterfaceEnumIMPLEMENTSCONSTANT1IsWrongUseDoNotCheckConstants); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| COMPILE_ASSERT(2 == TestInterface::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| COMPILE_ASSERT(1 == TestSupplemental::SUPPLEMENTALCONSTANT1, TestInterfaceEnumSUPPLEMENTALCONSTANT1IsWrongUseDoNotCheckConstants); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| COMPILE_ASSERT(2 == TestSupplemental::CONST_IMPL, TestInterfaceEnumCONST_IMPLIsWrongUseDoNotCheckConstants); |
| #endif |
| |
| template<> EncodedJSValue JSC_HOST_CALL JSTestInterfaceConstructor::construct(ExecState* state) |
| { |
| auto* castedThis = jsCast<JSTestInterfaceConstructor*>(state->callee()); |
| if (UNLIKELY(state->argumentCount() < 1)) |
| return throwVMError(state, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| String str1 = state->argument(0).toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| String str2 = state->argument(1).isUndefined() ? ASCIILiteral("defaultString") : state->uncheckedArgument(1).toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| ScriptExecutionContext* context = castedThis->scriptExecutionContext(); |
| if (UNLIKELY(!context)) |
| return throwConstructorDocumentUnavailableError(*state, "TestInterface"); |
| RefPtr<TestInterface> object = TestInterface::create(*context, str1, str2, ec); |
| if (UNLIKELY(ec)) { |
| setDOMException(state, ec); |
| return JSValue::encode(JSValue()); |
| } |
| return JSValue::encode(asObject(toJS(state, castedThis->globalObject(), object.get()))); |
| } |
| |
| template<> JSValue JSTestInterfaceConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSTestInterfaceConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSTestInterface::prototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestInterface"))), ReadOnly | DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(1), ReadOnly | DontEnum); |
| reifyStaticProperties(vm, JSTestInterfaceConstructorTableValues, *this); |
| } |
| |
| template<> ConstructType JSTestInterfaceConstructor::getConstructData(JSCell* cell, ConstructData& constructData) |
| { |
| #if ENABLE(TEST_INTERFACE) |
| UNUSED_PARAM(cell); |
| constructData.native.function = construct; |
| return ConstructType::Host; |
| #else |
| return Base::getConstructData(cell, constructData); |
| #endif |
| } |
| |
| template<> const ClassInfo JSTestInterfaceConstructor::s_info = { "TestInterface", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestInterfaceConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSTestInterfacePrototypeTableValues[] = |
| { |
| { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructor) } }, |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsStr1", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsStr2", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsStr3", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsStr3) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsNode", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceImplementsNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceImplementsNode) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr1", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr2", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr3", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalStr3) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalNode", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceSupplementalNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceSupplementalNode) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "builtinAttribute", Accessor | Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinAttributeCodeGenerator), (intptr_t) (setTestSupplementalBuiltinAttributeCodeGenerator) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { 0, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| }; |
| |
| const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterfacePrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestInterfacePrototype) }; |
| |
| void JSTestInterfacePrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSTestInterfacePrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSTestInterface::s_info = { "TestInterface", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestInterface) }; |
| |
| JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestInterface>&& impl) |
| : JSDOMWrapper<TestInterface>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| JSObject* JSTestInterface::createPrototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return JSTestInterfacePrototype::create(vm, globalObject, JSTestInterfacePrototype::createStructure(vm, globalObject, globalObject->objectPrototype())); |
| } |
| |
| JSObject* JSTestInterface::prototype(VM& vm, JSGlobalObject* globalObject) |
| { |
| return getDOMPrototype<JSTestInterface>(vm, globalObject); |
| } |
| |
| void JSTestInterface::destroy(JSC::JSCell* cell) |
| { |
| JSTestInterface* thisObject = static_cast<JSTestInterface*>(cell); |
| thisObject->JSTestInterface::~JSTestInterface(); |
| } |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceConstructorImplementsStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue result = jsNumber(TestInterface::implementsStaticReadOnlyAttr()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue result = jsStringWithCache(state, TestInterface::implementsStaticAttr()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceImplementsStr1(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "implementsStr1"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.implementsStr1()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "implementsStr2"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, impl.implementsStr2()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "implementsStr3"); |
| } |
| return JSValue::encode(castedThis->implementsStr3(*state)); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue jsTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "implementsNode"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsNode())); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceConstructorSupplementalStaticReadOnlyAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue result = jsNumber(WebCore::TestSupplemental::supplementalStaticReadOnlyAttr()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStaticAttr()); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceSupplementalStr1(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "supplementalStr1"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr1(impl)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "supplementalStr2"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = jsStringWithCache(state, WebCore::TestSupplemental::supplementalStr2(impl)); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "supplementalStr3"); |
| } |
| return JSValue::encode(castedThis->supplementalStr3(*state)); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue jsTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| UNUSED_PARAM(state); |
| UNUSED_PARAM(thisValue); |
| JSValue decodedThisValue = JSValue::decode(thisValue); |
| auto* castedThis = jsDynamicCast<JSTestInterface*>(decodedThisValue); |
| if (UNLIKELY(!castedThis)) { |
| return throwGetterTypeError(*state, "TestInterface", "supplementalNode"); |
| } |
| auto& impl = castedThis->wrapped(); |
| JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalNode(impl))); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| EncodedJSValue jsTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName) |
| { |
| JSTestInterfacePrototype* domObject = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) |
| return throwVMTypeError(state); |
| return JSValue::encode(JSTestInterface::getConstructor(state->vm(), domObject->globalObject())); |
| } |
| |
| bool setJSTestInterfaceConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| JSTestInterfacePrototype* domObject = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!domObject)) { |
| throwVMTypeError(state); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return domObject->putDirect(state->vm(), state->propertyNames().constructor, value); |
| } |
| |
| bool JSTestInterface::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& slot) |
| { |
| auto* thisObject = jsCast<JSTestInterface*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| bool putResult = false; |
| if (thisObject->putDelegate(state, propertyName, value, slot, putResult)) |
| return putResult; |
| return Base::put(thisObject, state, propertyName, value, slot); |
| } |
| |
| bool JSTestInterface::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow) |
| { |
| auto* thisObject = jsCast<JSTestInterface*>(cell); |
| ASSERT_GC_OBJECT_INHERITS(thisObject, info()); |
| Identifier propertyName = Identifier::from(state, index); |
| PutPropertySlot slot(thisObject, shouldThrow); |
| bool putResult = false; |
| if (thisObject->putDelegate(state, propertyName, value, slot, putResult)) |
| return putResult; |
| return Base::putByIndex(cell, state, index, value, shouldThrow); |
| } |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| bool setJSTestInterfaceConstructorImplementsStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| String nativeValue = value.toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| TestInterface::setImplementsStaticAttr(nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| bool setJSTestInterfaceImplementsStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "implementsStr2"); |
| } |
| auto& impl = castedThis->wrapped(); |
| String nativeValue = value.toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| impl.setImplementsStr2(nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| bool setJSTestInterfaceImplementsStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "implementsStr3"); |
| } |
| castedThis->setImplementsStr3(*state, value); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| bool setJSTestInterfaceImplementsNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "implementsNode"); |
| } |
| auto& impl = castedThis->wrapped(); |
| Node* nativeValue = JSNode::toWrapped(value); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| impl.setImplementsNode(nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| bool setJSTestInterfaceConstructorSupplementalStaticAttr(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| String nativeValue = value.toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| WebCore::TestSupplemental::setSupplementalStaticAttr(nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| bool setJSTestInterfaceSupplementalStr2(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "supplementalStr2"); |
| } |
| auto& impl = castedThis->wrapped(); |
| String nativeValue = value.toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| WebCore::TestSupplemental::setSupplementalStr2(impl, nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| bool setJSTestInterfaceSupplementalStr3(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "supplementalStr3"); |
| } |
| castedThis->setSupplementalStr3(*state, value); |
| return true; |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| bool setJSTestInterfaceSupplementalNode(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| JSValue value = JSValue::decode(encodedValue); |
| UNUSED_PARAM(thisValue); |
| JSTestInterface* castedThis = jsDynamicCast<JSTestInterface*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!castedThis)) { |
| return throwSetterTypeError(*state, "TestInterface", "supplementalNode"); |
| } |
| auto& impl = castedThis->wrapped(); |
| Node* nativeValue = JSNode::toWrapped(value); |
| if (UNLIKELY(state->hadException())) |
| return false; |
| WebCore::TestSupplemental::setSupplementalNode(impl, nativeValue); |
| return true; |
| } |
| |
| #endif |
| |
| JSValue JSTestInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestInterfaceConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod1(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "implementsMethod1"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| auto& impl = castedThis->wrapped(); |
| impl.implementsMethod1(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod2(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "implementsMethod2"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!context) |
| return JSValue::encode(jsUndefined()); |
| String strArg = state->argument(0).toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg = JSTestObj::toWrapped(state->argument(1)); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| if (UNLIKELY(!objArg)) |
| return throwVMTypeError(state); |
| JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(impl.implementsMethod2(*context, strArg, *objArg, ec))); |
| |
| setDOMException(state, ec); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionImplementsMethod3(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "implementsMethod3"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| return JSValue::encode(castedThis->implementsMethod3(*state)); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionImplementsMethod4(ExecState* state) |
| { |
| TestInterface::implementsMethod4(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod1(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "supplementalMethod1"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| auto& impl = castedThis->wrapped(); |
| WebCore::TestSupplemental::supplementalMethod1(impl); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod2(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "supplementalMethod2"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(state->argumentCount() < 2)) |
| return throwVMError(state, createNotEnoughArgumentsError(state)); |
| ExceptionCode ec = 0; |
| auto* context = jsCast<JSDOMGlobalObject*>(state->lexicalGlobalObject())->scriptExecutionContext(); |
| if (!context) |
| return JSValue::encode(jsUndefined()); |
| String strArg = state->argument(0).toWTFString(state); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| TestObj* objArg = JSTestObj::toWrapped(state->argument(1)); |
| if (UNLIKELY(state->hadException())) |
| return JSValue::encode(jsUndefined()); |
| if (UNLIKELY(!objArg)) |
| return throwVMTypeError(state); |
| JSValue result = toJS(state, castedThis->globalObject(), WTF::getPtr(WebCore::TestSupplemental::supplementalMethod2(impl, *context, strArg, *objArg, ec))); |
| |
| setDOMException(state, ec); |
| return JSValue::encode(result); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfacePrototypeFunctionSupplementalMethod3(ExecState* state) |
| { |
| JSValue thisValue = state->thisValue(); |
| auto castedThis = jsDynamicCast<JSTestInterface*>(thisValue); |
| if (UNLIKELY(!castedThis)) |
| return throwThisTypeError(*state, "TestInterface", "supplementalMethod3"); |
| ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestInterface::info()); |
| return JSValue::encode(castedThis->supplementalMethod3(*state)); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| EncodedJSValue JSC_HOST_CALL jsTestInterfaceConstructorFunctionSupplementalMethod4(ExecState* state) |
| { |
| WebCore::TestSupplemental::supplementalMethod4(); |
| return JSValue::encode(jsUndefined()); |
| } |
| |
| #endif |
| |
| bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor) |
| { |
| auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell()); |
| if (jsTestInterface->wrapped().hasPendingActivity()) |
| return true; |
| UNUSED_PARAM(visitor); |
| return false; |
| } |
| |
| void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsTestInterface->wrapped(), jsTestInterface); |
| } |
| |
| JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface* impl) |
| { |
| if (!impl) |
| return jsNull(); |
| return createNewWrapper<JSTestInterface>(globalObject, impl); |
| } |
| |
| JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestInterface* impl) |
| { |
| if (!impl) |
| return jsNull(); |
| if (JSValue result = getExistingWrapper<JSTestInterface>(globalObject, impl)) |
| return result; |
| #if COMPILER(CLANG) |
| // If you hit this failure the interface definition has the ImplementationLacksVTable |
| // attribute. You should remove that attribute. If the class has subclasses |
| // that may be passed through this toJS() function you should use the SkipVTableValidation |
| // attribute to TestInterface. |
| COMPILE_ASSERT(!__is_polymorphic(TestInterface), TestInterface_is_polymorphic_but_idl_claims_not_to_be); |
| #endif |
| return createNewWrapper<JSTestInterface>(globalObject, impl); |
| } |
| |
| TestInterface* JSTestInterface::toWrapped(JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSTestInterface*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |
| |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |