| /* |
| 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" |
| #include "JSTestSerialization.h" |
| |
| #include "ActiveDOMObject.h" |
| #include "JSDOMAttribute.h" |
| #include "JSDOMBinding.h" |
| #include "JSDOMConstructorNotConstructable.h" |
| #include "JSDOMConvertBoolean.h" |
| #include "JSDOMConvertInterface.h" |
| #include "JSDOMConvertNullable.h" |
| #include "JSDOMConvertNumbers.h" |
| #include "JSDOMConvertSequences.h" |
| #include "JSDOMConvertStrings.h" |
| #include "JSDOMExceptionHandling.h" |
| #include "JSDOMGlobalObject.h" |
| #include "JSDOMOperation.h" |
| #include "JSDOMWrapperCache.h" |
| #include "JSTestException.h" |
| #include "JSTestSerializationIndirectInheritance.h" |
| #include "JSTestSerializationInheritFinal.h" |
| #include "ScriptExecutionContext.h" |
| #include <JavaScriptCore/FunctionPrototype.h> |
| #include <JavaScriptCore/HeapAnalyzer.h> |
| #include <JavaScriptCore/JSArray.h> |
| #include <JavaScriptCore/JSCInlines.h> |
| #include <JavaScriptCore/ObjectConstructor.h> |
| #include <wtf/GetPtr.h> |
| #include <wtf/PointerPreparations.h> |
| #include <wtf/URL.h> |
| |
| |
| namespace WebCore { |
| using namespace JSC; |
| |
| // Functions |
| |
| JSC::EncodedJSValue JSC_HOST_CALL jsTestSerializationPrototypeFunctionToJSON(JSC::JSGlobalObject*, JSC::CallFrame*); |
| |
| // Attributes |
| |
| JSC::EncodedJSValue jsTestSerializationConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationConstructor(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationFirstStringAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationFirstStringAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationSecondLongAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationSecondLongAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationThirdUnserializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationThirdUnserializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationFourthUnrestrictedDoubleAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationFourthUnrestrictedDoubleAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationFifthLongAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationFifthLongAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationSixthTypedefAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationSixthTypedefAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationSeventhDirectlySerializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationSeventhDirectlySerializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationEighthIndirectlyAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationEighthIndirectlyAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationNinthOptionalDirectlySerializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationNinthOptionalDirectlySerializableAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationTenthFrozenArrayAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationTenthFrozenArrayAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationEleventhSequenceAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationEleventhSequenceAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| JSC::EncodedJSValue jsTestSerializationTwelfthInterfaceSequenceAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::PropertyName); |
| bool setJSTestSerializationTwelfthInterfaceSequenceAttribute(JSC::JSGlobalObject*, JSC::EncodedJSValue, JSC::EncodedJSValue); |
| |
| class JSTestSerializationPrototype : public JSC::JSNonFinalObject { |
| public: |
| using Base = JSC::JSNonFinalObject; |
| static JSTestSerializationPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| { |
| JSTestSerializationPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestSerializationPrototype>(vm.heap)) JSTestSerializationPrototype(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: |
| JSTestSerializationPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| : JSC::JSNonFinalObject(vm, structure) |
| { |
| } |
| |
| void finishCreation(JSC::VM&); |
| }; |
| |
| using JSTestSerializationConstructor = JSDOMConstructorNotConstructable<JSTestSerialization>; |
| |
| template<> JSValue JSTestSerializationConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
| { |
| UNUSED_PARAM(vm); |
| return globalObject.functionPrototype(); |
| } |
| |
| template<> void JSTestSerializationConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| putDirect(vm, vm.propertyNames->prototype, JSTestSerialization::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, String("TestSerialization"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| } |
| |
| template<> const ClassInfo JSTestSerializationConstructor::s_info = { "TestSerialization", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerializationConstructor) }; |
| |
| /* Hash table for prototype */ |
| |
| static const HashTableValue JSTestSerializationPrototypeTableValues[] = |
| { |
| { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationConstructor) } }, |
| { "firstStringAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFirstStringAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFirstStringAttribute) } }, |
| { "secondLongAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationSecondLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationSecondLongAttribute) } }, |
| { "thirdUnserializableAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationThirdUnserializableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationThirdUnserializableAttribute) } }, |
| { "fourthUnrestrictedDoubleAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFourthUnrestrictedDoubleAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFourthUnrestrictedDoubleAttribute) } }, |
| { "fifthLongAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationFifthLongAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationFifthLongAttribute) } }, |
| { "sixthTypedefAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationSixthTypedefAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationSixthTypedefAttribute) } }, |
| { "seventhDirectlySerializableAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationSeventhDirectlySerializableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationSeventhDirectlySerializableAttribute) } }, |
| { "eighthIndirectlyAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationEighthIndirectlyAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationEighthIndirectlyAttribute) } }, |
| { "ninthOptionalDirectlySerializableAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationNinthOptionalDirectlySerializableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationNinthOptionalDirectlySerializableAttribute) } }, |
| { "tenthFrozenArrayAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationTenthFrozenArrayAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationTenthFrozenArrayAttribute) } }, |
| { "eleventhSequenceAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationEleventhSequenceAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationEleventhSequenceAttribute) } }, |
| { "twelfthInterfaceSequenceAttribute", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestSerializationTwelfthInterfaceSequenceAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestSerializationTwelfthInterfaceSequenceAttribute) } }, |
| { "toJSON", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestSerializationPrototypeFunctionToJSON), (intptr_t) (0) } }, |
| }; |
| |
| const ClassInfo JSTestSerializationPrototype::s_info = { "TestSerializationPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerializationPrototype) }; |
| |
| void JSTestSerializationPrototype::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| reifyStaticProperties(vm, JSTestSerialization::info(), JSTestSerializationPrototypeTableValues, *this); |
| } |
| |
| const ClassInfo JSTestSerialization::s_info = { "TestSerialization", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestSerialization) }; |
| |
| JSTestSerialization::JSTestSerialization(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestSerialization>&& impl) |
| : JSDOMWrapper<TestSerialization>(structure, globalObject, WTFMove(impl)) |
| { |
| } |
| |
| void JSTestSerialization::finishCreation(VM& vm) |
| { |
| Base::finishCreation(vm); |
| ASSERT(inherits(vm, info())); |
| |
| static_assert(!std::is_base_of<ActiveDOMObject, TestSerialization>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); |
| |
| } |
| |
| JSObject* JSTestSerialization::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return JSTestSerializationPrototype::create(vm, &globalObject, JSTestSerializationPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| } |
| |
| JSObject* JSTestSerialization::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| { |
| return getDOMPrototype<JSTestSerialization>(vm, globalObject); |
| } |
| |
| JSValue JSTestSerialization::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| { |
| return getDOMConstructor<JSTestSerializationConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
| } |
| |
| void JSTestSerialization::destroy(JSC::JSCell* cell) |
| { |
| JSTestSerialization* thisObject = static_cast<JSTestSerialization*>(cell); |
| thisObject->JSTestSerialization::~JSTestSerialization(); |
| } |
| |
| template<> inline JSTestSerialization* IDLAttribute<JSTestSerialization>::cast(JSGlobalObject& lexicalGlobalObject, EncodedJSValue thisValue) |
| { |
| return jsDynamicCast<JSTestSerialization*>(JSC::getVM(&lexicalGlobalObject), JSValue::decode(thisValue)); |
| } |
| |
| template<> inline JSTestSerialization* IDLOperation<JSTestSerialization>::cast(JSGlobalObject& lexicalGlobalObject, CallFrame& callFrame) |
| { |
| return jsDynamicCast<JSTestSerialization*>(JSC::getVM(&lexicalGlobalObject), callFrame.thisValue()); |
| } |
| |
| EncodedJSValue jsTestSerializationConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| VM& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* prototype = jsDynamicCast<JSTestSerializationPrototype*>(vm, JSValue::decode(thisValue)); |
| if (UNLIKELY(!prototype)) |
| return throwVMTypeError(lexicalGlobalObject, throwScope); |
| return JSValue::encode(JSTestSerialization::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); |
| } |
| |
| bool setJSTestSerializationConstructor(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| VM& vm = JSC::getVM(lexicalGlobalObject); |
| auto throwScope = DECLARE_THROW_SCOPE(vm); |
| auto* prototype = jsDynamicCast<JSTestSerializationPrototype*>(vm, JSValue::decode(thisValue)); |
| if (UNLIKELY(!prototype)) { |
| throwVMTypeError(lexicalGlobalObject, throwScope); |
| return false; |
| } |
| // Shadowing a built-in constructor |
| return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue)); |
| } |
| |
| static inline JSValue jsTestSerializationFirstStringAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLDOMString>(lexicalGlobalObject, throwScope, impl.firstStringAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationFirstStringAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationFirstStringAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "firstStringAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationFirstStringAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLDOMString>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setFirstStringAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationFirstStringAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationFirstStringAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "firstStringAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationSecondLongAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLLong>(lexicalGlobalObject, throwScope, impl.secondLongAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationSecondLongAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationSecondLongAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "secondLongAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationSecondLongAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLLong>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setSecondLongAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationSecondLongAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationSecondLongAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "secondLongAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationThirdUnserializableAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLInterface<TestException>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.thirdUnserializableAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationThirdUnserializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationThirdUnserializableAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "thirdUnserializableAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationThirdUnserializableAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLInterface<TestException>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestSerialization", "thirdUnserializableAttribute", "TestException"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setThirdUnserializableAttribute(*nativeValue); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationThirdUnserializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationThirdUnserializableAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "thirdUnserializableAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLUnrestrictedDouble>(lexicalGlobalObject, throwScope, impl.fourthUnrestrictedDoubleAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationFourthUnrestrictedDoubleAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationFourthUnrestrictedDoubleAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "fourthUnrestrictedDoubleAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationFourthUnrestrictedDoubleAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLUnrestrictedDouble>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setFourthUnrestrictedDoubleAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationFourthUnrestrictedDoubleAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationFourthUnrestrictedDoubleAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "fourthUnrestrictedDoubleAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationFifthLongAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLLong>(lexicalGlobalObject, throwScope, impl.fifthLongAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationFifthLongAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationFifthLongAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "fifthLongAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationFifthLongAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLLong>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setFifthLongAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationFifthLongAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationFifthLongAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "fifthLongAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationSixthTypedefAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLDouble>(lexicalGlobalObject, throwScope, impl.sixthTypedefAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationSixthTypedefAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationSixthTypedefAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "sixthTypedefAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationSixthTypedefAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLDouble>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setSixthTypedefAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationSixthTypedefAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationSixthTypedefAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "sixthTypedefAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationSeventhDirectlySerializableAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLInterface<TestSerializationInheritFinal>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.seventhDirectlySerializableAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationSeventhDirectlySerializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationSeventhDirectlySerializableAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "seventhDirectlySerializableAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationSeventhDirectlySerializableAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLInterface<TestSerializationInheritFinal>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestSerialization", "seventhDirectlySerializableAttribute", "TestSerializationInheritFinal"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setSeventhDirectlySerializableAttribute(*nativeValue); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationSeventhDirectlySerializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationSeventhDirectlySerializableAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "seventhDirectlySerializableAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationEighthIndirectlyAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLInterface<TestSerializationIndirectInheritance>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.eighthIndirectlyAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationEighthIndirectlyAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationEighthIndirectlyAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "eighthIndirectlyAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationEighthIndirectlyAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLInterface<TestSerializationIndirectInheritance>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestSerialization", "eighthIndirectlyAttribute", "TestSerializationIndirectInheritance"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setEighthIndirectlyAttribute(*nativeValue); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationEighthIndirectlyAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationEighthIndirectlyAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "eighthIndirectlyAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationNinthOptionalDirectlySerializableAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLNullable<IDLInterface<TestSerializationInheritFinal>>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.ninthOptionalDirectlySerializableAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationNinthOptionalDirectlySerializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationNinthOptionalDirectlySerializableAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "ninthOptionalDirectlySerializableAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationNinthOptionalDirectlySerializableAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLNullable<IDLInterface<TestSerializationInheritFinal>>>(lexicalGlobalObject, value, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwAttributeTypeError(lexicalGlobalObject, scope, "TestSerialization", "ninthOptionalDirectlySerializableAttribute", "TestSerializationInheritFinal"); }); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setNinthOptionalDirectlySerializableAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationNinthOptionalDirectlySerializableAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationNinthOptionalDirectlySerializableAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "ninthOptionalDirectlySerializableAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationTenthFrozenArrayAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLFrozenArray<IDLBoolean>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.tenthFrozenArrayAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationTenthFrozenArrayAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationTenthFrozenArrayAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "tenthFrozenArrayAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationTenthFrozenArrayAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLFrozenArray<IDLBoolean>>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setTenthFrozenArrayAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationTenthFrozenArrayAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationTenthFrozenArrayAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "tenthFrozenArrayAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationEleventhSequenceAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLSequence<IDLDOMString>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.eleventhSequenceAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationEleventhSequenceAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationEleventhSequenceAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "eleventhSequenceAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationEleventhSequenceAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLSequence<IDLDOMString>>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setEleventhSequenceAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationEleventhSequenceAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationEleventhSequenceAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "eleventhSequenceAttribute"); |
| } |
| |
| static inline JSValue jsTestSerializationTwelfthInterfaceSequenceAttributeGetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(throwScope); |
| UNUSED_PARAM(lexicalGlobalObject); |
| auto& impl = thisObject.wrapped(); |
| JSValue result = toJS<IDLSequence<IDLInterface<TestSerializationInheritFinal>>>(lexicalGlobalObject, *thisObject.globalObject(), throwScope, impl.twelfthInterfaceSequenceAttribute()); |
| return result; |
| } |
| |
| EncodedJSValue jsTestSerializationTwelfthInterfaceSequenceAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName) |
| { |
| return IDLAttribute<JSTestSerialization>::get<jsTestSerializationTwelfthInterfaceSequenceAttributeGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "twelfthInterfaceSequenceAttribute"); |
| } |
| |
| static inline bool setJSTestSerializationTwelfthInterfaceSequenceAttributeSetter(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSValue value, ThrowScope& throwScope) |
| { |
| UNUSED_PARAM(lexicalGlobalObject); |
| UNUSED_PARAM(throwScope); |
| auto& impl = thisObject.wrapped(); |
| auto nativeValue = convert<IDLSequence<IDLInterface<TestSerializationInheritFinal>>>(lexicalGlobalObject, value); |
| RETURN_IF_EXCEPTION(throwScope, false); |
| AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| return impl.setTwelfthInterfaceSequenceAttribute(WTFMove(nativeValue)); |
| }); |
| return true; |
| } |
| |
| bool setJSTestSerializationTwelfthInterfaceSequenceAttribute(JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue) |
| { |
| return IDLAttribute<JSTestSerialization>::set<setJSTestSerializationTwelfthInterfaceSequenceAttributeSetter>(*lexicalGlobalObject, thisValue, encodedValue, "twelfthInterfaceSequenceAttribute"); |
| } |
| |
| JSC::JSObject* JSTestSerialization::serialize(JSGlobalObject& lexicalGlobalObject, JSTestSerialization& thisObject, JSDOMGlobalObject& globalObject, ThrowScope& throwScope) |
| { |
| auto& vm = JSC::getVM(&lexicalGlobalObject); |
| auto* result = constructEmptyObject(&lexicalGlobalObject, globalObject.objectPrototype()); |
| |
| auto firstStringAttributeValue = jsTestSerializationFirstStringAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "firstStringAttribute"), firstStringAttributeValue); |
| |
| auto secondLongAttributeValue = jsTestSerializationSecondLongAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "secondLongAttribute"), secondLongAttributeValue); |
| |
| auto fourthUnrestrictedDoubleAttributeValue = jsTestSerializationFourthUnrestrictedDoubleAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "fourthUnrestrictedDoubleAttribute"), fourthUnrestrictedDoubleAttributeValue); |
| |
| auto fifthLongAttributeValue = jsTestSerializationFifthLongAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "fifthLongAttribute"), fifthLongAttributeValue); |
| |
| auto sixthTypedefAttributeValue = jsTestSerializationSixthTypedefAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "sixthTypedefAttribute"), sixthTypedefAttributeValue); |
| |
| auto seventhDirectlySerializableAttributeValue = jsTestSerializationSeventhDirectlySerializableAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| auto* seventhDirectlySerializableAttributeSerializedValue = JSTestSerializationInheritFinal::serialize(lexicalGlobalObject, *jsCast<JSTestSerializationInheritFinal*>(seventhDirectlySerializableAttributeValue), globalObject, throwScope); |
| result->putDirect(vm, Identifier::fromString(vm, "seventhDirectlySerializableAttribute"), seventhDirectlySerializableAttributeSerializedValue); |
| |
| auto eighthIndirectlyAttributeValue = jsTestSerializationEighthIndirectlyAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| auto* eighthIndirectlyAttributeSerializedValue = JSTestSerializationIndirectInheritance::serialize(lexicalGlobalObject, *jsCast<JSTestSerializationIndirectInheritance*>(eighthIndirectlyAttributeValue), globalObject, throwScope); |
| result->putDirect(vm, Identifier::fromString(vm, "eighthIndirectlyAttribute"), eighthIndirectlyAttributeSerializedValue); |
| |
| auto ninthOptionalDirectlySerializableAttributeValue = jsTestSerializationNinthOptionalDirectlySerializableAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| if (!ninthOptionalDirectlySerializableAttributeValue.isNull()) { |
| auto* ninthOptionalDirectlySerializableAttributeSerializedValue = JSTestSerializationInheritFinal::serialize(lexicalGlobalObject, *jsCast<JSTestSerializationInheritFinal*>(ninthOptionalDirectlySerializableAttributeValue), globalObject, throwScope); |
| result->putDirect(vm, Identifier::fromString(vm, "ninthOptionalDirectlySerializableAttribute"), ninthOptionalDirectlySerializableAttributeSerializedValue); |
| } else |
| result->putDirect(vm, Identifier::fromString(vm, "ninthOptionalDirectlySerializableAttribute"), ninthOptionalDirectlySerializableAttributeValue); |
| |
| auto tenthFrozenArrayAttributeValue = jsTestSerializationTenthFrozenArrayAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "tenthFrozenArrayAttribute"), tenthFrozenArrayAttributeValue); |
| |
| auto eleventhSequenceAttributeValue = jsTestSerializationEleventhSequenceAttributeGetter(lexicalGlobalObject, thisObject, throwScope); |
| throwScope.assertNoException(); |
| result->putDirect(vm, Identifier::fromString(vm, "eleventhSequenceAttribute"), eleventhSequenceAttributeValue); |
| |
| return result; |
| } |
| |
| static inline EncodedJSValue jsTestSerializationPrototypeFunctionToJSONBody(JSGlobalObject* lexicalGlobalObject, CallFrame*, JSTestSerialization* thisObject, JSC::ThrowScope& throwScope) |
| { |
| return JSValue::encode(JSTestSerialization::serialize(*lexicalGlobalObject, *thisObject, *thisObject->globalObject(), throwScope)); |
| } |
| |
| EncodedJSValue JSC_HOST_CALL jsTestSerializationPrototypeFunctionToJSON(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) |
| { |
| return IDLOperation<JSTestSerialization>::call<jsTestSerializationPrototypeFunctionToJSONBody>(*lexicalGlobalObject, *callFrame, "toJSON"); |
| } |
| |
| void JSTestSerialization::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) |
| { |
| auto* thisObject = jsCast<JSTestSerialization*>(cell); |
| analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| if (thisObject->scriptExecutionContext()) |
| analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| Base::analyzeHeap(cell, analyzer); |
| } |
| |
| bool JSTestSerializationOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason) |
| { |
| UNUSED_PARAM(handle); |
| UNUSED_PARAM(visitor); |
| UNUSED_PARAM(reason); |
| return false; |
| } |
| |
| void JSTestSerializationOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| { |
| auto* jsTestSerialization = static_cast<JSTestSerialization*>(handle.slot()->asCell()); |
| auto& world = *static_cast<DOMWrapperWorld*>(context); |
| uncacheWrapper(world, &jsTestSerialization->wrapped(), jsTestSerialization); |
| } |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| #if PLATFORM(WIN) |
| #pragma warning(disable: 4483) |
| extern "C" { extern void (*const __identifier("??_7TestSerialization@WebCore@@6B@")[])(); } |
| #else |
| extern "C" { extern void* _ZTVN7WebCore17TestSerializationE[]; } |
| #endif |
| #endif |
| |
| JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestSerialization>&& impl) |
| { |
| |
| #if ENABLE(BINDING_INTEGRITY) |
| void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr())); |
| #if PLATFORM(WIN) |
| void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7TestSerialization@WebCore@@6B@")); |
| #else |
| void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore17TestSerializationE[2]); |
| #endif |
| |
| // If this fails TestSerialization does not have a vtable, so you need to add the |
| // ImplementationLacksVTable attribute to the interface definition |
| static_assert(std::is_polymorphic<TestSerialization>::value, "TestSerialization is not polymorphic"); |
| |
| // If you hit this assertion you either have a use after free bug, or |
| // TestSerialization has subclasses. If TestSerialization has subclasses that get passed |
| // to toJS() we currently require TestSerialization you to opt out of binding hardening |
| // by adding the SkipVTableValidation attribute to the interface IDL definition |
| RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| #endif |
| return createWrapper<TestSerialization>(globalObject, WTFMove(impl)); |
| } |
| |
| JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestSerialization& impl) |
| { |
| return wrap(lexicalGlobalObject, globalObject, impl); |
| } |
| |
| TestSerialization* JSTestSerialization::toWrapped(JSC::VM& vm, JSC::JSValue value) |
| { |
| if (auto* wrapper = jsDynamicCast<JSTestSerialization*>(vm, value)) |
| return &wrapper->wrapped(); |
| return nullptr; |
| } |
| |
| } |