| /* |
| 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 "ActiveDOMObject.h" |
| #include "ElementInlines.h" |
| #include "ExtendedDOMClientIsoSubspaces.h" |
| #include "ExtendedDOMIsoSubspaces.h" |
| #include "HTMLNames.h" |
| #include "JSDOMAttribute.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructor.h" |
| #include "JSDOMConvertInterface.h" |
| #include "JSDOMConvertStrings.h" |
| #include "JSDOMExceptionHandling.h" |
| #include "JSDOMGlobalObjectInlines.h" |
| #include "JSDOMIterator.h" |
| #include "JSDOMOperation.h" |
| #include "JSDOMWrapperCache.h" |
| #include "JSTestNode.h" |
| #include "JSTestObj.h" |
| #include "ScriptExecutionContext.h" |
| #include "TestSupplemental.h" |
| #include "WebCoreJSClientData.h" |
| #include <JavaScriptCore/BuiltinNames.h> |
| #include <JavaScriptCore/FunctionPrototype.h> |
| #include <JavaScriptCore/HeapAnalyzer.h> |
| #include <JavaScriptCore/JSCInlines.h> |
| #include <JavaScriptCore/JSDestructibleObjectHeapCellType.h> |
| #include <JavaScriptCore/SlotVisitorMacros.h> |
| #include <JavaScriptCore/SubspaceInlines.h> |
| #include <wtf/GetPtr.h> |
| #include <wtf/PointerPreparations.h> |
| #include <wtf/URL.h> |
| |
| #if ENABLE(Condition11) || (ENABLE(Condition11) && ENABLE(Condition22)) || ENABLE(Condition12) || ENABLE(Condition22) || (ENABLE(Condition22) && ENABLE(Condition33)) || ENABLE(Condition23) |
| #include "IDLTypes.h" |
| #include "JSDOMConvertBase.h" |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| #include "TestSupplementalBuiltins.h" |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) || ENABLE(Condition22) || ENABLE(Condition23) |
| #include "JSDOMConvertNumbers.h" |
| #include "JSDOMGlobalObject.h" |
| #include "JSNode.h" |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| #include "JSDOMConvertSequences.h" |
| #include <JavaScriptCore/JSArray.h> |
| #endif |
| |
| |
| namespace WebCore { |
| using namespace JSC; |
| |
| // Functions |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinOperation); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinComplexOperation); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinCustomOperation); |
| #endif |
| #if (ENABLE(Condition11) && ENABLE(Condition22)) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinConditionalOperation); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinSettingsConditionalOperation); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinResultFieldOperation); |
| #endif |
| #if (ENABLE(Condition22) && ENABLE(Condition33)) || ENABLE(Condition23) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_partialMixinOperationFromPartial); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod1); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod2); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod3); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfaceConstructorFunction_supplementalMethod4); |
| #endif |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_entries); |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_keys); |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_values); |
| static JSC_DECLARE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_forEach); |
| |
| // Attributes |
| |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterfaceConstructor); |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_mixinReadOnlyAttribute); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_mixinAttribute); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_mixinAttribute); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_mixinCustomAttribute); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_mixinCustomAttribute); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_mixinNodeAttribute); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_mixinNodeAttribute); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_partialMixinAttributeFromPartial); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterfaceConstructor_supplementalStaticReadOnlyAttr); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterfaceConstructor_supplementalStaticAttr); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterfaceConstructor_supplementalStaticAttr); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_supplementalStr1); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_supplementalStr2); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_supplementalStr2); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_supplementalStr3); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_supplementalStr3); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_supplementalNode); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_supplementalNode); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static JSC_DECLARE_CUSTOM_GETTER(jsTestInterface_reflectAttribute); |
| static JSC_DECLARE_CUSTOM_SETTER(setJSTestInterface_reflectAttribute); |
| #endif |
| |
| class JSTestInterfacePrototype final : public JSC::JSNonFinalObject { |
| public: |
| using Base = JSC::JSNonFinalObject; |
| static JSTestInterfacePrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSTestInterfacePrototype* ptr = new (NotNull, JSC::allocateCell<JSTestInterfacePrototype>(vm)) JSTestInterfacePrototype(vm, globalObject, structure); |
| ptr->finishCreation(vm); |
| return ptr; |
| } |
| |
| DECLARE_INFO; |
| template<typename CellType, JSC::SubspaceAccess> |
| static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) |
| { |
| STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestInterfacePrototype, Base); |
| return &vm.plainObjectSpace(); |
| } |
| 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&); |
| }; |
| STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestInterfacePrototype, JSTestInterfacePrototype::Base); |
| |
| using JSTestInterfaceDOMConstructor = JSDOMConstructor<JSTestInterface>; |
| |
| /* Hash table for constructor */ |
| |
| static const HashTableValue JSTestInterfaceConstructorTableValues[] = |
| { |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "MIXIN_CONSTANT"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "MIXIN_REFLECTED_CONSTANT"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "PARTIAL_MIXIN_CONSTANT_FROM_PARTIAL"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(5) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT1"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT2"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStaticReadOnlyAttr"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor_supplementalStaticReadOnlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStaticAttr"_s, static_cast<unsigned>(0), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor_supplementalStaticAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterfaceConstructor_supplementalStaticAttr) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod4"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfaceConstructorFunction_supplementalMethod4), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| }; |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static_assert(TestInterface::MIXIN_CONSTANT == 1, "MIXIN_CONSTANT in TestInterface does not match value from IDL"); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static_assert(TestInterface::CONST_IMPL == 2, "CONST_IMPL in TestInterface does not match value from IDL"); |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static_assert(TestInterface::PARTIAL_MIXIN_CONSTANT_FROM_PARTIAL == 5, "PARTIAL_MIXIN_CONSTANT_FROM_PARTIAL in TestInterface does not match value from IDL"); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static_assert(TestSupplemental::SUPPLEMENTALCONSTANT1 == 1, "SUPPLEMENTALCONSTANT1 in TestSupplemental does not match value from IDL"); |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static_assert(TestSupplemental::CONST_IMPL == 2, "CONST_IMPL in TestSupplemental does not match value from IDL"); |
| #endif |
| |
| template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSTestInterfaceDOMConstructor::construct(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| VM& vm = lexicalGlobalObject->vm(); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* castedThis = jsCast<JSTestInterfaceDOMConstructor*>(callFrame->jsCallee()); |
| ASSERT(castedThis); |
| if (UNLIKELY(callFrame->argumentCount() < 1)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto* context = castedThis->scriptExecutionContext(); |
| if (UNLIKELY(!context)) |
| return throwConstructorScriptExecutionContextUnavailableError(*lexicalGlobalObject, throwScope, "TestInterface"); |
| EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| auto str1 = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| EnsureStillAliveScope argument1 = callFrame->argument(1); |
| auto str2 = argument1.value().isUndefined() ? "defaultString"_s : convert<IDLDOMString>(*lexicalGlobalObject, argument1.value()); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| auto object = TestInterface::create(*context, WTFMove(str1), WTFMove(str2)); |
| if constexpr (IsExceptionOr<decltype(object)>) |
| RETURN_IF_EXCEPTION(throwScope, { }); |
| static_assert(TypeOrExceptionOrUnderlyingType<decltype(object)>::isRef); |
| auto jsValue = toJSNewlyCreated<IDLInterface<TestInterface>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); |
| if constexpr (IsExceptionOr<decltype(object)>) |
| RETURN_IF_EXCEPTION(throwScope, { }); |
| setSubclassStructureIfNeeded<TestInterface>(lexicalGlobalObject, callFrame, asObject(jsValue)); |
| RETURN_IF_EXCEPTION(throwScope, { }); |
| return JSValue::encode(jsValue); |
| } |
| JSC_ANNOTATE_HOST_FUNCTION(JSTestInterfaceDOMConstructorConstruct, JSTestInterfaceDOMConstructor::construct); |
| |
| template<> const ClassInfo JSTestInterfaceDOMConstructor::s_info = { "TestInterface"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterfaceDOMConstructor) }; |
| |
| template<> JSValue JSTestInterfaceDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSTestInterfaceDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->length, jsNumber(1), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| JSString* nameString = jsNontrivialString(vm, "TestInterface"_s); |
| m_originalName.set(vm, this, nameString); |
| putDirect(vm, vm.propertyNames->name, nameString, JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| putDirect(vm, vm.propertyNames->prototype, JSTestInterface::prototype(vm, globalObject), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::DontDelete); |
| reifyStaticProperties(vm, JSTestInterface::info(), JSTestInterfaceConstructorTableValues, *this); |
| } |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSTestInterfacePrototypeTableValues[] = |
| { |
| { "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterfaceConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinReadOnlyAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_mixinReadOnlyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_mixinAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_mixinAttribute) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinCustomAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_mixinCustomAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_mixinCustomAttribute) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinNodeAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_mixinNodeAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_mixinNodeAttribute) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "partialMixinAttributeFromPartial"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_partialMixinAttributeFromPartial), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr1"_s, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_supplementalStr1), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr2"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_supplementalStr2), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_supplementalStr2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalStr3"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_supplementalStr3), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_supplementalStr3) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalNode"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_supplementalNode), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_supplementalNode) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "reflectAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestInterface_reflectAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestInterface_reflectAttribute) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "builtinAttribute"_s, static_cast<unsigned>(JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinAttributeCodeGenerator), (intptr_t) (setTestSupplementalBuiltinAttributeCodeGenerator) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinOperation), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinComplexOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinComplexOperation), (intptr_t) (2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinCustomOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinCustomOperation), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if (ENABLE(Condition11) && ENABLE(Condition22)) || ENABLE(Condition23) |
| { "mixinConditionalOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinConditionalOperation), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinSettingsConditionalOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinSettingsConditionalOperation), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "mixinResultFieldOperation"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_mixinResultFieldOperation), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if (ENABLE(Condition22) && ENABLE(Condition33)) || ENABLE(Condition23) |
| { "partialMixinOperationFromPartial"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_partialMixinOperationFromPartial), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod1"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_supplementalMethod1), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod2"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_supplementalMethod2), (intptr_t) (2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "supplementalMethod3"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_supplementalMethod3), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "builtinFunction"_s, static_cast<unsigned>(JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| { "entries"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_entries), (intptr_t) (0) } }, |
| { "keys"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_keys), (intptr_t) (0) } }, |
| { "values"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_values), (intptr_t) (0) } }, |
| { "forEach"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestInterfacePrototypeFunction_forEach), (intptr_t) (1) } }, |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "MIXIN_CONSTANT"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "MIXIN_REFLECTED_CONSTANT"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| { "PARTIAL_MIXIN_CONSTANT_FROM_PARTIAL"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(5) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT1"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(1) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| { "SUPPLEMENTALCONSTANT2"_s, JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::ConstantInteger, NoIntrinsic, { (long long)(2) } }, |
| #else |
| { { }, 0, NoIntrinsic, { 0, 0 } }, |
| #endif |
| }; |
| |
| const ClassInfo JSTestInterfacePrototype::s_info = { "TestInterface"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterfacePrototype) }; |
| |
| void JSTestInterfacePrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSTestInterface::info(), JSTestInterfacePrototypeTableValues, *this); |
| bool hasDisabledRuntimeProperties = false; |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| if (!jsCast<JSDOMGlobalObject*>(globalObject())->scriptExecutionContext()->settingsValues().testSettingEnabled) { |
| hasDisabledRuntimeProperties = true; |
| auto propertyName = Identifier::fromString(vm, "mixinSettingsConditionalOperation"_s); |
| VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); |
| DeletePropertySlot slot; |
| JSObject::deleteProperty(this, globalObject(), propertyName, slot); |
| } |
| #endif |
| if (hasDisabledRuntimeProperties && structure()->isDictionary()) |
| flattenDictionaryObject(vm); |
| putDirect(vm, vm.propertyNames->iteratorSymbol, getDirect(vm, vm.propertyNames->builtinNames().entriesPublicName()), static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)); |
| JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); |
| } |
| |
| const ClassInfo JSTestInterface::s_info = { "TestInterface"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestInterface) }; |
| |
| JSTestInterface::JSTestInterface(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestInterface>&& impl) |
| : JSDOMWrapper<TestInterface>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| void JSTestInterface::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| ASSERT(inherits(info())); |
| |
| static_assert(std::is_base_of<ActiveDOMObject, TestInterface>::value, "Interface is marked as [ActiveDOMObject] but implementation class does not subclass ActiveDOMObject."); |
| |
| } |
| |
| JSObject* JSTestInterface::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return JSTestInterfacePrototype::create(vm, &globalObject, JSTestInterfacePrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| } |
| |
| JSObject* JSTestInterface::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return getDOMPrototype<JSTestInterface>(vm, globalObject); |
| } |
| |
| JSValue JSTestInterface::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestInterfaceDOMConstructor, DOMConstructorID::TestInterface>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| void JSTestInterface::destroy(JSC::JSCell* cell) |
| { |
| JSTestInterface* thisObject = static_cast<JSTestInterface*>(cell); |
| thisObject->JSTestInterface::~JSTestInterface(); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterfaceConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) |
| { |
| VM& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* prototype = jsDynamicCast<JSTestInterfacePrototype*>(JSValue::decode(thisValue)); |
| if (UNLIKELY(!prototype)) |
| return throwVMTypeError(lexicalGlobalObject, throwScope); |
| return JSValue::encode(JSTestInterface::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); |
| } |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSValue jsTestInterface_mixinReadOnlyAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDOMString>(lexicalGlobalObject, throwScope, impl.mixinReadOnlyAttribute()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_mixinReadOnlyAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_mixinReadOnlyAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSValue jsTestInterface_mixinAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDOMString>(lexicalGlobalObject, throwScope, impl.mixinAttribute()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_mixinAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_mixinAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline bool setJSTestInterface_mixinAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLDOMString>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return impl.setMixinAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_mixinAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_mixinAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSValue jsTestInterface_mixinCustomAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| return thisObject.mixinCustomAttribute(lexicalGlobalObject); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_mixinCustomAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_mixinCustomAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline bool setJSTestInterface_mixinCustomAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| thisObject.setMixinCustomAttribute(lexicalGlobalObject, value); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_mixinCustomAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_mixinCustomAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSValue jsTestInterface_mixinNodeAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLInterface<Node>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.mixinNodeAttribute()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_mixinNodeAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_mixinNodeAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline bool setJSTestInterface_mixinNodeAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLInterface<Node>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestInterface", "mixinNodeAttribute", "Node"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return impl.setMixinNodeAttribute(*nativeValue); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_mixinNodeAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_mixinNodeAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSValue jsTestInterface_partialMixinAttributeFromPartialGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDouble>(lexicalGlobalObject, throwScope, impl.partialMixinAttributeFromPartial()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_partialMixinAttributeFromPartial, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_partialMixinAttributeFromPartialGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterfaceConstructor_supplementalStaticReadOnlyAttrGetter(JSGlobalObject& lexicalGlobalObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLLong>(lexicalGlobalObject, throwScope, WebCore::TestSupplemental::supplementalStaticReadOnlyAttr()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterfaceConstructor_supplementalStaticReadOnlyAttr, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructor_supplementalStaticReadOnlyAttrGetter>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterfaceConstructor_supplementalStaticAttrGetter(JSGlobalObject& lexicalGlobalObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDOMString>(lexicalGlobalObject, throwScope, WebCore::TestSupplemental::supplementalStaticAttr()))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterfaceConstructor_supplementalStaticAttr, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::getStatic<jsTestInterfaceConstructor_supplementalStaticAttrGetter>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline bool setJSTestInterfaceConstructor_supplementalStaticAttrSetter(JSGlobalObject& lexicalGlobalObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto nativeValue = convert<IDLDOMString>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return WebCore::TestSupplemental::setSupplementalStaticAttr(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterfaceConstructor_supplementalStaticAttr, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::setStatic<setJSTestInterfaceConstructor_supplementalStaticAttrSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterface_supplementalStr1Getter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDOMString>(lexicalGlobalObject, throwScope, WebCore::TestSupplemental::supplementalStr1(impl)))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_supplementalStr1, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_supplementalStr1Getter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterface_supplementalStr2Getter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLDOMString>(lexicalGlobalObject, throwScope, WebCore::TestSupplemental::supplementalStr2(impl)))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_supplementalStr2, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_supplementalStr2Getter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline bool setJSTestInterface_supplementalStr2Setter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLDOMString>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return WebCore::TestSupplemental::setSupplementalStr2(impl, WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_supplementalStr2, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_supplementalStr2Setter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterface_supplementalStr3Getter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| return thisObject.supplementalStr3(lexicalGlobalObject); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_supplementalStr3, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_supplementalStr3Getter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline bool setJSTestInterface_supplementalStr3Setter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| thisObject.setSupplementalStr3(lexicalGlobalObject, value); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_supplementalStr3, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_supplementalStr3Setter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterface_supplementalNodeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLInterface<Node>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, WebCore::TestSupplemental::supplementalNode(impl)))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_supplementalNode, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_supplementalNodeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline bool setJSTestInterface_supplementalNodeSetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLInterface<Node>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestInterface", "supplementalNode", "Node"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return WebCore::TestSupplemental::setSupplementalNode(impl, *nativeValue); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_supplementalNode, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_supplementalNodeSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSValue jsTestInterface_reflectAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| RELEASE_AND_RETURN(throwScope, (toJS<IDLAtomStringAdaptor<IDLDOMString>>(lexicalGlobalObject, throwScope, impl.attributeWithoutSynchronization(WebCore::HTMLNames::reflectattributeAttr)))); |
| } |
| |
| JSC_DEFINE_CUSTOM_GETTER(jsTestInterface_reflectAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::get<jsTestInterface_reflectAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline bool setJSTestInterface_reflectAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestInterface& thisObject, JSValue value) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLAtomStringAdaptor<IDLDOMString>>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { |
| return impl.setAttributeWithoutSynchronization(WebCore::HTMLNames::reflectattributeAttr, WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| JSC_DEFINE_CUSTOM_SETTER(setJSTestInterface_reflectAttribute, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue, PropertyName attributeName)) |
| { |
| return IDLAttribute<JSTestInterface>::set<setJSTestInterface_reflectAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, attributeName); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.mixinOperation(); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinOperationBody>(*lexicalGlobalObject, *callFrame, "mixinOperation"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinComplexOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 2)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto* context = jsCast<JSDOMGlobalObject*>(lexicalGlobalObject)->scriptExecutionContext(); |
| if (UNLIKELY(!context)) |
| return JSValue::encode(jsUndefined()); |
| EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| auto strArg = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); |
| auto objArg = convert<IDLInterface<TestObj>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 1, "objArg", "TestInterface", "mixinComplexOperation", "TestObj"); }); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.mixinComplexOperation(*context, WTFMove(strArg), *objArg)))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinComplexOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinComplexOperationBody>(*lexicalGlobalObject, *callFrame, "mixinComplexOperation"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinCustomOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->mixinCustomOperation(*lexicalGlobalObject, *callFrame)))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinCustomOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinCustomOperationBody>(*lexicalGlobalObject, *callFrame, "mixinCustomOperation"); |
| } |
| |
| #endif |
| |
| #if (ENABLE(Condition11) && ENABLE(Condition22)) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinConditionalOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.mixinConditionalOperation(); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinConditionalOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinConditionalOperationBody>(*lexicalGlobalObject, *callFrame, "mixinConditionalOperation"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinSettingsConditionalOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.mixinSettingsConditionalOperation(); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinSettingsConditionalOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinSettingsConditionalOperationBody>(*lexicalGlobalObject, *callFrame, "mixinSettingsConditionalOperation"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition22) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_mixinResultFieldOperationBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| auto implResult = impl.mixinResultFieldOperation(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLSequence<IDLInterface<Node>>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(implResult.nodes)))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_mixinResultFieldOperation, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_mixinResultFieldOperationBody>(*lexicalGlobalObject, *callFrame, "mixinResultFieldOperation"); |
| } |
| |
| #endif |
| |
| #if (ENABLE(Condition22) && ENABLE(Condition33)) || ENABLE(Condition23) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_partialMixinOperationFromPartialBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.partialMixinOperationFromPartial(); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_partialMixinOperationFromPartial, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_partialMixinOperationFromPartialBody>(*lexicalGlobalObject, *callFrame, "partialMixinOperationFromPartial"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_supplementalMethod1Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return WebCore::TestSupplemental::supplementalMethod1(impl); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod1, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_supplementalMethod1Body>(*lexicalGlobalObject, *callFrame, "supplementalMethod1"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_supplementalMethod2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| auto& impl = castedThis->wrapped(); |
| if (UNLIKELY(callFrame->argumentCount() < 2)) |
| return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| auto* context = jsCast<JSDOMGlobalObject*>(lexicalGlobalObject)->scriptExecutionContext(); |
| if (UNLIKELY(!context)) |
| return JSValue::encode(jsUndefined()); |
| EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| auto strArg = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); |
| auto objArg = convert<IDLInterface<TestObj>>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 1, "objArg", "TestInterface", "supplementalMethod2", "TestObj"); }); |
| RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLInterface<TestObj>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WebCore::TestSupplemental::supplementalMethod2(impl, *context, WTFMove(strArg), *objArg)))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod2, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_supplementalMethod2Body>(*lexicalGlobalObject, *callFrame, "supplementalMethod2"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSC::EncodedJSValue jsTestInterfacePrototypeFunction_supplementalMethod3Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestInterface>::ClassParameter castedThis) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->supplementalMethod3(*lexicalGlobalObject, *callFrame)))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_supplementalMethod3, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_supplementalMethod3Body>(*lexicalGlobalObject, *callFrame, "supplementalMethod3"); |
| } |
| |
| #endif |
| |
| #if ENABLE(Condition11) || ENABLE(Condition12) |
| static inline JSC::EncodedJSValue jsTestInterfaceConstructorFunction_supplementalMethod4Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame) |
| { |
| auto& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(callFrame); |
| RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLUndefined>(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return WebCore::TestSupplemental::supplementalMethod4(); }))); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfaceConstructorFunction_supplementalMethod4, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::callStatic<jsTestInterfaceConstructorFunction_supplementalMethod4Body>(*lexicalGlobalObject, *callFrame, "supplementalMethod4"); |
| } |
| |
| #endif |
| |
| struct TestInterfaceIteratorTraits { |
| static constexpr JSDOMIteratorType type = JSDOMIteratorType::Map; |
| using KeyType = IDLInterface<TestNode>; |
| using ValueType = IDLInterface<TestObj>; |
| }; |
| |
| using TestInterfaceIteratorBase = JSDOMIteratorBase<JSTestInterface, TestInterfaceIteratorTraits>; |
| class TestInterfaceIterator final : public TestInterfaceIteratorBase { |
| public: |
| using Base = TestInterfaceIteratorBase; |
| DECLARE_INFO; |
| |
| template<typename, SubspaceAccess mode> static JSC::GCClient::IsoSubspace* subspaceFor(JSC::VM& vm) |
| { |
| if constexpr (mode == JSC::SubspaceAccess::Concurrently) |
| return nullptr; |
| return WebCore::subspaceForImpl<TestInterfaceIterator, UseCustomHeapCellType::No>(vm, |
| [] (auto& spaces) { return spaces.m_clientSubspaceForTestInterfaceIterator.get(); }, |
| [] (auto& spaces, auto&& space) { spaces.m_clientSubspaceForTestInterfaceIterator = WTFMove(space); }, |
| [] (auto& spaces) { return spaces.m_subspaceForTestInterfaceIterator.get(); }, |
| [] (auto& spaces, auto&& space) { spaces.m_subspaceForTestInterfaceIterator = WTFMove(space); } |
| ); |
| } |
| |
| 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()); |
| } |
| |
| static TestInterfaceIterator* create(JSC::VM& vm, JSC::Structure* structure, JSTestInterface& iteratedObject, IterationKind kind) |
| { |
| auto* instance = new (NotNull, JSC::allocateCell<TestInterfaceIterator>(vm)) TestInterfaceIterator(structure, iteratedObject, kind); |
| instance->finishCreation(vm); |
| return instance; |
| } |
| |
| private: |
| TestInterfaceIterator(JSC::Structure* structure, JSTestInterface& iteratedObject, IterationKind kind) |
| : Base(structure, iteratedObject, kind) |
| { |
| } |
| }; |
| |
| using TestInterfaceIteratorPrototype = JSDOMIteratorPrototype<JSTestInterface, TestInterfaceIteratorTraits>; |
| JSC_ANNOTATE_HOST_FUNCTION(TestInterfaceIteratorPrototypeNext, TestInterfaceIteratorPrototype::next); |
| |
| template<> |
| const JSC::ClassInfo TestInterfaceIteratorBase::s_info = { "TestInterface Iterator"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(TestInterfaceIteratorBase) }; |
| const JSC::ClassInfo TestInterfaceIterator::s_info = { "TestInterface Iterator"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(TestInterfaceIterator) }; |
| |
| template<> |
| const JSC::ClassInfo TestInterfaceIteratorPrototype::s_info = { "TestInterface Iterator"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(TestInterfaceIteratorPrototype) }; |
| |
| static inline EncodedJSValue jsTestInterfacePrototypeFunction_entriesCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject) |
| { |
| return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::Entries)); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_entries, (JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_entriesCaller>(*lexicalGlobalObject, *callFrame, "entries"); |
| } |
| |
| static inline EncodedJSValue jsTestInterfacePrototypeFunction_keysCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject) |
| { |
| return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::Keys)); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_keys, (JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_keysCaller>(*lexicalGlobalObject, *callFrame, "keys"); |
| } |
| |
| static inline EncodedJSValue jsTestInterfacePrototypeFunction_valuesCaller(JSGlobalObject*, CallFrame*, JSTestInterface* thisObject) |
| { |
| return JSValue::encode(iteratorCreate<TestInterfaceIterator>(*thisObject, IterationKind::Values)); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_values, (JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_valuesCaller>(*lexicalGlobalObject, *callFrame, "values"); |
| } |
| |
| static inline EncodedJSValue jsTestInterfacePrototypeFunction_forEachCaller(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame, JSTestInterface* thisObject) |
| { |
| return JSValue::encode(iteratorForEach<TestInterfaceIterator>(*lexicalGlobalObject, *callFrame, *thisObject)); |
| } |
| |
| JSC_DEFINE_HOST_FUNCTION(jsTestInterfacePrototypeFunction_forEach, (JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame)) |
| { |
| return IDLOperation<JSTestInterface>::call<jsTestInterfacePrototypeFunction_forEachCaller>(*lexicalGlobalObject, *callFrame, "forEach"); |
| } |
| |
| JSC::GCClient::IsoSubspace* JSTestInterface::subspaceForImpl(JSC::VM& vm) |
| { |
| return WebCore::subspaceForImpl<JSTestInterface, UseCustomHeapCellType::No>(vm, |
| [] (auto& spaces) { return spaces.m_clientSubspaceForTestInterface.get(); }, |
| [] (auto& spaces, auto&& space) { spaces.m_clientSubspaceForTestInterface = WTFMove(space); }, |
| [] (auto& spaces) { return spaces.m_subspaceForTestInterface.get(); }, |
| [] (auto& spaces, auto&& space) { spaces.m_subspaceForTestInterface = WTFMove(space); } |
| ); |
| } |
| |
| void JSTestInterface::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) |
| { |
| auto* thisObject = jsCast<JSTestInterface*>(cell); |
| analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| if (thisObject->scriptExecutionContext()) |
| analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| Base::analyzeHeap(cell, analyzer); |
| } |
| |
| bool JSTestInterfaceOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason) |
| { |
| auto* jsTestInterface = jsCast<JSTestInterface*>(handle.slot()->asCell()); |
| auto& wrapped = jsTestInterface->wrapped(); |
| if (!wrapped.isContextStopped() && wrapped.hasPendingActivity()) { |
| if (UNLIKELY(reason)) |
| *reason = "ActiveDOMObject with pending activity"; |
| return true; |
| } |
| UNUSED_PARAM(visitor); |
| UNUSED_PARAM(reason); |
| return false; |
| } |
| |
| void JSTestInterfaceOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsTestInterface = static_cast<JSTestInterface*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsTestInterface->wrapped(), jsTestInterface); |
| } |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| #if PLATFORM(WIN) |
| #pragma warning(disable: 4483) |
| extern "C" { extern void (*const __identifier("??_7TestInterface@WebCore@@6B@")[])(); } |
| #else |
| extern "C" { extern void* _ZTVN7WebCore13TestInterfaceE[]; } |
| #endif |
| #endif |
| |
| JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestInterface>&& impl) |
| { |
| |
| if constexpr (std::is_polymorphic_v<TestInterface>) { |
| #if ENABLE(BINDING_INTEGRITY) |
| const void* actualVTablePointer = getVTablePointer(impl.ptr()); |
| #if PLATFORM(WIN) |
| void* expectedVTablePointer = __identifier("??_7TestInterface@WebCore@@6B@"); |
| #else |
| void* expectedVTablePointer = &_ZTVN7WebCore13TestInterfaceE[2]; |
| #endif |
| |
| // If you hit this assertion you either have a use after free bug, or |
| // TestInterface has subclasses. If TestInterface has subclasses that get passed |
| // to toJS() we currently require TestInterface you to opt out of binding hardening |
| // by adding the SkipVTableValidation attribute to the interface IDL definition |
| RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| #endif |
| } |
| return createWrapper<TestInterface>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestInterface& impl) |
| { |
| return wrap(lexicalGlobalObject, globalObject, impl); |
| } |
| |
| TestInterface* JSTestInterface::toWrapped(JSC::VM&, JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSTestInterface*>(value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |
| |
| #endif // ENABLE(Condition1) || ENABLE(Condition2) |