weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 1 | /* |
| 2 | This file is part of the WebKit open source project. |
| 3 | This file has been generated by generate-bindings.pl. DO NOT MODIFY! |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Library General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Library General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Library General Public License |
| 16 | along with this library; see the file COPYING.LIB. If not, write to |
| 17 | the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 | Boston, MA 02110-1301, USA. |
| 19 | */ |
| 20 | |
| 21 | #include "config.h" |
| 22 | #include "JSTestMapLikeWithOverriddenOperations.h" |
| 23 | |
| 24 | #include "ActiveDOMObject.h" |
| 25 | #include "DOMIsoSubspaces.h" |
| 26 | #include "JSDOMAttribute.h" |
| 27 | #include "JSDOMBinding.h" |
| 28 | #include "JSDOMConstructorNotConstructable.h" |
| 29 | #include "JSDOMConvertAny.h" |
| 30 | #include "JSDOMConvertNumbers.h" |
| 31 | #include "JSDOMConvertStrings.h" |
| 32 | #include "JSDOMExceptionHandling.h" |
| 33 | #include "JSDOMMapLike.h" |
| 34 | #include "JSDOMOperation.h" |
| 35 | #include "JSDOMWrapperCache.h" |
| 36 | #include "ScriptExecutionContext.h" |
| 37 | #include "WebCoreJSClientData.h" |
| 38 | #include <JavaScriptCore/BuiltinNames.h> |
| 39 | #include <JavaScriptCore/FunctionPrototype.h> |
| 40 | #include <JavaScriptCore/HeapAnalyzer.h> |
| 41 | #include <JavaScriptCore/JSCInlines.h> |
| 42 | #include <JavaScriptCore/JSDestructibleObjectHeapCellType.h> |
mark.lam@apple.com | 17ae490 | 2021-02-19 15:51:15 +0000 | [diff] [blame^] | 43 | #include <JavaScriptCore/SlotVisitorMacros.h> |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 44 | #include <JavaScriptCore/SubspaceInlines.h> |
| 45 | #include <wtf/GetPtr.h> |
| 46 | #include <wtf/PointerPreparations.h> |
| 47 | #include <wtf/URL.h> |
| 48 | |
| 49 | |
| 50 | namespace WebCore { |
| 51 | using namespace JSC; |
| 52 | |
| 53 | // Functions |
| 54 | |
weinig@apple.com | 2b5979b | 2020-10-26 18:41:09 +0000 | [diff] [blame] | 55 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_clear); |
| 56 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_get); |
| 57 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_has); |
| 58 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_entries); |
| 59 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_keys); |
| 60 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_values); |
| 61 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_forEach); |
| 62 | static JSC_DECLARE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_delete); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 63 | |
| 64 | // Attributes |
| 65 | |
weinig@apple.com | 2b5979b | 2020-10-26 18:41:09 +0000 | [diff] [blame] | 66 | static JSC_DECLARE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperationsConstructor); |
| 67 | static JSC_DECLARE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperations_set); |
| 68 | static JSC_DECLARE_CUSTOM_SETTER(setJSTestMapLikeWithOverriddenOperations_set); |
| 69 | static JSC_DECLARE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperations_size); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 70 | |
| 71 | class JSTestMapLikeWithOverriddenOperationsPrototype final : public JSC::JSNonFinalObject { |
| 72 | public: |
| 73 | using Base = JSC::JSNonFinalObject; |
| 74 | static JSTestMapLikeWithOverriddenOperationsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure) |
| 75 | { |
| 76 | JSTestMapLikeWithOverriddenOperationsPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestMapLikeWithOverriddenOperationsPrototype>(vm.heap)) JSTestMapLikeWithOverriddenOperationsPrototype(vm, globalObject, structure); |
| 77 | ptr->finishCreation(vm); |
| 78 | return ptr; |
| 79 | } |
| 80 | |
| 81 | DECLARE_INFO; |
| 82 | template<typename CellType, JSC::SubspaceAccess> |
| 83 | static JSC::IsoSubspace* subspaceFor(JSC::VM& vm) |
| 84 | { |
| 85 | STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestMapLikeWithOverriddenOperationsPrototype, Base); |
| 86 | return &vm.plainObjectSpace; |
| 87 | } |
| 88 | static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype) |
| 89 | { |
| 90 | return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info()); |
| 91 | } |
| 92 | |
| 93 | private: |
| 94 | JSTestMapLikeWithOverriddenOperationsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure) |
| 95 | : JSC::JSNonFinalObject(vm, structure) |
| 96 | { |
| 97 | } |
| 98 | |
| 99 | void finishCreation(JSC::VM&); |
| 100 | }; |
| 101 | STATIC_ASSERT_ISO_SUBSPACE_SHARABLE(JSTestMapLikeWithOverriddenOperationsPrototype, JSTestMapLikeWithOverriddenOperationsPrototype::Base); |
| 102 | |
cdumez@apple.com | 39fa66b | 2020-10-02 19:21:03 +0000 | [diff] [blame] | 103 | using JSTestMapLikeWithOverriddenOperationsDOMConstructor = JSDOMConstructorNotConstructable<JSTestMapLikeWithOverriddenOperations>; |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 104 | |
cdumez@apple.com | 39fa66b | 2020-10-02 19:21:03 +0000 | [diff] [blame] | 105 | template<> JSValue JSTestMapLikeWithOverriddenOperationsDOMConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 106 | { |
| 107 | UNUSED_PARAM(vm); |
| 108 | return globalObject.functionPrototype(); |
| 109 | } |
| 110 | |
cdumez@apple.com | 39fa66b | 2020-10-02 19:21:03 +0000 | [diff] [blame] | 111 | template<> void JSTestMapLikeWithOverriddenOperationsDOMConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 112 | { |
| 113 | putDirect(vm, vm.propertyNames->prototype, JSTestMapLikeWithOverriddenOperations::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 114 | putDirect(vm, vm.propertyNames->name, jsNontrivialString(vm, "TestMapLikeWithOverriddenOperations"_s), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 115 | putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum); |
| 116 | } |
| 117 | |
cdumez@apple.com | 39fa66b | 2020-10-02 19:21:03 +0000 | [diff] [blame] | 118 | template<> const ClassInfo JSTestMapLikeWithOverriddenOperationsDOMConstructor::s_info = { "TestMapLikeWithOverriddenOperations", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestMapLikeWithOverriddenOperationsDOMConstructor) }; |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 119 | |
| 120 | /* Hash table for prototype */ |
| 121 | |
| 122 | static const HashTableValue JSTestMapLikeWithOverriddenOperationsPrototypeTableValues[] = |
| 123 | { |
shvaikalesh@gmail.com | ecaf357 | 2020-10-20 02:49:07 +0000 | [diff] [blame] | 124 | { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMapLikeWithOverriddenOperationsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 125 | { "set", static_cast<unsigned>(JSC::PropertyAttribute::CustomAccessor | JSC::PropertyAttribute::DOMAttribute), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMapLikeWithOverriddenOperations_set), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestMapLikeWithOverriddenOperations_set) } }, |
| 126 | { "size", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::CustomAccessor), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestMapLikeWithOverriddenOperations_size), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } }, |
| 127 | { "clear", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_clear), (intptr_t) (0) } }, |
| 128 | { "get", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_get), (intptr_t) (1) } }, |
| 129 | { "has", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_has), (intptr_t) (1) } }, |
| 130 | { "entries", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_entries), (intptr_t) (0) } }, |
| 131 | { "keys", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_keys), (intptr_t) (0) } }, |
| 132 | { "values", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_values), (intptr_t) (0) } }, |
| 133 | { "forEach", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_forEach), (intptr_t) (1) } }, |
| 134 | { "delete", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_delete), (intptr_t) (1) } }, |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 135 | }; |
| 136 | |
| 137 | const ClassInfo JSTestMapLikeWithOverriddenOperationsPrototype::s_info = { "TestMapLikeWithOverriddenOperations", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestMapLikeWithOverriddenOperationsPrototype) }; |
| 138 | |
| 139 | void JSTestMapLikeWithOverriddenOperationsPrototype::finishCreation(VM& vm) |
| 140 | { |
| 141 | Base::finishCreation(vm); |
| 142 | reifyStaticProperties(vm, JSTestMapLikeWithOverriddenOperations::info(), JSTestMapLikeWithOverriddenOperationsPrototypeTableValues, *this); |
| 143 | putDirect(vm, vm.propertyNames->iteratorSymbol, getDirect(vm, vm.propertyNames->builtinNames().entriesPublicName()), static_cast<unsigned>(JSC::PropertyAttribute::DontEnum)); |
| 144 | JSC_TO_STRING_TAG_WITHOUT_TRANSITION(); |
| 145 | } |
| 146 | |
| 147 | const ClassInfo JSTestMapLikeWithOverriddenOperations::s_info = { "TestMapLikeWithOverriddenOperations", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestMapLikeWithOverriddenOperations) }; |
| 148 | |
| 149 | JSTestMapLikeWithOverriddenOperations::JSTestMapLikeWithOverriddenOperations(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestMapLikeWithOverriddenOperations>&& impl) |
| 150 | : JSDOMWrapper<TestMapLikeWithOverriddenOperations>(structure, globalObject, WTFMove(impl)) |
| 151 | { |
| 152 | } |
| 153 | |
| 154 | void JSTestMapLikeWithOverriddenOperations::finishCreation(VM& vm) |
| 155 | { |
| 156 | Base::finishCreation(vm); |
| 157 | ASSERT(inherits(vm, info())); |
| 158 | |
| 159 | static_assert(!std::is_base_of<ActiveDOMObject, TestMapLikeWithOverriddenOperations>::value, "Interface is not marked as [ActiveDOMObject] even though implementation class subclasses ActiveDOMObject."); |
| 160 | |
| 161 | } |
| 162 | |
| 163 | JSObject* JSTestMapLikeWithOverriddenOperations::createPrototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 164 | { |
| 165 | return JSTestMapLikeWithOverriddenOperationsPrototype::create(vm, &globalObject, JSTestMapLikeWithOverriddenOperationsPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype())); |
| 166 | } |
| 167 | |
| 168 | JSObject* JSTestMapLikeWithOverriddenOperations::prototype(VM& vm, JSDOMGlobalObject& globalObject) |
| 169 | { |
| 170 | return getDOMPrototype<JSTestMapLikeWithOverriddenOperations>(vm, globalObject); |
| 171 | } |
| 172 | |
| 173 | JSValue JSTestMapLikeWithOverriddenOperations::getConstructor(VM& vm, const JSGlobalObject* globalObject) |
| 174 | { |
cdumez@apple.com | 39fa66b | 2020-10-02 19:21:03 +0000 | [diff] [blame] | 175 | return getDOMConstructor<JSTestMapLikeWithOverriddenOperationsDOMConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject)); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 176 | } |
| 177 | |
| 178 | void JSTestMapLikeWithOverriddenOperations::destroy(JSC::JSCell* cell) |
| 179 | { |
| 180 | JSTestMapLikeWithOverriddenOperations* thisObject = static_cast<JSTestMapLikeWithOverriddenOperations*>(cell); |
| 181 | thisObject->JSTestMapLikeWithOverriddenOperations::~JSTestMapLikeWithOverriddenOperations(); |
| 182 | } |
| 183 | |
| 184 | template<> inline JSTestMapLikeWithOverriddenOperations* IDLAttribute<JSTestMapLikeWithOverriddenOperations>::cast(JSGlobalObject& lexicalGlobalObject, EncodedJSValue thisValue) |
| 185 | { |
| 186 | return jsDynamicCast<JSTestMapLikeWithOverriddenOperations*>(JSC::getVM(&lexicalGlobalObject), JSValue::decode(thisValue)); |
| 187 | } |
| 188 | |
| 189 | template<> inline JSTestMapLikeWithOverriddenOperations* IDLOperation<JSTestMapLikeWithOverriddenOperations>::cast(JSGlobalObject& lexicalGlobalObject, CallFrame& callFrame) |
| 190 | { |
| 191 | return jsDynamicCast<JSTestMapLikeWithOverriddenOperations*>(JSC::getVM(&lexicalGlobalObject), callFrame.thisValue()); |
| 192 | } |
| 193 | |
ysuzuki@apple.com | f4d958e | 2020-09-29 05:51:12 +0000 | [diff] [blame] | 194 | JSC_DEFINE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperationsConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 195 | { |
| 196 | VM& vm = JSC::getVM(lexicalGlobalObject); |
| 197 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 198 | auto* prototype = jsDynamicCast<JSTestMapLikeWithOverriddenOperationsPrototype*>(vm, JSValue::decode(thisValue)); |
| 199 | if (UNLIKELY(!prototype)) |
| 200 | return throwVMTypeError(lexicalGlobalObject, throwScope); |
| 201 | return JSValue::encode(JSTestMapLikeWithOverriddenOperations::getConstructor(JSC::getVM(lexicalGlobalObject), prototype->globalObject())); |
| 202 | } |
| 203 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 204 | static inline JSValue jsTestMapLikeWithOverriddenOperations_setGetter(JSGlobalObject& lexicalGlobalObject, JSTestMapLikeWithOverriddenOperations& thisObject) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 205 | { |
| 206 | auto& vm = JSC::getVM(&lexicalGlobalObject); |
| 207 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 208 | auto& impl = thisObject.wrapped(); |
| 209 | RELEASE_AND_RETURN(throwScope, (toJS<IDLLong>(lexicalGlobalObject, throwScope, impl.set()))); |
| 210 | } |
| 211 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 212 | JSC_DEFINE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperations_set, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 213 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 214 | return IDLAttribute<JSTestMapLikeWithOverriddenOperations>::get<jsTestMapLikeWithOverriddenOperations_setGetter, CastedThisErrorBehavior::Assert>(*lexicalGlobalObject, thisValue, "set"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 215 | } |
| 216 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 217 | static inline bool setJSTestMapLikeWithOverriddenOperations_setSetter(JSGlobalObject& lexicalGlobalObject, JSTestMapLikeWithOverriddenOperations& thisObject, JSValue value) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 218 | { |
| 219 | auto& vm = JSC::getVM(&lexicalGlobalObject); |
| 220 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 221 | auto& impl = thisObject.wrapped(); |
| 222 | auto nativeValue = convert<IDLLong>(lexicalGlobalObject, value); |
| 223 | RETURN_IF_EXCEPTION(throwScope, false); |
| 224 | AttributeSetter::call(lexicalGlobalObject, throwScope, [&] { |
| 225 | return impl.setSet(WTFMove(nativeValue)); |
| 226 | }); |
| 227 | return true; |
| 228 | } |
| 229 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 230 | JSC_DEFINE_CUSTOM_SETTER(setJSTestMapLikeWithOverriddenOperations_set, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 231 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 232 | return IDLAttribute<JSTestMapLikeWithOverriddenOperations>::set<setJSTestMapLikeWithOverriddenOperations_setSetter>(*lexicalGlobalObject, thisValue, encodedValue, "set"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 233 | } |
| 234 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 235 | static inline JSValue jsTestMapLikeWithOverriddenOperations_sizeGetter(JSGlobalObject& lexicalGlobalObject, JSTestMapLikeWithOverriddenOperations& thisObject) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 236 | { |
| 237 | auto& vm = JSC::getVM(&lexicalGlobalObject); |
| 238 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 239 | RELEASE_AND_RETURN(throwScope, (toJS<IDLAny>(lexicalGlobalObject, throwScope, forwardSizeToMapLike(lexicalGlobalObject, thisObject)))); |
| 240 | } |
| 241 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 242 | JSC_DEFINE_CUSTOM_GETTER(jsTestMapLikeWithOverriddenOperations_size, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 243 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 244 | return IDLAttribute<JSTestMapLikeWithOverriddenOperations>::get<jsTestMapLikeWithOverriddenOperations_sizeGetter>(*lexicalGlobalObject, thisValue, "size"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 245 | } |
| 246 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 247 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_clearBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 248 | { |
| 249 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 250 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 251 | UNUSED_PARAM(throwScope); |
| 252 | UNUSED_PARAM(callFrame); |
| 253 | auto& impl = castedThis->wrapped(); |
| 254 | throwScope.release(); |
| 255 | impl.clear(); |
| 256 | return JSValue::encode(jsUndefined()); |
| 257 | } |
| 258 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 259 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_clear, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 260 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 261 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_clearBody>(*lexicalGlobalObject, *callFrame, "clear"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 262 | } |
| 263 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 264 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_getBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 265 | { |
| 266 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 267 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 268 | UNUSED_PARAM(throwScope); |
| 269 | UNUSED_PARAM(callFrame); |
| 270 | if (UNLIKELY(callFrame->argumentCount() < 1)) |
| 271 | return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| 272 | EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| 273 | auto key = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| 274 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 275 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardGetToMapLike(*lexicalGlobalObject, *callFrame, *castedThis, WTFMove(key))))); |
| 276 | } |
| 277 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 278 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_get, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 279 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 280 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_getBody>(*lexicalGlobalObject, *callFrame, "get"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 281 | } |
| 282 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 283 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_hasBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 284 | { |
| 285 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 286 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 287 | UNUSED_PARAM(throwScope); |
| 288 | UNUSED_PARAM(callFrame); |
| 289 | if (UNLIKELY(callFrame->argumentCount() < 1)) |
| 290 | return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| 291 | EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| 292 | auto key = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| 293 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 294 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardHasToMapLike(*lexicalGlobalObject, *callFrame, *castedThis, WTFMove(key))))); |
| 295 | } |
| 296 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 297 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_has, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 298 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 299 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_hasBody>(*lexicalGlobalObject, *callFrame, "has"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 300 | } |
| 301 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 302 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_entriesBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 303 | { |
| 304 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 305 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 306 | UNUSED_PARAM(throwScope); |
| 307 | UNUSED_PARAM(callFrame); |
| 308 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardEntriesToMapLike(*lexicalGlobalObject, *callFrame, *castedThis)))); |
| 309 | } |
| 310 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 311 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_entries, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 312 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 313 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_entriesBody>(*lexicalGlobalObject, *callFrame, "entries"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 314 | } |
| 315 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 316 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_keysBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 317 | { |
| 318 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 319 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 320 | UNUSED_PARAM(throwScope); |
| 321 | UNUSED_PARAM(callFrame); |
| 322 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardKeysToMapLike(*lexicalGlobalObject, *callFrame, *castedThis)))); |
| 323 | } |
| 324 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 325 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_keys, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 326 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 327 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_keysBody>(*lexicalGlobalObject, *callFrame, "keys"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 328 | } |
| 329 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 330 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_valuesBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 331 | { |
| 332 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 333 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 334 | UNUSED_PARAM(throwScope); |
| 335 | UNUSED_PARAM(callFrame); |
| 336 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardValuesToMapLike(*lexicalGlobalObject, *callFrame, *castedThis)))); |
| 337 | } |
| 338 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 339 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_values, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 340 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 341 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_valuesBody>(*lexicalGlobalObject, *callFrame, "values"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 342 | } |
| 343 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 344 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_forEachBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 345 | { |
| 346 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 347 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 348 | UNUSED_PARAM(throwScope); |
| 349 | UNUSED_PARAM(callFrame); |
| 350 | if (UNLIKELY(callFrame->argumentCount() < 1)) |
| 351 | return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| 352 | EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| 353 | auto callback = convert<IDLAny>(*lexicalGlobalObject, argument0.value()); |
| 354 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 355 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardForEachToMapLike(*lexicalGlobalObject, *callFrame, *castedThis, WTFMove(callback))))); |
| 356 | } |
| 357 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 358 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_forEach, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 359 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 360 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_forEachBody>(*lexicalGlobalObject, *callFrame, "forEach"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 361 | } |
| 362 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 363 | static inline JSC::EncodedJSValue jsTestMapLikeWithOverriddenOperationsPrototypeFunction_deleteBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation<JSTestMapLikeWithOverriddenOperations>::ClassParameter castedThis) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 364 | { |
| 365 | auto& vm = JSC::getVM(lexicalGlobalObject); |
| 366 | auto throwScope = DECLARE_THROW_SCOPE(vm); |
| 367 | UNUSED_PARAM(throwScope); |
| 368 | UNUSED_PARAM(callFrame); |
| 369 | if (UNLIKELY(callFrame->argumentCount() < 1)) |
| 370 | return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); |
| 371 | EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); |
| 372 | auto key = convert<IDLDOMString>(*lexicalGlobalObject, argument0.value()); |
| 373 | RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); |
| 374 | RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS<IDLAny>(forwardDeleteToMapLike(*lexicalGlobalObject, *callFrame, *castedThis, WTFMove(key))))); |
| 375 | } |
| 376 | |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 377 | JSC_DEFINE_HOST_FUNCTION(jsTestMapLikeWithOverriddenOperationsPrototypeFunction_delete, (JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 378 | { |
weinig@apple.com | ea97c9f | 2020-10-15 20:40:34 +0000 | [diff] [blame] | 379 | return IDLOperation<JSTestMapLikeWithOverriddenOperations>::call<jsTestMapLikeWithOverriddenOperationsPrototypeFunction_deleteBody>(*lexicalGlobalObject, *callFrame, "delete"); |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | JSC::IsoSubspace* JSTestMapLikeWithOverriddenOperations::subspaceForImpl(JSC::VM& vm) |
| 383 | { |
| 384 | auto& clientData = *static_cast<JSVMClientData*>(vm.clientData); |
| 385 | auto& spaces = clientData.subspaces(); |
| 386 | if (auto* space = spaces.m_subspaceForTestMapLikeWithOverriddenOperations.get()) |
| 387 | return space; |
| 388 | static_assert(std::is_base_of_v<JSC::JSDestructibleObject, JSTestMapLikeWithOverriddenOperations> || !JSTestMapLikeWithOverriddenOperations::needsDestruction); |
| 389 | if constexpr (std::is_base_of_v<JSC::JSDestructibleObject, JSTestMapLikeWithOverriddenOperations>) |
| 390 | spaces.m_subspaceForTestMapLikeWithOverriddenOperations = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.destructibleObjectHeapCellType.get(), JSTestMapLikeWithOverriddenOperations); |
| 391 | else |
| 392 | spaces.m_subspaceForTestMapLikeWithOverriddenOperations = makeUnique<IsoSubspace> ISO_SUBSPACE_INIT(vm.heap, vm.cellHeapCellType.get(), JSTestMapLikeWithOverriddenOperations); |
| 393 | auto* space = spaces.m_subspaceForTestMapLikeWithOverriddenOperations.get(); |
| 394 | IGNORE_WARNINGS_BEGIN("unreachable-code") |
| 395 | IGNORE_WARNINGS_BEGIN("tautological-compare") |
mark.lam@apple.com | 17ae490 | 2021-02-19 15:51:15 +0000 | [diff] [blame^] | 396 | void (*myVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSTestMapLikeWithOverriddenOperations::visitOutputConstraints; |
| 397 | void (*jsCellVisitOutputConstraint)(JSC::JSCell*, JSC::SlotVisitor&) = JSC::JSCell::visitOutputConstraints; |
| 398 | if (myVisitOutputConstraint != jsCellVisitOutputConstraint) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 399 | clientData.outputConstraintSpaces().append(space); |
| 400 | IGNORE_WARNINGS_END |
| 401 | IGNORE_WARNINGS_END |
| 402 | return space; |
| 403 | } |
| 404 | |
| 405 | void JSTestMapLikeWithOverriddenOperations::analyzeHeap(JSCell* cell, HeapAnalyzer& analyzer) |
| 406 | { |
| 407 | auto* thisObject = jsCast<JSTestMapLikeWithOverriddenOperations*>(cell); |
| 408 | analyzer.setWrappedObjectForCell(cell, &thisObject->wrapped()); |
| 409 | if (thisObject->scriptExecutionContext()) |
| 410 | analyzer.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string()); |
| 411 | Base::analyzeHeap(cell, analyzer); |
| 412 | } |
| 413 | |
mark.lam@apple.com | 17ae490 | 2021-02-19 15:51:15 +0000 | [diff] [blame^] | 414 | bool JSTestMapLikeWithOverriddenOperationsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, AbstractSlotVisitor& visitor, const char** reason) |
weinig@apple.com | a1c7e0e | 2020-09-14 22:30:09 +0000 | [diff] [blame] | 415 | { |
| 416 | UNUSED_PARAM(handle); |
| 417 | UNUSED_PARAM(visitor); |
| 418 | UNUSED_PARAM(reason); |
| 419 | return false; |
| 420 | } |
| 421 | |
| 422 | void JSTestMapLikeWithOverriddenOperationsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context) |
| 423 | { |
| 424 | auto* jsTestMapLikeWithOverriddenOperations = static_cast<JSTestMapLikeWithOverriddenOperations*>(handle.slot()->asCell()); |
| 425 | auto& world = *static_cast<DOMWrapperWorld*>(context); |
| 426 | uncacheWrapper(world, &jsTestMapLikeWithOverriddenOperations->wrapped(), jsTestMapLikeWithOverriddenOperations); |
| 427 | } |
| 428 | |
| 429 | #if ENABLE(BINDING_INTEGRITY) |
| 430 | #if PLATFORM(WIN) |
| 431 | #pragma warning(disable: 4483) |
| 432 | extern "C" { extern void (*const __identifier("??_7TestMapLikeWithOverriddenOperations@WebCore@@6B@")[])(); } |
| 433 | #else |
| 434 | extern "C" { extern void* _ZTVN7WebCore35TestMapLikeWithOverriddenOperationsE[]; } |
| 435 | #endif |
| 436 | #endif |
| 437 | |
| 438 | JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref<TestMapLikeWithOverriddenOperations>&& impl) |
| 439 | { |
| 440 | |
| 441 | #if ENABLE(BINDING_INTEGRITY) |
| 442 | const void* actualVTablePointer = getVTablePointer(impl.ptr()); |
| 443 | #if PLATFORM(WIN) |
| 444 | void* expectedVTablePointer = __identifier("??_7TestMapLikeWithOverriddenOperations@WebCore@@6B@"); |
| 445 | #else |
| 446 | void* expectedVTablePointer = &_ZTVN7WebCore35TestMapLikeWithOverriddenOperationsE[2]; |
| 447 | #endif |
| 448 | |
| 449 | // If this fails TestMapLikeWithOverriddenOperations does not have a vtable, so you need to add the |
| 450 | // ImplementationLacksVTable attribute to the interface definition |
| 451 | static_assert(std::is_polymorphic<TestMapLikeWithOverriddenOperations>::value, "TestMapLikeWithOverriddenOperations is not polymorphic"); |
| 452 | |
| 453 | // If you hit this assertion you either have a use after free bug, or |
| 454 | // TestMapLikeWithOverriddenOperations has subclasses. If TestMapLikeWithOverriddenOperations has subclasses that get passed |
| 455 | // to toJS() we currently require TestMapLikeWithOverriddenOperations you to opt out of binding hardening |
| 456 | // by adding the SkipVTableValidation attribute to the interface IDL definition |
| 457 | RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); |
| 458 | #endif |
| 459 | return createWrapper<TestMapLikeWithOverriddenOperations>(globalObject, WTFMove(impl)); |
| 460 | } |
| 461 | |
| 462 | JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TestMapLikeWithOverriddenOperations& impl) |
| 463 | { |
| 464 | return wrap(lexicalGlobalObject, globalObject, impl); |
| 465 | } |
| 466 | |
| 467 | TestMapLikeWithOverriddenOperations* JSTestMapLikeWithOverriddenOperations::toWrapped(JSC::VM& vm, JSC::JSValue value) |
| 468 | { |
| 469 | if (auto* wrapper = jsDynamicCast<JSTestMapLikeWithOverriddenOperations*>(vm, value)) |
| 470 | return &wrapper->wrapped(); |
| 471 | return nullptr; |
| 472 | } |
| 473 | |
| 474 | } |