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