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