fb6089cbd41a5bfe3282737b227158d30817fe7a
[WebKit.git] / Source / WebCore / bindings / scripts / test / JS / JSTestNamedAndIndexedSetterWithIdentifier.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 "JSTestNamedAndIndexedSetterWithIdentifier.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 jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(JSC::ExecState*);
48 JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(JSC::ExecState*);
49
50 // Attributes
51
52 JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
53 bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
54
55 class JSTestNamedAndIndexedSetterWithIdentifierPrototype : public JSC::JSNonFinalObject {
56 public:
57     using Base = JSC::JSNonFinalObject;
58     static JSTestNamedAndIndexedSetterWithIdentifierPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
59     {
60         JSTestNamedAndIndexedSetterWithIdentifierPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedAndIndexedSetterWithIdentifierPrototype>(vm.heap)) JSTestNamedAndIndexedSetterWithIdentifierPrototype(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     JSTestNamedAndIndexedSetterWithIdentifierPrototype(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 JSTestNamedAndIndexedSetterWithIdentifierConstructor = JSDOMConstructorNotConstructable<JSTestNamedAndIndexedSetterWithIdentifier>;
81
82 template<> JSValue JSTestNamedAndIndexedSetterWithIdentifierConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
83 {
84     UNUSED_PARAM(vm);
85     return globalObject.functionPrototype();
86 }
87
88 template<> void JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
89 {
90     putDirect(vm, vm.propertyNames->prototype, JSTestNamedAndIndexedSetterWithIdentifier::prototype(vm, globalObject), JSC::PropertyAttribute::DontDelete | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::DontEnum);
91     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String("TestNamedAndIndexedSetterWithIdentifier"_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 JSTestNamedAndIndexedSetterWithIdentifierConstructor::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierConstructor) };
96
97 /* Hash table for prototype */
98
99 static const HashTableValue JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues[] =
100 {
101     { "constructor", static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedAndIndexedSetterWithIdentifierConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedAndIndexedSetterWithIdentifierConstructor) } },
102     { "namedSetter", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter), (intptr_t) (2) } },
103     { "indexedSetter", static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { (intptr_t)static_cast<RawNativeFunction>(jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter), (intptr_t) (2) } },
104 };
105
106 const ClassInfo JSTestNamedAndIndexedSetterWithIdentifierPrototype::s_info = { "TestNamedAndIndexedSetterWithIdentifierPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifierPrototype) };
107
108 void JSTestNamedAndIndexedSetterWithIdentifierPrototype::finishCreation(VM& vm)
109 {
110     Base::finishCreation(vm);
111     reifyStaticProperties(vm, JSTestNamedAndIndexedSetterWithIdentifier::info(), JSTestNamedAndIndexedSetterWithIdentifierPrototypeTableValues, *this);
112 }
113
114 const ClassInfo JSTestNamedAndIndexedSetterWithIdentifier::s_info = { "TestNamedAndIndexedSetterWithIdentifier", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedAndIndexedSetterWithIdentifier) };
115
116 JSTestNamedAndIndexedSetterWithIdentifier::JSTestNamedAndIndexedSetterWithIdentifier(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedAndIndexedSetterWithIdentifier>&& impl)
117     : JSDOMWrapper<TestNamedAndIndexedSetterWithIdentifier>(structure, globalObject, WTFMove(impl))
118 {
119 }
120
121 void JSTestNamedAndIndexedSetterWithIdentifier::finishCreation(VM& vm)
122 {
123     Base::finishCreation(vm);
124     ASSERT(inherits(vm, info()));
125
126 }
127
128 JSObject* JSTestNamedAndIndexedSetterWithIdentifier::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
129 {
130     return JSTestNamedAndIndexedSetterWithIdentifierPrototype::create(vm, &globalObject, JSTestNamedAndIndexedSetterWithIdentifierPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
131 }
132
133 JSObject* JSTestNamedAndIndexedSetterWithIdentifier::prototype(VM& vm, JSDOMGlobalObject& globalObject)
134 {
135     return getDOMPrototype<JSTestNamedAndIndexedSetterWithIdentifier>(vm, globalObject);
136 }
137
138 JSValue JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(VM& vm, const JSGlobalObject* globalObject)
139 {
140     return getDOMConstructor<JSTestNamedAndIndexedSetterWithIdentifierConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
141 }
142
143 void JSTestNamedAndIndexedSetterWithIdentifier::destroy(JSC::JSCell* cell)
144 {
145     JSTestNamedAndIndexedSetterWithIdentifier* thisObject = static_cast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
146     thisObject->JSTestNamedAndIndexedSetterWithIdentifier::~JSTestNamedAndIndexedSetterWithIdentifier();
147 }
148
149 bool JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
150 {
151     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(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().item(index.value()));
156             slot.setValue(thisObject, static_cast<unsigned>(0), 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) -> 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 WTF::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 JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
177 {
178     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(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().item(index));
183             slot.setValue(thisObject, static_cast<unsigned>(0), 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) -> 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 WTF::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 JSTestNamedAndIndexedSetterWithIdentifier::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
205 {
206     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(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 JSTestNamedAndIndexedSetterWithIdentifier::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
216 {
217     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
218     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
219
220     if (auto index = parseIndex(propertyName)) {
221         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
222         auto nativeValue = convert<IDLDOMString>(*state, value);
223         RETURN_IF_EXCEPTION(throwScope, true);
224         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
225         return true;
226     }
227
228     if (!propertyName.isSymbol()) {
229         PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
230         JSValue prototype = thisObject->getPrototypeDirect(state->vm());
231         if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
232             auto throwScope = DECLARE_THROW_SCOPE(state->vm());
233             auto nativeValue = convert<IDLDOMString>(*state, value);
234             RETURN_IF_EXCEPTION(throwScope, true);
235             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
236             return true;
237         }
238     }
239
240     return JSObject::put(thisObject, state, propertyName, value, putPropertySlot);
241 }
242
243 bool JSTestNamedAndIndexedSetterWithIdentifier::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool shouldThrow)
244 {
245     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
246     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
247
248     if (LIKELY(index <= MAX_ARRAY_INDEX)) {
249         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
250         auto nativeValue = convert<IDLDOMString>(*state, value);
251         RETURN_IF_EXCEPTION(throwScope, true);
252         thisObject->wrapped().indexedSetter(index, WTFMove(nativeValue));
253         return true;
254     }
255
256     auto propertyName = Identifier::from(state, index);
257     PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
258     JSValue prototype = thisObject->getPrototypeDirect(state->vm());
259     if (!(prototype.isObject() && asObject(prototype)->getPropertySlot(state, propertyName, slot))) {
260         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
261         auto nativeValue = convert<IDLDOMString>(*state, value);
262         RETURN_IF_EXCEPTION(throwScope, true);
263         thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
264         return true;
265     }
266
267     return JSObject::putByIndex(cell, state, index, value, shouldThrow);
268 }
269
270 bool JSTestNamedAndIndexedSetterWithIdentifier::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
271 {
272     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(object);
273     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
274
275     if (auto index = parseIndex(propertyName)) {
276         if (!propertyDescriptor.isDataDescriptor())
277             return false;
278         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
279         auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
280         RETURN_IF_EXCEPTION(throwScope, true);
281         thisObject->wrapped().indexedSetter(index.value(), WTFMove(nativeValue));
282         return true;
283     }
284
285     if (!propertyName.isSymbol()) {
286         PropertySlot slot { thisObject, PropertySlot::InternalMethodType::VMInquiry };
287         if (!JSObject::getOwnPropertySlot(thisObject, state, propertyName, slot)) {
288             if (!propertyDescriptor.isDataDescriptor())
289                 return false;
290             auto throwScope = DECLARE_THROW_SCOPE(state->vm());
291             auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
292             RETURN_IF_EXCEPTION(throwScope, true);
293             thisObject->wrapped().namedSetter(propertyNameToString(propertyName), WTFMove(nativeValue));
294             return true;
295         }
296     }
297
298     PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
299     newPropertyDescriptor.setConfigurable(true);
300     return JSObject::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
301 }
302
303 template<> inline JSTestNamedAndIndexedSetterWithIdentifier* IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::cast(ExecState& state)
304 {
305     return jsDynamicCast<JSTestNamedAndIndexedSetterWithIdentifier*>(state.vm(), state.thisValue());
306 }
307
308 EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
309 {
310     VM& vm = state->vm();
311     auto throwScope = DECLARE_THROW_SCOPE(vm);
312     auto* prototype = jsDynamicCast<JSTestNamedAndIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
313     if (UNLIKELY(!prototype))
314         return throwVMTypeError(state, throwScope);
315     return JSValue::encode(JSTestNamedAndIndexedSetterWithIdentifier::getConstructor(state->vm(), prototype->globalObject()));
316 }
317
318 bool setJSTestNamedAndIndexedSetterWithIdentifierConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
319 {
320     VM& vm = state->vm();
321     auto throwScope = DECLARE_THROW_SCOPE(vm);
322     auto* prototype = jsDynamicCast<JSTestNamedAndIndexedSetterWithIdentifierPrototype*>(vm, JSValue::decode(thisValue));
323     if (UNLIKELY(!prototype)) {
324         throwVMTypeError(state, throwScope);
325         return false;
326     }
327     // Shadowing a built-in constructor
328     return prototype->putDirect(vm, vm.propertyNames->constructor, JSValue::decode(encodedValue));
329 }
330
331 static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
332 {
333     UNUSED_PARAM(state);
334     UNUSED_PARAM(throwScope);
335     auto& impl = castedThis->wrapped();
336     if (UNLIKELY(state->argumentCount() < 2))
337         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
338     auto name = convert<IDLDOMString>(*state, state->uncheckedArgument(0));
339     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
340     auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
341     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
342     impl.namedSetter(WTFMove(name), WTFMove(value));
343     return JSValue::encode(jsUndefined());
344 }
345
346 EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetter(ExecState* state)
347 {
348     return IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::call<jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionNamedSetterBody>(*state, "namedSetter");
349 }
350
351 static inline JSC::EncodedJSValue jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
352 {
353     UNUSED_PARAM(state);
354     UNUSED_PARAM(throwScope);
355     auto& impl = castedThis->wrapped();
356     if (UNLIKELY(state->argumentCount() < 2))
357         return throwVMError(state, throwScope, createNotEnoughArgumentsError(state));
358     auto index = convert<IDLUnsignedLong>(*state, state->uncheckedArgument(0));
359     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
360     auto value = convert<IDLDOMString>(*state, state->uncheckedArgument(1));
361     RETURN_IF_EXCEPTION(throwScope, encodedJSValue());
362     impl.indexedSetter(WTFMove(index), WTFMove(value));
363     return JSValue::encode(jsUndefined());
364 }
365
366 EncodedJSValue JSC_HOST_CALL jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetter(ExecState* state)
367 {
368     return IDLOperation<JSTestNamedAndIndexedSetterWithIdentifier>::call<jsTestNamedAndIndexedSetterWithIdentifierPrototypeFunctionIndexedSetterBody>(*state, "indexedSetter");
369 }
370
371 void JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot(JSCell* cell, HeapSnapshotBuilder& builder)
372 {
373     auto* thisObject = jsCast<JSTestNamedAndIndexedSetterWithIdentifier*>(cell);
374     builder.setWrappedObjectForCell(cell, &thisObject->wrapped());
375     if (thisObject->scriptExecutionContext())
376         builder.setLabelForCell(cell, "url " + thisObject->scriptExecutionContext()->url().string());
377     Base::heapSnapshot(cell, builder);
378 }
379
380 bool JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor, const char** reason)
381 {
382     UNUSED_PARAM(handle);
383     UNUSED_PARAM(visitor);
384     UNUSED_PARAM(reason);
385     return false;
386 }
387
388 void JSTestNamedAndIndexedSetterWithIdentifierOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
389 {
390     auto* jsTestNamedAndIndexedSetterWithIdentifier = static_cast<JSTestNamedAndIndexedSetterWithIdentifier*>(handle.slot()->asCell());
391     auto& world = *static_cast<DOMWrapperWorld*>(context);
392     uncacheWrapper(world, &jsTestNamedAndIndexedSetterWithIdentifier->wrapped(), jsTestNamedAndIndexedSetterWithIdentifier);
393 }
394
395 #if ENABLE(BINDING_INTEGRITY)
396 #if PLATFORM(WIN)
397 #pragma warning(disable: 4483)
398 extern "C" { extern void (*const __identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@")[])(); }
399 #else
400 extern "C" { extern void* _ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[]; }
401 #endif
402 #endif
403
404 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedAndIndexedSetterWithIdentifier>&& impl)
405 {
406
407 #if ENABLE(BINDING_INTEGRITY)
408     void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
409 #if PLATFORM(WIN)
410     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(__identifier("??_7TestNamedAndIndexedSetterWithIdentifier@WebCore@@6B@"));
411 #else
412     void* expectedVTablePointer = WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION(&_ZTVN7WebCore39TestNamedAndIndexedSetterWithIdentifierE[2]);
413 #endif
414
415     // If this fails TestNamedAndIndexedSetterWithIdentifier does not have a vtable, so you need to add the
416     // ImplementationLacksVTable attribute to the interface definition
417     static_assert(std::is_polymorphic<TestNamedAndIndexedSetterWithIdentifier>::value, "TestNamedAndIndexedSetterWithIdentifier is not polymorphic");
418
419     // If you hit this assertion you either have a use after free bug, or
420     // TestNamedAndIndexedSetterWithIdentifier has subclasses. If TestNamedAndIndexedSetterWithIdentifier has subclasses that get passed
421     // to toJS() we currently require TestNamedAndIndexedSetterWithIdentifier you to opt out of binding hardening
422     // by adding the SkipVTableValidation attribute to the interface IDL definition
423     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
424 #endif
425     return createWrapper<TestNamedAndIndexedSetterWithIdentifier>(globalObject, WTFMove(impl));
426 }
427
428 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedAndIndexedSetterWithIdentifier& impl)
429 {
430     return wrap(state, globalObject, impl);
431 }
432
433 TestNamedAndIndexedSetterWithIdentifier* JSTestNamedAndIndexedSetterWithIdentifier::toWrapped(JSC::VM& vm, JSC::JSValue value)
434 {
435     if (auto* wrapper = jsDynamicCast<JSTestNamedAndIndexedSetterWithIdentifier*>(vm, value))
436         return &wrapper->wrapped();
437     return nullptr;
438 }
439
440 }