Move URL from WebCore to WTF
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / JS / JSTestNamedSetterWithIndexedGetter.cpp
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 "JSTestNamedSetterWithIndexedGetter.h"
23
24 #include "JSDOMAbstractOperations.h"
25 #include "JSDOMBinding.h"
26 #include "JSDOMConstructorNotConstructable.h"
27 #include "JSDOMConvertNumbers.h"
28 #include "JSDOMConvertStrings.h"
29 #include "JSDOMExceptionHandling.h"
30 #include "JSDOMOperation.h"
31 #include "JSDOMWrapperCache.h"
32 #include "ScriptExecutionContext.h"
33 #include <JavaScriptCore/FunctionPrototype.h>
34 #include <JavaScriptCore/HeapSnapshotBuilder.h>
35 #include <JavaScriptCore/JSCInlines.h>
36 #include <JavaScriptCore/PropertyNameArray.h>
37 #include <wtf/GetPtr.h>
38 #include <wtf/PointerPreparations.h>
39 #include <wtf/URL.h>
40
41
42 namespace WebCore {
43 using namespace JSC;
44
45 // Functions
46
47 JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter(JSC::ExecState*);
48 JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter(JSC::ExecState*);
49
50 // Attributes
51
52 JSC::EncodedJSValue jsTestNamedSetterWithIndexedGetterConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
53 bool setJSTestNamedSetterWithIndexedGetterConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
54
55 class JSTestNamedSetterWithIndexedGetterPrototype : public JSC::JSNonFinalObject {
56 public:
57     using Base = JSC::JSNonFinalObject;
58     static JSTestNamedSetterWithIndexedGetterPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
59     {
60         JSTestNamedSetterWithIndexedGetterPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithIndexedGetterPrototype>(vm.heap)) JSTestNamedSetterWithIndexedGetterPrototype(vm, globalObject, structure);
61         ptr->finishCreation(vm);
62         return ptr;
63     }
64
65     DECLARE_INFO;
66     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
67     {
68         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
69     }
70
71 private:
72     JSTestNamedSetterWithIndexedGetterPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
73         : JSC::JSNonFinalObject(vm, structure)
74     {
75     }
76
77     void finishCreation(JSC::VM&);
78 };
79
80 using JSTestNamedSetterWithIndexedGetterConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithIndexedGetter>;
81
82 template<> JSValue JSTestNamedSetterWithIndexedGetterConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
83 {
84     UNUSED_PARAM(vm);
85     return globalObject.functionPrototype();
86 }
87
88 template<> void JSTestNamedSetterWithIndexedGetterConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
89 {
90     putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithIndexedGetter::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
91     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("TestNamedSetterWithIndexedGetter"_s)), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
92     putDirect(vm, vm.propertyNames->length, jsNumber(0), JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
93 }
94
95 template<> const ClassInfo JSTestNamedSetterWithIndexedGetterConstructor::s_info = { "TestNamedSetterWithIndexedGetter", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIndexedGetterConstructor) };
96
97 /* Hash table for prototype */
98
99 static const HashTableValue JSTestNamedSetterWithIndexedGetterPrototypeTableValues[] =
100 {
101     { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithIndexedGetterConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithIndexedGetterConstructor) } },
102     { "namedSetter", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter), (intptr_t) (2) } },
103     { "indexedSetter", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter), (intptr_t) (1) } },
104 };
105
106 const ClassInfo JSTestNamedSetterWithIndexedGetterPrototype::s_info = { "TestNamedSetterWithIndexedGetterPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIndexedGetterPrototype) };
107
108 void JSTestNamedSetterWithIndexedGetterPrototype::finishCreation(VM& vm)
109 {
110     Base::finishCreation(vm);
111     reifyStaticProperties(vm, JSTestNamedSetterWithIndexedGetter::info(), JSTestNamedSetterWithIndexedGetterPrototypeTableValues, *this);
112 }
113
114 const ClassInfo JSTestNamedSetterWithIndexedGetter::s_info = { "TestNamedSetterWithIndexedGetter", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithIndexedGetter) };
115
116 JSTestNamedSetterWithIndexedGetter::JSTestNamedSetterWithIndexedGetter(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithIndexedGetter>&& impl)
117     : JSDOMWrapper<TestNamedSetterWithIndexedGetter>(structure, globalObject, WTFMove(impl))
118 {
119 }
120
121 void JSTestNamedSetterWithIndexedGetter::finishCreation(VM& vm)
122 {
123     Base::finishCreation(vm);
124     ASSERT(inherits(vm, info()));
125
126 }
127
128 JSObject* JSTestNamedSetterWithIndexedGetter::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
129 {
130     return JSTestNamedSetterWithIndexedGetterPrototype::create(vm, &globalObject, JSTestNamedSetterWithIndexedGetterPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
131 }
132
133 JSObject* JSTestNamedSetterWithIndexedGetter::prototype(VM& vm, JSDOMGlobalObject& globalObject)
134 {
135     return getDOMPrototype<JSTestNamedSetterWithIndexedGetter>(vm, globalObject);
136 }
137
138 JSValue JSTestNamedSetterWithIndexedGetter::getConstructor(VM& vm, const JSGlobalObject* globalObject)
139 {
140     return getDOMConstructor<JSTestNamedSetterWithIndexedGetterConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
141 }
142
143 void JSTestNamedSetterWithIndexedGetter::destroy(JSC::JSCell* cell)
144 {
145     JSTestNamedSetterWithIndexedGetter* thisObject = static_cast<JSTestNamedSetterWithIndexedGetter*>(cell);
146     thisObject->JSTestNamedSetterWithIndexedGetter::~JSTestNamedSetterWithIndexedGetter();
147 }
148
149 bool JSTestNamedSetterWithIndexedGetter::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
150 {
151     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(object);
152     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
153     if (auto index = parseIndex(propertyName)) {
154         if (index.value() < thisObject->wrapped().length()) {
155             auto value = toJS<IDLDOMString>(*state, thisObject->wrapped().indexedSetter(index.value()));
156             slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), value);
157             return true;
158         }
159         return JSObject::getOwnPropertySlot(object, state, propertyName, slot);
160     }
161     using GetterIDLType = IDLDOMString;
162     auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> {
163         auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName));
164         if (!GetterIDLType::isNullValue(result))
165             return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) };
166         return std::nullopt;
167     };
168     if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) {
169         auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value()));
170         slot.setValue(thisObject, static_cast<unsigned>(0), value);
171         return true;
172     }
173     return JSObject::getOwnPropertySlot(object, state, propertyName, slot);
174 }
175
176 bool JSTestNamedSetterWithIndexedGetter::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
177 {
178     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(object);
179     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
180     if (LIKELY(index <= MAX_ARRAY_INDEX)) {
181         if (index < thisObject->wrapped().length()) {
182             auto value = toJS<IDLDOMString>(*state, thisObject->wrapped().indexedSetter(index));
183             slot.setValue(thisObject, static_cast<unsigned>(JSC::PropertyAttribute::ReadOnly), value);
184             return true;
185         }
186         return JSObject::getOwnPropertySlotByIndex(object, state, index, slot);
187     }
188     auto propertyName = Identifier::from(state, index);
189     using GetterIDLType = IDLDOMString;
190     auto getterFunctor = [] (auto& thisObject, auto propertyName) -> std::optional<typename GetterIDLType::ImplementationType> {
191         auto result = thisObject.wrapped().namedItem(propertyNameToAtomicString(propertyName));
192         if (!GetterIDLType::isNullValue(result))
193             return typename GetterIDLType::ImplementationType { GetterIDLType::extractValueFromNullable(result) };
194         return std::nullopt;
195     };
196     if (auto namedProperty = accessVisibleNamedProperty<OverrideBuiltins::No>(*state, *thisObject, propertyName, getterFunctor)) {
197         auto value = toJS<IDLDOMString>(*state, WTFMove(namedProperty.value()));
198         slot.setValue(thisObject, static_cast<unsigned>(0), value);
199         return true;
200     }
201     return JSObject::getOwnPropertySlotByIndex(object, state, index, slot);
202 }
203
204 void JSTestNamedSetterWithIndexedGetter::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
205 {
206     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(object);
207     ASSERT_GC_OBJECT_INHERITS(object, info());
208     for (unsigned i = 0, count = thisObject->wrapped().length(); i < count; ++i)
209         propertyNames.add(Identifier::from(state, i));
210     for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
211         propertyNames.add(Identifier::fromString(state, propertyName));
212     JSObject::getOwnPropertyNames(object, state, propertyNames, mode);
213 }
214
215 bool JSTestNamedSetterWithIndexedGetter::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
216 {
217     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(cell);
218     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
219
220     if (!propertyName.isSymbol()) {
221         PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
222         JSValue prototype = thisObject->getPrototypeDirect(state->vm());
223         if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
224             auto throwScope = DECLARE_THROW_SCOPE(state->vm());
225             auto nativeValue = convert<IDLDOMString>(*state, value);
226             RETURN_IF_EXCEPTION(throwScope, true);
227             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
228             return true;
229         }
230     }
231
232     return JSObject::put(thisObject, state, propertyName, value, putPropertySlot);
233 }
234
235 bool JSTestNamedSetterWithIndexedGetter::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
236 {
237     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(cell);
238     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
239
240     auto propertyName = Identifier::from(state, index);
241     PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
242     JSValue prototype = thisObject->getPrototypeDirect(state->vm());
243     if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
244         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
245         auto nativeValue = convert<IDLDOMString>(*state, value);
246         RETURN_IF_EXCEPTION(throwScope, true);
247         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
248         return true;
249     }
250
251     return JSObject::putByIndex(cell, state, index, value, shouldThrow);
252 }
253
254 bool JSTestNamedSetterWithIndexedGetter::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
255 {
256     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(object);
257     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
258
259     if (parseIndex(propertyName))
260         return false;
261
262     if (!propertyName.isSymbol()) {
263         PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
264         if (!JSObject::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
265             if (!propertyDescriptor.isDataDescriptor())
266                 return false;
267             auto throwScope = DECLARE_THROW_SCOPE(state->vm());
268             auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
269             RETURN_IF_EXCEPTION(throwScope, true);
270             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
271             return true;
272         }
273     }
274
275     PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
276     newPropertyDescriptor.setConfigurable(true);
277     return JSObject::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
278 }
279
280 template<> inline JSTestNamedSetterWithIndexedGetter* IDLOperation<JSTestNamedSetterWithIndexedGetter>::cast(ExecState& state)
281 {
282     return jsDynamicCast<JSTestNamedSetterWithIndexedGetter*>(state.vm(), state.thisValue());
283 }
284
285 EncodedJSValue jsTestNamedSetterWithIndexedGetterConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
286 {
287     VM& vm = state->vm();
288     auto throwScope = DECLARE_THROW_SCOPE(vm);
289     auto* prototype = jsDynamicCast<JSTestNamedSetterWithIndexedGetterPrototype*>(vm, JSValue::decode(thisValue));
290     if (UNLIKELY(!prototype))
291         return throwVMTypeError(state, throwScope);
292     return JSValue::encode(JSTestNamedSetterWithIndexedGetter::getConstructor(state->vm(), prototype->globalObject()));
293 }
294
295 bool setJSTestNamedSetterWithIndexedGetterConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
296 {
297     VM& vm = state->vm();
298     auto throwScope = DECLARE_THROW_SCOPE(vm);
299     auto* prototype = jsDynamicCast<JSTestNamedSetterWithIndexedGetterPrototype*>(vm, JSValue::decode(thisValue));
300     if (UNLIKELY(!prototype)) {
301         throwVMTypeError(state, throwScope);
302         return false;
303     }
304     // Shadowing a built-in constructor
305     return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
306 }
307
308 static inline JSC::EncodedJSValue jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedSetterWithIndexedGetter>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
309 {
310     UNUSED_PARAM(state);
311     UNUSED_PARAM(throwScope);
312     auto& impl = castedThis->wrapped();
313     if (UNLIKELY(state->argumentCount() < 2))
314         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
315     auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
316     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
317     auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
318     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
319     impl.namedSetter(WTFMove(name), WTFMove(value));
320     return JSValue::encode(jsUndefined());
321 }
322
323 EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetter(ExecState* state)
324 {
325     return IDLOperation<JSTestNamedSetterWithIndexedGetter>::call<jsTestNamedSetterWithIndexedGetterPrototypeFunctionNamedSetterBody>(*state, "namedSetter");
326 }
327
328 static inline JSC::EncodedJSValue jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedSetterWithIndexedGetter>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
329 {
330     UNUSED_PARAM(state);
331     UNUSED_PARAM(throwScope);
332     auto& impl = castedThis->wrapped();
333     if (UNLIKELY(state->argumentCount() < 1))
334         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
335     auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
336     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
337     return JSValue::encode(toJS<IDLDOMString>(*state, impl.indexedSetter(WTFMove(index))));
338 }
339
340 EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetter(ExecState* state)
341 {
342     return IDLOperation<JSTestNamedSetterWithIndexedGetter>::call<jsTestNamedSetterWithIndexedGetterPrototypeFunctionIndexedSetterBody>(*state, "indexedSetter");
343 }
344
345 void JSTestNamedSetterWithIndexedGetter::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
346 {
347     auto* thisObject = jsCast<JSTestNamedSetterWithIndexedGetter*>(cell);
348     builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
349     if (thisObject->scriptExecutionContext())
350         builder.setLabelForCell(cell, String::format("url %s", thisObject->scriptExecutionContext()->url().string().utf8().data()));
351     Base::heapSnapshot(cell, builder);
352 }
353
354 bool JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
355 {
356     UNUSED_PARAM(handle);
357     UNUSED_PARAM(visitor);
358     UNUSED_PARAM(reason);
359     return false;
360 }
361
362 void JSTestNamedSetterWithIndexedGetterOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
363 {
364     auto* jsTestNamedSetterWithIndexedGetter = static_cast<JSTestNamedSetterWithIndexedGetter*>(handle.slot()->asCell());
365     auto& world = *static_cast<DOMWrapperWorld*>(context);
366     uncacheWrapper(world, &jsTestNamedSetterWithIndexedGetter->wrapped(), jsTestNamedSetterWithIndexedGetter);
367 }
368
369 #if ENABLE(BINDING_INTEGRITY)
370 #if PLATFORM(WIN)
371 #pragma warning(disable: 4483)
372 extern "C" { extern void (*const __identifier("??_7TestNamedSetterWithIndexedGetter@WebCore@@6B@")[])(); }
373 #else
374 extern "C" { extern void* _ZTVN7WebCore32TestNamedSetterWithIndexedGetterE[]; }
375 #endif
376 #endif
377
378 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithIndexedGetter>&& impl)
379 {
380
381 #if ENABLE(BINDING_INTEGRITY)
382     void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
383 #if PLATFORM(WIN)
384     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7TestNamedSetterWithIndexedGetter@WebCore@@6B@"));
385 #else
386     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore32TestNamedSetterWithIndexedGetterE[2]);
387 #endif
388
389     // If this fails TestNamedSetterWithIndexedGetter does not have a vtable, so you need to add the
390     // ImplementationLacksVTable attribute to the interface definition
391     static_assert(std::is_polymorphic<TestNamedSetterWithIndexedGetter>::value, "TestNamedSetterWithIndexedGetter is not polymorphic");
392
393     // If you hit this assertion you either have a use after free bug, or
394     // TestNamedSetterWithIndexedGetter has subclasses. If TestNamedSetterWithIndexedGetter has subclasses that get passed
395     // to toJS() we currently require TestNamedSetterWithIndexedGetter you to opt out of binding hardening
396     // by adding the SkipVTableValidation attribute to the interface IDL definition
397     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
398 #endif
399     return createWrapper<TestNamedSetterWithIndexedGetter>(globalObject, WTFMove(impl));
400 }
401
402 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithIndexedGetter& impl)
403 {
404     return wrap(state, globalObject, impl);
405 }
406
407 TestNamedSetterWithIndexedGetter* JSTestNamedSetterWithIndexedGetter::toWrapped(JSC::VM& vm, JSC::JSValue value)
408 {
409     if (auto* wrapper = jsDynamicCast<JSTestNamedSetterWithIndexedGetter*>(vm, value))
410         return &wrapper->wrapped();
411     return nullptr;
412 }
413
414 }