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