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