Replace WTF::move with WTFMove
[WebKit-https.git] / Source / WebCore / bindings / scripts / test / JS / JSTestNondeterministic.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 "JSTestNondeterministic.h"
23
24 #include "ExceptionCode.h"
25 #include "JSDOMBinding.h"
26 #include "JSDOMConstructor.h"
27 #include "URL.h"
28 #include <runtime/Error.h>
29 #include <runtime/JSString.h>
30 #include <wtf/GetPtr.h>
31
32 #if ENABLE(WEB_REPLAY)
33 #include "MemoizedDOMResult.h"
34 #include <replay/InputCursor.h>
35 #include <wtf/NeverDestroyed.h>
36 #endif
37
38 using namespace JSC;
39
40 namespace WebCore {
41
42 // Functions
43
44 JSC::EncodedJSValue JSC_HOST_CALL jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction(JSC::ExecState*);
45
46 // Attributes
47
48 JSC::EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
49 JSC::EncodedJSValue jsTestNondeterministicNondeterministicWriteableAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
50 void setJSTestNondeterministicNondeterministicWriteableAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
51 JSC::EncodedJSValue jsTestNondeterministicNondeterministicExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
52 void setJSTestNondeterministicNondeterministicExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
53 JSC::EncodedJSValue jsTestNondeterministicNondeterministicGetterExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
54 void setJSTestNondeterministicNondeterministicGetterExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
55 JSC::EncodedJSValue jsTestNondeterministicNondeterministicSetterExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
56 void setJSTestNondeterministicNondeterministicSetterExceptionAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
57 JSC::EncodedJSValue jsTestNondeterministicConstructor(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
58
59 class JSTestNondeterministicPrototype : public JSC::JSNonFinalObject {
60 public:
61     typedef JSC::JSNonFinalObject Base;
62     static JSTestNondeterministicPrototype* create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure)
63     {
64         JSTestNondeterministicPrototype* ptr = new (NotNull, JSC::allocateCell<JSTestNondeterministicPrototype>(vm.heap)) JSTestNondeterministicPrototype(vm, globalObject, structure);
65         ptr->finishCreation(vm);
66         return ptr;
67     }
68
69     DECLARE_INFO;
70     static JSC::Structure* createStructure(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::JSValue prototype)
71     {
72         return JSC::Structure::create(vm, globalObject, prototype, JSC::TypeInfo(JSC::ObjectType, StructureFlags), info());
73     }
74
75 private:
76     JSTestNondeterministicPrototype(JSC::VM& vm, JSC::JSGlobalObject*, JSC::Structure* structure)
77         : JSC::JSNonFinalObject(vm, structure)
78     {
79     }
80
81     void finishCreation(JSC::VM&);
82 };
83
84 typedef JSDOMConstructorNotConstructable<JSTestNondeterministic> JSTestNondeterministicConstructor;
85
86 template<> void JSTestNondeterministicConstructor::initializeProperties(VM& vm, JSDOMGlobalObject& globalObject)
87 {
88     putDirect(vm, vm.propertyNames->prototype, JSTestNondeterministic::getPrototype(vm, &globalObject), DontDelete | ReadOnly | DontEnum);
89     putDirect(vm, vm.propertyNames->name, jsNontrivialString(&vm, String(ASCIILiteral("TestNondeterministic"))), ReadOnly | DontEnum);
90     putDirect(vm, vm.propertyNames->length, jsNumber(0), ReadOnly | DontEnum);
91 }
92
93 template<> const ClassInfo JSTestNondeterministicConstructor::s_info = { "TestNondeterministicConstructor", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNondeterministicConstructor) };
94
95 /* Hash table for prototype */
96
97 static const HashTableValue JSTestNondeterministicPrototypeTableValues[] =
98 {
99     { "constructor", DontEnum | ReadOnly, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
100     { "nondeterministicReadonlyAttr", ReadOnly | CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicNondeterministicReadonlyAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
101     { "nondeterministicWriteableAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicNondeterministicWriteableAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNondeterministicNondeterministicWriteableAttr) } },
102     { "nondeterministicExceptionAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicNondeterministicExceptionAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNondeterministicNondeterministicExceptionAttr) } },
103     { "nondeterministicGetterExceptionAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicNondeterministicGetterExceptionAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNondeterministicNondeterministicGetterExceptionAttr) } },
104     { "nondeterministicSetterExceptionAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestNondeterministicNondeterministicSetterExceptionAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestNondeterministicNondeterministicSetterExceptionAttr) } },
105     { "nondeterministicZeroArgFunction", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction), (intptr_t) (0) } },
106 };
107
108 const ClassInfo JSTestNondeterministicPrototype::s_info = { "TestNondeterministicPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNondeterministicPrototype) };
109
110 void JSTestNondeterministicPrototype::finishCreation(VM& vm)
111 {
112     Base::finishCreation(vm);
113     reifyStaticProperties(vm, JSTestNondeterministicPrototypeTableValues, *this);
114 }
115
116 const ClassInfo JSTestNondeterministic::s_info = { "TestNondeterministic", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestNondeterministic) };
117
118 JSTestNondeterministic::JSTestNondeterministic(Structure* structure, JSDOMGlobalObject& globalObject, Ref<TestNondeterministic>&& impl)
119     : JSDOMWrapper<TestNondeterministic>(structure, globalObject, WTFMove(impl))
120 {
121 }
122
123 JSObject* JSTestNondeterministic::createPrototype(VM& vm, JSGlobalObject* globalObject)
124 {
125     return JSTestNondeterministicPrototype::create(vm, globalObject, JSTestNondeterministicPrototype::createStructure(vm, globalObject, globalObject->objectPrototype()));
126 }
127
128 JSObject* JSTestNondeterministic::getPrototype(VM& vm, JSGlobalObject* globalObject)
129 {
130     return getDOMPrototype<JSTestNondeterministic>(vm, globalObject);
131 }
132
133 void JSTestNondeterministic::destroy(JSC::JSCell* cell)
134 {
135     JSTestNondeterministic* thisObject = static_cast<JSTestNondeterministic*>(cell);
136     thisObject->JSTestNondeterministic::~JSTestNondeterministic();
137 }
138
139 EncodedJSValue jsTestNondeterministicNondeterministicReadonlyAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
140 {
141     UNUSED_PARAM(state);
142     UNUSED_PARAM(slotBase);
143     UNUSED_PARAM(thisValue);
144     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
145     if (UNLIKELY(!castedThis)) {
146         if (jsDynamicCast<JSTestNondeterministicPrototype*>(slotBase))
147             return reportDeprecatedGetterError(*state, "TestNondeterministic", "nondeterministicReadonlyAttr");
148         return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicReadonlyAttr");
149     }
150 #if ENABLE(WEB_REPLAY)
151     JSGlobalObject* globalObject = state->lexicalGlobalObject();
152     InputCursor& cursor = globalObject->inputCursor();
153     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicReadonlyAttr", AtomicString::ConstructFromLiteral);
154     if (cursor.isCapturing()) {
155         int memoizedResult = castedThis->wrapped().nondeterministicReadonlyAttr();
156         cursor.appendInput<MemoizedDOMResult<int>>(bindingName.get().string(), memoizedResult, 0);
157         JSValue result = jsNumber(memoizedResult);
158         return JSValue::encode(result);
159     }
160
161     if (cursor.isReplaying()) {
162         int memoizedResult;
163         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
164         if (input && input->convertTo<int>(memoizedResult)) {
165             JSValue result = jsNumber(memoizedResult);
166             return JSValue::encode(result);
167         }
168     }
169 #endif
170     auto& impl = castedThis->wrapped();
171     JSValue result = jsNumber(impl.nondeterministicReadonlyAttr());
172     return JSValue::encode(result);
173 }
174
175
176 EncodedJSValue jsTestNondeterministicNondeterministicWriteableAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
177 {
178     UNUSED_PARAM(state);
179     UNUSED_PARAM(slotBase);
180     UNUSED_PARAM(thisValue);
181     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
182     if (UNLIKELY(!castedThis)) {
183         if (jsDynamicCast<JSTestNondeterministicPrototype*>(slotBase))
184             return reportDeprecatedGetterError(*state, "TestNondeterministic", "nondeterministicWriteableAttr");
185         return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicWriteableAttr");
186     }
187 #if ENABLE(WEB_REPLAY)
188     JSGlobalObject* globalObject = state->lexicalGlobalObject();
189     InputCursor& cursor = globalObject->inputCursor();
190     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicWriteableAttr", AtomicString::ConstructFromLiteral);
191     if (cursor.isCapturing()) {
192         String memoizedResult = castedThis->wrapped().nondeterministicWriteableAttr();
193         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
194         JSValue result = jsStringWithCache(state, memoizedResult);
195         return JSValue::encode(result);
196     }
197
198     if (cursor.isReplaying()) {
199         String memoizedResult;
200         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
201         if (input && input->convertTo<String>(memoizedResult)) {
202             JSValue result = jsStringWithCache(state, memoizedResult);
203             return JSValue::encode(result);
204         }
205     }
206 #endif
207     auto& impl = castedThis->wrapped();
208     JSValue result = jsStringWithCache(state, impl.nondeterministicWriteableAttr());
209     return JSValue::encode(result);
210 }
211
212
213 EncodedJSValue jsTestNondeterministicNondeterministicExceptionAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
214 {
215     UNUSED_PARAM(state);
216     UNUSED_PARAM(slotBase);
217     UNUSED_PARAM(thisValue);
218     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
219     if (UNLIKELY(!castedThis)) {
220         if (jsDynamicCast<JSTestNondeterministicPrototype*>(slotBase))
221             return reportDeprecatedGetterError(*state, "TestNondeterministic", "nondeterministicExceptionAttr");
222         return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicExceptionAttr");
223     }
224 #if ENABLE(WEB_REPLAY)
225     JSGlobalObject* globalObject = state->lexicalGlobalObject();
226     InputCursor& cursor = globalObject->inputCursor();
227     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicExceptionAttr", AtomicString::ConstructFromLiteral);
228     if (cursor.isCapturing()) {
229         String memoizedResult = castedThis->wrapped().nondeterministicExceptionAttr();
230         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
231         JSValue result = jsStringWithCache(state, memoizedResult);
232         return JSValue::encode(result);
233     }
234
235     if (cursor.isReplaying()) {
236         String memoizedResult;
237         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
238         if (input && input->convertTo<String>(memoizedResult)) {
239             JSValue result = jsStringWithCache(state, memoizedResult);
240             return JSValue::encode(result);
241         }
242     }
243 #endif
244     auto& impl = castedThis->wrapped();
245     JSValue result = jsStringWithCache(state, impl.nondeterministicExceptionAttr());
246     return JSValue::encode(result);
247 }
248
249
250 EncodedJSValue jsTestNondeterministicNondeterministicGetterExceptionAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
251 {
252     UNUSED_PARAM(state);
253     UNUSED_PARAM(slotBase);
254     UNUSED_PARAM(thisValue);
255     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
256     if (UNLIKELY(!castedThis)) {
257         if (jsDynamicCast<JSTestNondeterministicPrototype*>(slotBase))
258             return reportDeprecatedGetterError(*state, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
259         return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
260     }
261     ExceptionCode ec = 0;
262 #if ENABLE(WEB_REPLAY)
263     JSGlobalObject* globalObject = state->lexicalGlobalObject();
264     InputCursor& cursor = globalObject->inputCursor();
265     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicGetterExceptionAttr", AtomicString::ConstructFromLiteral);
266     if (cursor.isCapturing()) {
267         String memoizedResult = castedThis->wrapped().nondeterministicGetterExceptionAttr(ec);
268         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, ec);
269         JSValue result = jsStringWithCache(state, memoizedResult);
270         setDOMException(state, ec);
271         return JSValue::encode(result);
272     }
273
274     if (cursor.isReplaying()) {
275         String memoizedResult;
276         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
277         if (input && input->convertTo<String>(memoizedResult)) {
278             JSValue result = jsStringWithCache(state, memoizedResult);
279             setDOMException(state, input->exceptionCode());
280             return JSValue::encode(result);
281         }
282     }
283 #endif
284     auto& impl = castedThis->wrapped();
285     JSValue result = jsStringWithCache(state, impl.nondeterministicGetterExceptionAttr(ec));
286     setDOMException(state, ec);
287     return JSValue::encode(result);
288 }
289
290
291 EncodedJSValue jsTestNondeterministicNondeterministicSetterExceptionAttr(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
292 {
293     UNUSED_PARAM(state);
294     UNUSED_PARAM(slotBase);
295     UNUSED_PARAM(thisValue);
296     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
297     if (UNLIKELY(!castedThis)) {
298         if (jsDynamicCast<JSTestNondeterministicPrototype*>(slotBase))
299             return reportDeprecatedGetterError(*state, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
300         return throwGetterTypeError(*state, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
301     }
302 #if ENABLE(WEB_REPLAY)
303     JSGlobalObject* globalObject = state->lexicalGlobalObject();
304     InputCursor& cursor = globalObject->inputCursor();
305     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicSetterExceptionAttr", AtomicString::ConstructFromLiteral);
306     if (cursor.isCapturing()) {
307         String memoizedResult = castedThis->wrapped().nondeterministicSetterExceptionAttr();
308         cursor.appendInput<MemoizedDOMResult<String>>(bindingName.get().string(), memoizedResult, 0);
309         JSValue result = jsStringWithCache(state, memoizedResult);
310         return JSValue::encode(result);
311     }
312
313     if (cursor.isReplaying()) {
314         String memoizedResult;
315         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
316         if (input && input->convertTo<String>(memoizedResult)) {
317             JSValue result = jsStringWithCache(state, memoizedResult);
318             return JSValue::encode(result);
319         }
320     }
321 #endif
322     auto& impl = castedThis->wrapped();
323     JSValue result = jsStringWithCache(state, impl.nondeterministicSetterExceptionAttr());
324     return JSValue::encode(result);
325 }
326
327
328 EncodedJSValue jsTestNondeterministicConstructor(ExecState* state, JSObject* baseValue, EncodedJSValue, PropertyName)
329 {
330     JSTestNondeterministicPrototype* domObject = jsDynamicCast<JSTestNondeterministicPrototype*>(baseValue);
331     if (!domObject)
332         return throwVMTypeError(state);
333     return JSValue::encode(JSTestNondeterministic::getConstructor(state->vm(), domObject->globalObject()));
334 }
335
336 void setJSTestNondeterministicNondeterministicWriteableAttr(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
337 {
338     JSValue value = JSValue::decode(encodedValue);
339     UNUSED_PARAM(baseObject);
340     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
341     if (UNLIKELY(!castedThis)) {
342         if (jsDynamicCast<JSTestNondeterministicPrototype*>(JSValue::decode(thisValue)))
343             reportDeprecatedSetterError(*state, "TestNondeterministic", "nondeterministicWriteableAttr");
344         else
345             throwSetterTypeError(*state, "TestNondeterministic", "nondeterministicWriteableAttr");
346         return;
347     }
348     auto& impl = castedThis->wrapped();
349     String nativeValue = value.toString(state)->value(state);
350     if (UNLIKELY(state->hadException()))
351         return;
352     impl.setNondeterministicWriteableAttr(nativeValue);
353 }
354
355
356 void setJSTestNondeterministicNondeterministicExceptionAttr(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
357 {
358     JSValue value = JSValue::decode(encodedValue);
359     UNUSED_PARAM(baseObject);
360     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
361     if (UNLIKELY(!castedThis)) {
362         if (jsDynamicCast<JSTestNondeterministicPrototype*>(JSValue::decode(thisValue)))
363             reportDeprecatedSetterError(*state, "TestNondeterministic", "nondeterministicExceptionAttr");
364         else
365             throwSetterTypeError(*state, "TestNondeterministic", "nondeterministicExceptionAttr");
366         return;
367     }
368     auto& impl = castedThis->wrapped();
369     String nativeValue = value.toString(state)->value(state);
370     if (UNLIKELY(state->hadException()))
371         return;
372     impl.setNondeterministicExceptionAttr(nativeValue);
373 }
374
375
376 void setJSTestNondeterministicNondeterministicGetterExceptionAttr(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
377 {
378     JSValue value = JSValue::decode(encodedValue);
379     UNUSED_PARAM(baseObject);
380     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
381     if (UNLIKELY(!castedThis)) {
382         if (jsDynamicCast<JSTestNondeterministicPrototype*>(JSValue::decode(thisValue)))
383             reportDeprecatedSetterError(*state, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
384         else
385             throwSetterTypeError(*state, "TestNondeterministic", "nondeterministicGetterExceptionAttr");
386         return;
387     }
388     auto& impl = castedThis->wrapped();
389     String nativeValue = value.toString(state)->value(state);
390     if (UNLIKELY(state->hadException()))
391         return;
392     impl.setNondeterministicGetterExceptionAttr(nativeValue);
393 }
394
395
396 void setJSTestNondeterministicNondeterministicSetterExceptionAttr(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
397 {
398     JSValue value = JSValue::decode(encodedValue);
399     UNUSED_PARAM(baseObject);
400     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(JSValue::decode(thisValue));
401     if (UNLIKELY(!castedThis)) {
402         if (jsDynamicCast<JSTestNondeterministicPrototype*>(JSValue::decode(thisValue)))
403             reportDeprecatedSetterError(*state, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
404         else
405             throwSetterTypeError(*state, "TestNondeterministic", "nondeterministicSetterExceptionAttr");
406         return;
407     }
408     auto& impl = castedThis->wrapped();
409     ExceptionCode ec = 0;
410     String nativeValue = value.toString(state)->value(state);
411     if (UNLIKELY(state->hadException()))
412         return;
413     impl.setNondeterministicSetterExceptionAttr(nativeValue, ec);
414     setDOMException(state, ec);
415 }
416
417
418 JSValue JSTestNondeterministic::getConstructor(VM& vm, JSGlobalObject* globalObject)
419 {
420     return getDOMConstructor<JSTestNondeterministicConstructor>(vm, *jsCast<JSDOMGlobalObject*>(globalObject));
421 }
422
423 EncodedJSValue JSC_HOST_CALL jsTestNondeterministicPrototypeFunctionNondeterministicZeroArgFunction(ExecState* state)
424 {
425     JSValue thisValue = state->thisValue();
426     JSTestNondeterministic* castedThis = jsDynamicCast<JSTestNondeterministic*>(thisValue);
427     if (UNLIKELY(!castedThis))
428         return throwThisTypeError(*state, "TestNondeterministic", "nondeterministicZeroArgFunction");
429     ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestNondeterministic::info());
430     auto& impl = castedThis->wrapped();
431     JSValue result;
432 #if ENABLE(WEB_REPLAY)
433     InputCursor& cursor = state->lexicalGlobalObject()->inputCursor();
434     static NeverDestroyed<const AtomicString> bindingName("TestNondeterministic.nondeterministicZeroArgFunction", AtomicString::ConstructFromLiteral);
435     if (cursor.isCapturing()) {
436         bool memoizedResult = impl.nondeterministicZeroArgFunction();
437         cursor.appendInput<MemoizedDOMResult<bool>>(bindingName.get().string(), memoizedResult, 0);
438         result = jsBoolean(memoizedResult);
439     } else if (cursor.isReplaying()) {
440         MemoizedDOMResultBase* input = cursor.fetchInput<MemoizedDOMResultBase>();
441         bool memoizedResult;
442         if (input && input->convertTo<bool>(memoizedResult)) {
443             result = jsBoolean(memoizedResult);
444         } else
445             result = jsBoolean(impl.nondeterministicZeroArgFunction());
446     } else
447         result = jsBoolean(impl.nondeterministicZeroArgFunction());
448 #else
449     result = jsBoolean(impl.nondeterministicZeroArgFunction());
450 #endif
451     return JSValue::encode(result);
452 }
453
454 bool JSTestNondeterministicOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
455 {
456     UNUSED_PARAM(handle);
457     UNUSED_PARAM(visitor);
458     return false;
459 }
460
461 void JSTestNondeterministicOwner::finalize(JSC::Handle<JSC::Unknown> handle, void* context)
462 {
463     auto* jsTestNondeterministic = jsCast<JSTestNondeterministic*>(handle.slot()->asCell());
464     auto& world = *static_cast<DOMWrapperWorld*>(context);
465     uncacheWrapper(world, &jsTestNondeterministic->wrapped(), jsTestNondeterministic);
466 }
467
468 #if ENABLE(BINDING_INTEGRITY)
469 #if PLATFORM(WIN)
470 #pragma warning(disable: 4483)
471 extern "C" { extern void (*const __identifier("??_7TestNondeterministic@WebCore@@6B@")[])(); }
472 #else
473 extern "C" { extern void* _ZTVN7WebCore20TestNondeterministicE[]; }
474 #endif
475 #endif
476
477 JSC::JSValue toJSNewlyCreated(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic* impl)
478 {
479     if (!impl)
480         return jsNull();
481     return createNewWrapper<JSTestNondeterministic>(globalObject, impl);
482 }
483
484 JSC::JSValue toJS(JSC::ExecState*, JSDOMGlobalObject* globalObject, TestNondeterministic* impl)
485 {
486     if (!impl)
487         return jsNull();
488     if (JSValue result = getExistingWrapper<JSTestNondeterministic>(globalObject, impl))
489         return result;
490
491 #if ENABLE(BINDING_INTEGRITY)
492     void* actualVTablePointer = *(reinterpret_cast<void**>(impl));
493 #if PLATFORM(WIN)
494     void* expectedVTablePointer = reinterpret_cast<void*>(__identifier("??_7TestNondeterministic@WebCore@@6B@"));
495 #else
496     void* expectedVTablePointer = &_ZTVN7WebCore20TestNondeterministicE[2];
497 #if COMPILER(CLANG)
498     // If this fails TestNondeterministic does not have a vtable, so you need to add the
499     // ImplementationLacksVTable attribute to the interface definition
500     COMPILE_ASSERT(__is_polymorphic(TestNondeterministic), TestNondeterministic_is_not_polymorphic);
501 #endif
502 #endif
503     // If you hit this assertion you either have a use after free bug, or
504     // TestNondeterministic has subclasses. If TestNondeterministic has subclasses that get passed
505     // to toJS() we currently require TestNondeterministic you to opt out of binding hardening
506     // by adding the SkipVTableValidation attribute to the interface IDL definition
507     RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer);
508 #endif
509     return createNewWrapper<JSTestNondeterministic>(globalObject, impl);
510 }
511
512 TestNondeterministic* JSTestNondeterministic::toWrapped(JSC::JSValue value)
513 {
514     if (auto* wrapper = jsDynamicCast<JSTestNondeterministic*>(value))
515         return &wrapper->wrapped();
516     return nullptr;
517 }
518
519 }