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