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