Can't use Object.defineProperty() to add an item to a DOMStringMap or Storage
[WebKit.git] / Source / WebCore / bindings / scripts / test / JS / JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.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 "JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h"
23
24 #include "JSDOMAttribute.h"
25 #include "JSDOMBinding.h"
26 #include "JSDOMConstructorNotConstructable.h"
27 #include "JSDOMConvert.h"
28 #include "JSDOMExceptionHandling.h"
29 #include "JSDOMOperation.h"
30 #include "JSDOMWrapperCache.h"
31 #include <runtime/FunctionPrototype.h>
32 #include <wtf/GetPtr.h>
33
34 using namespace JSC;
35
36 namespace WebCore {
37
38 // Functions
39
40 JSC::EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation(JSC::ExecState*);
41
42 // Attributes
43
44 JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
45 bool setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(JSC::ExecState*, JSC::EncodedJSValue, JSC::EncodedJSValue);
46 JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute(JSC::ExecState*, JSC::EncodedJSValue, JSC::PropertyName);
47
48 class JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype : public JSC::JSNonFinalObject {
49 public:
50     using Base = JSC::JSNonFinalObject;
51     static JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype* create(JSC::VM& vm, JSDOMGlobalObject* globalObject, JSC::Structure* structure)
52     {
53         JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype>(vm.heap)) JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype(vm, globalObject, structure);
54         ptr->finishCreation(vm);
55         return ptr;
56     }
57
58     DECLARE_INFO;
59     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
60     {
61         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
62     }
63
64 private:
65     JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
66         : JSC::JSNonFinalObject(vm, structure)
67     {
68     }
69
70     void finishCreation(JSC::VM&);
71 };
72
73 using JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor = JSDOMConstructorNotConstructable<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>;
74
75 /* Hash table */
76
77 static const struct CompactHashIndex JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableIndex[4] = {
78     { -1, -1 },
79     { 1, -1 },
80     { -1, -1 },
81     { 0, -1 },
82 };
83
84
85 static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableValues[] =
86 {
87     { "unforgeableAttribute", DontDelete | ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
88     { "unforgeableOperation", DontDelete | ReadOnly | JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation), (intptr_t) (0) } },
89 };
90
91 static const HashTable JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTable = { 2, 3, true, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableValues, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTableIndex };
92 template<> JSValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
93 {
94     UNUSED_PARAM(vm);
95     return globalObject.functionPrototype();
96 }
97
98 template<> void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
99 {
100     putDirect(vm, vm.propertyNames->prototype, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::prototype(vm, globalObject), DontDelete | ReadOnly | DontEnum);
101     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins"))), ReadOnly | DontEnum);
102     putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
103 }
104
105 template<> const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor) };
106
107 /* Hash table for prototype */
108
109 static const HashTableValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototypeTableValues[] =
110 {
111     { "constructor", DontEnum, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor) } },
112 };
113
114 const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype", &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype) };
115
116 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::finishCreation(VM& vm)
117 {
118     Base::finishCreation(vm);
119     reifyStaticProperties(vm, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototypeTableValues, *this);
120 }
121
122 const ClassInfo JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::s_info = { "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins", &Base::s_info, &JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsTable, nullptr, CREATE_METHOD_TABLE(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins) };
123
124 JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>&& impl)
125     : JSDOMWrapper<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>(structure, globalObject, WTFMove(impl))
126 {
127 }
128
129 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::finishCreation(VM& vm)
130 {
131     Base::finishCreation(vm);
132     ASSERT(inherits(vm, info()));
133
134 }
135
136 JSObject* JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
137 {
138     return JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::create(vm, &globalObject, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype::createStructure(vm, &globalObject, globalObject.objectPrototype()));
139 }
140
141 JSObject* JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::prototype(VM& vm, JSDOMGlobalObject& globalObject)
142 {
143     return getDOMPrototype<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>(vm, globalObject);
144 }
145
146 JSValue JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getConstructor(VM& vm, const JSGlobalObject* globalObject)
147 {
148     return getDOMConstructor<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor>(vm, *jsCast<const JSDOMGlobalObject*>(globalObject));
149 }
150
151 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::destroy(JSC::JSCell* cell)
152 {
153     JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins* thisObject = static_cast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
154     thisObject->JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::~JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins();
155 }
156
157 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)
158 {
159     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
160     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
161     if (thisObject->classInfo() == info() && !propertyName.isSymbol()) {
162         auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
163         if (!IDLDOMString::isNullValue(item)) {
164             slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
165             return true;
166         }
167     }
168     if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))
169         return true;
170     return false;
171 }
172
173 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertySlotByIndex(JSObject* object, ExecState* state, unsigned index, PropertySlot& slot)
174 {
175     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
176     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
177     Identifier propertyName = Identifier::from(state, index);
178     if (thisObject->classInfo() == info()) {
179         auto item = thisObject->wrapped().namedItem(propertyNameToAtomicString(propertyName));
180         if (!IDLDOMString::isNullValue(item)) {
181             slot.setValue(thisObject, 0, toJS<IDLDOMString>(*state, item));
182             return true;
183         }
184     }
185     return Base::getOwnPropertySlotByIndex(thisObject, state, index, slot);
186 }
187
188 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getOwnPropertyNames(JSObject* object, ExecState* state, PropertyNameArray& propertyNames, EnumerationMode mode)
189 {
190     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
191     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
192     for (auto& propertyName : thisObject->wrapped().supportedPropertyNames())
193         propertyNames.add(Identifier::fromString(state, propertyName));
194     Base::getOwnPropertyNames(thisObject, state, propertyNames, mode);
195 }
196
197 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::put(JSCell* cell, ExecState* state, PropertyName propertyName, JSValue value, PutPropertySlot& putPropertySlot)
198 {
199     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
200     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
201
202     if (!propertyName.isSymbol()) {
203         auto throwScope = DECLARE_THROW_SCOPE(state->vm());
204         auto nativeValue = convert<IDLDOMString>(*state, value);
205         RETURN_IF_EXCEPTION(throwScope, true);
206         thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
207         return true;
208     }
209
210     return Base::put(thisObject, state, propertyName, value, putPropertySlot);
211 }
212
213 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::putByIndex(JSCell* cell, ExecState* state, unsigned index, JSValue value, bool)
214 {
215     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(cell);
216     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
217
218     Identifier propertyName = Identifier::from(state, index);
219     auto throwScope = DECLARE_THROW_SCOPE(state->vm());
220     auto nativeValue = convert<IDLDOMString>(*state, value);
221     RETURN_IF_EXCEPTION(throwScope, true);
222     thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
223     return true;
224 }
225
226 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::defineOwnProperty(JSObject* object, ExecState* state, PropertyName propertyName, const PropertyDescriptor& propertyDescriptor, bool shouldThrow)
227 {
228     auto* thisObject = jsCast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(object);
229     ASSERT_GC_OBJECT_INHERITS(thisObject, info());
230
231     if (!propertyName.isSymbol()) {
232 static bool isUnforgeablePropertyName(PropertyName propertyName)
233 {
234     return propertyName == "unforgeableAttribute" || propertyName == "unforgeableOperation";
235 }
236
237         if (!isUnforgeablePropertyName(propertyName)) {
238             if (!propertyDescriptor.isDataDescriptor())
239                 return false;
240             auto throwScope = DECLARE_THROW_SCOPE(state->vm());
241             auto nativeValue = convert<IDLDOMString>(*state, propertyDescriptor.value());
242             RETURN_IF_EXCEPTION(throwScope, true);
243             thisObject->wrapped().setNamedItem(propertyNameToString(propertyName), WTFMove(nativeValue));
244             return true;
245         }
246     }
247
248     PropertyDescriptor newPropertyDescriptor = propertyDescriptor;
249     newPropertyDescriptor.setConfigurable(true);
250     return Base::defineOwnProperty(object, state, propertyName, newPropertyDescriptor, shouldThrow);
251 }
252
253 template<> inline JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins* IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast(ExecState& state, EncodedJSValue thisValue)
254 {
255     return jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(state.vm(), JSValue::decode(thisValue));
256 }
257
258 template<> inline JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins* IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::cast(ExecState& state)
259 {
260     return jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(state.vm(), state.thisValue());
261 }
262
263 EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(ExecState* state, EncodedJSValue thisValue, PropertyName)
264 {
265     VM& vm = state->vm();
266     auto throwScope = DECLARE_THROW_SCOPE(vm);
267     auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype*>(vm, JSValue::decode(thisValue));
268     if (UNLIKELY(!prototype))
269         return throwVMTypeError(state, throwScope);
270     return JSValue::encode(JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::getConstructor(state->vm(), prototype->globalObject()));
271 }
272
273 bool setJSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor(ExecState* state, EncodedJSValue thisValue, EncodedJSValue encodedValue)
274 {
275     VM& vm = state->vm();
276     auto throwScope = DECLARE_THROW_SCOPE(vm);
277     auto* prototype = jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsPrototype*>(vm, JSValue::decode(thisValue));
278     if (UNLIKELY(!prototype)) {
279         throwVMTypeError(state, throwScope);
280         return false;
281     }
282     // Shadowing a built-in constructor
283     return prototype->putDirect(state->vm(), state->propertyNames().constructor, JSValue::decode(encodedValue));
284 }
285
286 static inline JSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttributeGetter(ExecState& state, JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins& thisObject, ThrowScope& throwScope)
287 {
288     UNUSED_PARAM(throwScope);
289     UNUSED_PARAM(state);
290     auto& impl = thisObject.wrapped();
291     JSValue result = toJS<IDLDOMString>(state, impl.unforgeableAttribute());
292     return result;
293 }
294
295 EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttribute(ExecState* state, EncodedJSValue thisValue, PropertyName)
296 {
297     return IDLAttribute<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::get<jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsUnforgeableAttributeGetter>(*state, thisValue, "unforgeableAttribute");
298 }
299
300 static inline JSC::EncodedJSValue jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody(JSC::ExecState* state, typename IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::ClassParameter castedThis, JSC::ThrowScope& throwScope)
301 {
302     UNUSED_PARAM(state);
303     UNUSED_PARAM(throwScope);
304     auto& impl = castedThis->wrapped();
305     impl.unforgeableOperation();
306     return JSValue::encode(jsUndefined());
307 }
308
309 EncodedJSValue JSC_HOST_CALL jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperation(ExecState* state)
310 {
311     return IDLOperation<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>::call<jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsInstanceFunctionUnforgeableOperationBody>(*state, "unforgeableOperation");
312 }
313
314 bool JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
315 {
316     UNUSED_PARAM(handle);
317     UNUSED_PARAM(visitor);
318     return false;
319 }
320
321 void JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
322 {
323     auto* jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins = static_cast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(handle.slot()->asCell());
324     auto& world = *static_cast<DOMWrapperWorld*>(context);
325     uncacheWrapper(world, &jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins->wrapped(), jsTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins);
326 }
327
328 #if ENABLE(BINDING_INTEGRITY)
329 #if PLATFORM(WIN)
330 #pragma warning(disable: 4483)
331 extern "C" { extern void (*const __identifier("??_7TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins@WebCore@@6B@")[])(); }
332 #else
333 extern "C" { extern void* _ZTVN7WebCore58TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsE[]; }
334 #endif
335 #endif
336
337 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, Ref<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>&& impl)
338 {
339
340 #if ENABLE(BINDING_INTEGRITY)
341     void* actualVTablePointer = *(reinterpret_cast<void**>(impl.ptr()));
342 #if PLATFORM(WIN)
343     void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins@WebCore@@6B@"));
344 #else
345     void* expectedVTablePointer = &_ZTVN7WebCore58TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsE[2];
346 #if COMPILER(CLANG)
347     // If this fails TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins does not have a vtable, so you need to add the
348     // ImplementationLacksVTable attribute to the interface definition
349     static_assert(__is_polymorphic(TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins), "TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins is not polymorphic");
350 #endif
351 #endif
352     // If you hit this assertion you either have a use after free bug, or
353     // TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins has subclasses. If TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins has subclasses that get passed
354     // to toJS() we currently require TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins you to opt out of binding hardening
355     // by adding the SkipVTableValidation attribute to the interface IDL definition
356     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
357 #endif
358     return createWrapper<TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins>(globalObject, WTFMove(impl));
359 }
360
361 JSC::JSValue toJS(JSC::ExecState* state, JSDOMGlobalObject* globalObject, TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins& impl)
362 {
363     return wrap(state, globalObject, impl);
364 }
365
366 TestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins* JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::toWrapped(JSC::VM& vm, JSC::JSValue value)
367 {
368     if (auto* wrapper = jsDynamicDowncast<JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins*>(vm, value))
369         return &wrapper->wrapped();
370     return nullptr;
371 }
372
373 }