Bug Summary

File:var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h
Warning:line 322, column 11
Assigned value is garbage or undefined

Annotated Source Code

Press '?' to see keyboard shortcuts

clang -cc1 -cc1 -triple x86_64-pc-linux-gnu -analyze -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name TestJSImplGenBinding.cpp -analyzer-checker=core -analyzer-checker=apiModeling -analyzer-checker=unix -analyzer-checker=deadcode -analyzer-checker=cplusplus -analyzer-checker=security.insecureAPI.UncheckedReturn -analyzer-checker=security.insecureAPI.getpw -analyzer-checker=security.insecureAPI.gets -analyzer-checker=security.insecureAPI.mktemp -analyzer-checker=security.insecureAPI.mkstemp -analyzer-checker=security.insecureAPI.vfork -analyzer-checker=nullability.NullPassedToNonnull -analyzer-checker=nullability.NullReturnedFromNonnull -analyzer-output plist -w -setup-static-analyzer -analyzer-config-compatibility-mode=true -mrelocation-model pic -pic-level 2 -fhalf-no-semantic-interposition -mframe-pointer=all -relaxed-aliasing -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debugger-tuning=gdb -fdebug-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -fcoverage-compilation-dir=/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -resource-dir /usr/lib/llvm-19/lib/clang/19 -include /var/lib/jenkins/workspace/firefox-scan-build/config/gcc_hidden.h -include /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/mozilla-config.h -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/stl_wrappers -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/system_wrappers -U _FORTIFY_SOURCE -D _FORTIFY_SOURCE=2 -D DEBUG=1 -D IMPL_LIBXUL -D MOZILLA_INTERNAL_API -I /var/lib/jenkins/workspace/firefox-scan-build/dom/bindings/test -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings/test -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dom/bindings -I /var/lib/jenkins/workspace/firefox-scan-build/dom/bindings -I /var/lib/jenkins/workspace/firefox-scan-build/js/xpconnect/src -I /var/lib/jenkins/workspace/firefox-scan-build/js/xpconnect/wrappers -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/ipc/ipdl/_ipdlheaders -I /var/lib/jenkins/workspace/firefox-scan-build/ipc/chromium/src -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nspr -I /var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/nss -D MOZILLA_CLIENT -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/x86_64-linux-gnu/c++/14 -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../include/c++/14/backward -internal-isystem /usr/lib/llvm-19/lib/clang/19/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/14/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O0 -Wno-error=tautological-type-limit-compare -Wno-invalid-offsetof -Wno-range-loop-analysis -Wno-deprecated-anon-enum-enum-conversion -Wno-deprecated-enum-enum-conversion -Wno-deprecated-this-capture -Wno-inline-new-delete -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wno-error=atomic-alignment -Wno-error=deprecated-builtins -Wno-psabi -Wno-error=builtin-macro-redefined -Wno-vla-cxx-extension -Wno-unknown-warning-option -fdeprecated-macro -ferror-limit 19 -fstrict-flex-arrays=1 -stack-protector 2 -fstack-clash-protection -ftrivial-auto-var-init=pattern -fno-rtti -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fno-sized-deallocation -fno-aligned-allocation -analyzer-checker optin.performance.Padding -analyzer-output=html -analyzer-config stable-report-filename=true -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/scan-build-2024-09-22-115206-3586786-1 -x c++ ../TestJSImplGenBinding.cpp

../TestJSImplGenBinding.cpp

1/* THIS FILE IS AUTOGENERATED FROM TestJSImplGen.webidl BY Codegen.py - DO NOT EDIT */
2
3#include <type_traits>
4#include "AtomList.h"
5#include "CustomEventBinding.h"
6#include "EventBinding.h"
7#include "EventHandlerBinding.h"
8#include "MainThreadUtils.h"
9#include "TestBindingHeader.h"
10#include "TestCImplementedInterface.h"
11#include "TestCodeGenBinding.h"
12#include "TestDictionaryBinding.h"
13#include "TestJSImplGenBinding.h"
14#include "WrapperFactory.h"
15#include "js/Array.h"
16#include "js/CallAndConstruct.h"
17#include "js/Exception.h"
18#include "js/ForOfIterator.h"
19#include "js/MapAndSet.h"
20#include "js/Object.h"
21#include "js/PropertyAndElement.h"
22#include "js/PropertyDescriptor.h"
23#include "js/experimental/JitInfo.h"
24#include "jsapi.h"
25#include "jsfriendapi.h"
26#include "mozilla/Atomics.h"
27#include "mozilla/FloatingPoint.h"
28#include "mozilla/OwningNonNull.h"
29#include "mozilla/ProfilerLabels.h"
30#include "mozilla/dom/BindingCallContext.h"
31#include "mozilla/dom/BindingUtils.h"
32#include "mozilla/dom/CanvasGradient.h"
33#include "mozilla/dom/CanvasPattern.h"
34#include "mozilla/dom/CustomElementRegistry.h"
35#include "mozilla/dom/DOMJSClass.h"
36#include "mozilla/dom/DocGroup.h"
37#include "mozilla/dom/Document.h"
38#include "mozilla/dom/ImageData.h"
39#include "mozilla/dom/NonRefcountedDOMObject.h"
40#include "mozilla/dom/Nullable.h"
41#include "mozilla/dom/PrimitiveConversions.h"
42#include "mozilla/dom/Promise.h"
43#include "mozilla/dom/RootedDictionary.h"
44#include "mozilla/dom/ToJSValue.h"
45#include "mozilla/dom/UnionTypes.h"
46#include "mozilla/dom/WebIDLPrefs.h"
47#include "mozilla/dom/XrayExpandoClass.h"
48#include "nsContentUtils.h"
49#include "nsGenericHTMLElement.h"
50#include "nsIContent.h"
51#include "nsIGlobalObject.h"
52
53namespace mozilla {
54
55namespace dom {
56
57namespace binding_detail {}; // Just to make sure it's known as a namespace
58using namespace mozilla::dom::binding_detail;
59
60
61namespace binding_detail {
62constexpr nsLiteralCString EnumStrings<MyTestEnum>::Values[2];
63} // namespace binding_detail
64
65bool
66ToJSValue(JSContext* aCx, MyTestEnum aArgument, JS::MutableHandle<JS::Value> aValue)
67{
68 MOZ_ASSERT(uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(uint32_t(aArgument) < ArrayLength(binding_detail::
EnumStrings<MyTestEnum>::Values))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(uint32_t(aArgument) < ArrayLength
(binding_detail::EnumStrings<MyTestEnum>::Values)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values)"
, "../TestJSImplGenBinding.cpp", 68); AnnotateMozCrashReason(
"MOZ_ASSERT" "(" "uint32_t(aArgument) < ArrayLength(binding_detail::EnumStrings<MyTestEnum>::Values)"
")"); do { *((volatile int*)__null) = 68; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
69 JSString* resultStr =
70 JS_NewStringCopyN(aCx, binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].BeginReading(),
71 binding_detail::EnumStrings<MyTestEnum>::Values[uint32_t(aArgument)].Length());
72 if (!resultStr) {
73 return false;
74 }
75 aValue.setString(resultStr);
76 return true;
77}
78
79
80MOZ_CAN_RUN_SCRIPT void
81MyTestCallback::Call(BindingCallContext& cx, JS::Handle<JS::Value> aThisVal, ErrorResult& aRv)
82{
83 JS::Rooted<JS::Value> rval(cx);
84
85 JS::Rooted<JS::Value> callable(cx, JS::ObjectValue(*mCallback));
86 if (!JS::Call(cx, aThisVal, callable,
87 JS::HandleValueArray::empty(), &rval)) {
88 aRv.NoteJSContextException(cx);
89 return;
90 }
91}
92
93
94
95namespace TestCImplementedInterface_Binding {
96
97static_assert(IsRefcounted<NativeType>::value == IsRefcounted<TestJSImplInterface_Binding::NativeType>::value,
98 "Can't inherit from an interface with a different ownership model.");
99
100bool sNativePropertiesInited = false;
101const NativePropertyHooks sNativePropertyHooks = {
102 nullptr,
103 { nullptr, nullptr, &sNativePropertiesInited },
104 prototypes::id::TestCImplementedInterface,
105 constructors::id::TestCImplementedInterface,
106 &DefaultXrayExpandoObjectClass
107};
108
109static const DOMInterfaceInfo sInterfaceObjectInfo = {
110 { ThrowingConstructor, &sNativePropertyHooks },
111 TestJSImplInterface_Binding::GetConstructorObjectHandle,
112 prototypes::id::TestCImplementedInterface,
113 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
114 true,
115};
116
117static const DOMIfaceAndProtoJSClass sPrototypeClass = {
118 {
119 "TestCImplementedInterfacePrototype",
120 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
121 JS_NULL_CLASS_OPS,
122 JS_NULL_CLASS_SPEC,
123 JS_NULL_CLASS_EXT,
124 JS_NULL_OBJECT_OPS
125 },
126 eInterfacePrototype,
127 prototypes::id::TestCImplementedInterface,
128 PrototypeTraits<prototypes::id::TestCImplementedInterface>::Depth,
129 &sNativePropertyHooks,
130 TestJSImplInterface_Binding::GetProtoObject
131};
132
133void
134CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
135{
136 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface);
137 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface);
138
139 JS::Handle<JSObject*> parentProto(TestJSImplInterface_Binding::GetProtoObjectHandle(aCx));
140 if (!parentProto) {
141 return;
142 }
143
144 JS::Handle<JSObject*> constructorProto(TestJSImplInterface_Binding::GetConstructorObjectHandle(aCx));
145 if (!constructorProto) {
146 return;
147 }
148
149 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
150 &sPrototypeClass, protoCache,
151 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
152 interfaceCache,
153 nullptr,
154 nullptr,
155 "TestCImplementedInterface",
156 aDefineOnGlobal != DefineInterfaceProperty::No,
157 nullptr,
158 false,
159 nullptr);
160}
161
162JS::Handle<JSObject*>
163GetProtoObjectHandle(JSContext* aCx)
164{
165 /* Get the interface prototype object for this class. This will create the
166 object as needed. */
167 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestCImplementedInterface,
168 &CreateInterfaceObjects,
169 DefineInterfaceProperty::CheckExposure);
170
171}
172
173JSObject*
174GetProtoObject(JSContext* aCx)
175{
176 return GetProtoObjectHandle(aCx);
177}
178
179JS::Handle<JSObject*>
180GetConstructorObjectHandle(JSContext* aCx)
181{
182 /* Get the interface object for this class. This will create the object as
183 needed. */
184
185 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestCImplementedInterface,
186 &CreateInterfaceObjects,
187 DefineInterfaceProperty::CheckExposure);
188}
189
190} // namespace TestCImplementedInterface_Binding
191
192
193
194namespace TestCImplementedInterface2_Binding {
195
196bool sNativePropertiesInited = false;
197const NativePropertyHooks sNativePropertyHooks = {
198 nullptr,
199 { nullptr, nullptr, &sNativePropertiesInited },
200 prototypes::id::TestCImplementedInterface2,
201 constructors::id::TestCImplementedInterface2,
202 &DefaultXrayExpandoObjectClass
203};
204
205static const DOMInterfaceInfo sInterfaceObjectInfo = {
206 { ThrowingConstructor, &sNativePropertyHooks },
207 JS::GetRealmFunctionPrototypeHandle,
208 prototypes::id::TestCImplementedInterface2,
209 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
210 true,
211};
212
213static const DOMIfaceAndProtoJSClass sPrototypeClass = {
214 {
215 "TestCImplementedInterface2Prototype",
216 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
217 JS_NULL_CLASS_OPS,
218 JS_NULL_CLASS_SPEC,
219 JS_NULL_CLASS_EXT,
220 JS_NULL_OBJECT_OPS
221 },
222 eInterfacePrototype,
223 prototypes::id::TestCImplementedInterface2,
224 PrototypeTraits<prototypes::id::TestCImplementedInterface2>::Depth,
225 &sNativePropertyHooks,
226 JS::GetRealmObjectPrototype
227};
228
229void
230CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
231{
232 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestCImplementedInterface2);
233 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestCImplementedInterface2);
234
235 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
236 if (!parentProto) {
237 return;
238 }
239
240 JS::Handle<JSObject*> constructorProto(JS::GetRealmFunctionPrototypeHandle(aCx));
241 if (!constructorProto) {
242 return;
243 }
244
245 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
246 &sPrototypeClass, protoCache,
247 constructorProto, &sInterfaceObjectInfo, 0, false, Span<const LegacyFactoryFunction, 0>{},
248 interfaceCache,
249 nullptr,
250 nullptr,
251 "TestCImplementedInterface2",
252 aDefineOnGlobal != DefineInterfaceProperty::No,
253 nullptr,
254 false,
255 nullptr);
256}
257
258JS::Handle<JSObject*>
259GetProtoObjectHandle(JSContext* aCx)
260{
261 /* Get the interface prototype object for this class. This will create the
262 object as needed. */
263 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestCImplementedInterface2,
264 &CreateInterfaceObjects,
265 DefineInterfaceProperty::CheckExposure);
266
267}
268
269JSObject*
270GetProtoObject(JSContext* aCx)
271{
272 return GetProtoObjectHandle(aCx);
273}
274
275JS::Handle<JSObject*>
276GetConstructorObjectHandle(JSContext* aCx)
277{
278 /* Get the interface object for this class. This will create the object as
279 needed. */
280
281 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestCImplementedInterface2,
282 &CreateInterfaceObjects,
283 DefineInterfaceProperty::CheckExposure);
284}
285
286} // namespace TestCImplementedInterface2_Binding
287
288
289
290namespace TestJSImplInterface_Binding {
291
292MOZ_CAN_RUN_SCRIPT static bool
293get_readonlyByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
294{
295 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject298( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
296 "TestJSImplInterface", "readonlyByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject298( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
297 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject298( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
298 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject298( cx, "TestJSImplInterface"
, "readonlyByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
299
300 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
301 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
302 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
303 if (objIsXray) {
304 unwrappedObj.emplace(cx, obj);
305 }
306 if (objIsXray) {
307 // Since our object is an Xray, we can just CheckedUnwrapStatic:
308 // we know Xrays have no dynamic unwrap behavior.
309 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
310 if (!unwrappedObj.ref()) {
311 return false;
312 }
313 }
314 FastErrorResult rv;
315 int8_t result(MOZ_KnownLive(self)(self)->GetReadonlyByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyByte getter"
)), 0))
) {
317 return false;
318 }
319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 319; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
320 args.rval().setInt32(int32_t(result));
321 return true;
322}
323
324static const JSJitInfo readonlyByte_getterinfo = {
325 { get_readonlyByte },
326 { prototypes::id::TestJSImplInterface },
327 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
328 JSJitInfo::Getter,
329 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
330 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
331 false, /* isInfallible. False in setters. */
332 false, /* isMovable. Not relevant for setters. */
333 false, /* isEliminatable. Not relevant for setters. */
334 false, /* isAlwaysInSlot. Only relevant for getters. */
335 false, /* isLazilyCachedInSlot. Only relevant for getters. */
336 false, /* isTypedMethod. Only relevant for methods. */
337 0 /* Reserved slot index, if we're stored in a slot, else 0. */
338};
339
340MOZ_CAN_RUN_SCRIPT static bool
341get_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
342{
343 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject346( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
344 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject346( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
345 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject346( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
346 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject346( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
347
348 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
349 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
350 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
351 if (objIsXray) {
352 unwrappedObj.emplace(cx, obj);
353 }
354 if (objIsXray) {
355 // Since our object is an Xray, we can just CheckedUnwrapStatic:
356 // we know Xrays have no dynamic unwrap behavior.
357 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
358 if (!unwrappedObj.ref()) {
359 return false;
360 }
361 }
362 FastErrorResult rv;
363 int8_t result(MOZ_KnownLive(self)(self)->GetWritableByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
364 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte getter"
)), 0))
) {
365 return false;
366 }
367 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 367; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
368 args.rval().setInt32(int32_t(result));
369 return true;
370}
371
372MOZ_CAN_RUN_SCRIPT static bool
373set_writableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
374{
375 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject378( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
376 "TestJSImplInterface", "writableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject378( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
377 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject378( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
378 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject378( cx, "TestJSImplInterface"
, "writableByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
379
380 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
381 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
382 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
383 if (objIsXray) {
384 unwrappedObj.emplace(cx, obj);
385 }
386 int8_t arg0;
387 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
388 return false;
389 }
390 if (objIsXray) {
391 // Since our object is an Xray, we can just CheckedUnwrapStatic:
392 // we know Xrays have no dynamic unwrap behavior.
393 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
394 if (!unwrappedObj.ref()) {
395 return false;
396 }
397 }
398 FastErrorResult rv;
399 // NOTE: This assert does NOT call the function.
400 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
401 MOZ_KnownLive(self)(self)->SetWritableByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
402 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableByte setter"
)), 0))
) {
403 return false;
404 }
405 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 405; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
406
407 return true;
408}
409
410static const JSJitInfo writableByte_getterinfo = {
411 { get_writableByte },
412 { prototypes::id::TestJSImplInterface },
413 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
414 JSJitInfo::Getter,
415 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
416 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
417 false, /* isInfallible. False in setters. */
418 false, /* isMovable. Not relevant for setters. */
419 false, /* isEliminatable. Not relevant for setters. */
420 false, /* isAlwaysInSlot. Only relevant for getters. */
421 false, /* isLazilyCachedInSlot. Only relevant for getters. */
422 false, /* isTypedMethod. Only relevant for methods. */
423 0 /* Reserved slot index, if we're stored in a slot, else 0. */
424};
425static const JSJitInfo writableByte_setterinfo = {
426 { (JSJitGetterOp)set_writableByte },
427 { prototypes::id::TestJSImplInterface },
428 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
429 JSJitInfo::Setter,
430 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
431 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
432 false, /* isInfallible. False in setters. */
433 false, /* isMovable. Not relevant for setters. */
434 false, /* isEliminatable. Not relevant for setters. */
435 false, /* isAlwaysInSlot. Only relevant for getters. */
436 false, /* isLazilyCachedInSlot. Only relevant for getters. */
437 false, /* isTypedMethod. Only relevant for methods. */
438 0 /* Reserved slot index, if we're stored in a slot, else 0. */
439};
440
441MOZ_CAN_RUN_SCRIPT static bool
442passByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
443{
444 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject447( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
445 "TestJSImplInterface", "passByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject447( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
446 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject447( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
447 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject447( cx, "TestJSImplInterface"
, "passByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
448
449 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
450 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByte", 1)) {
451 return false;
452 }
453 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
454 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
455 if (objIsXray) {
456 unwrappedObj.emplace(cx, obj);
457 }
458 int8_t arg0;
459 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
460 return false;
461 }
462 if (objIsXray) {
463 // Since our object is an Xray, we can just CheckedUnwrapStatic:
464 // we know Xrays have no dynamic unwrap behavior.
465 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
466 if (!unwrappedObj.ref()) {
467 return false;
468 }
469 }
470 FastErrorResult rv;
471 // NOTE: This assert does NOT call the function.
472 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
473 MOZ_KnownLive(self)(self)->PassByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
474 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByte"
)), 0))
) {
475 return false;
476 }
477 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 477); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 477; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
478 args.rval().setUndefined();
479 return true;
480}
481
482static const JSJitInfo passByte_methodinfo = {
483 { (JSJitGetterOp)passByte },
484 { prototypes::id::TestJSImplInterface },
485 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
486 JSJitInfo::Method,
487 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
488 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
489 false, /* isInfallible. False in setters. */
490 false, /* isMovable. Not relevant for setters. */
491 false, /* isEliminatable. Not relevant for setters. */
492 false, /* isAlwaysInSlot. Only relevant for getters. */
493 false, /* isLazilyCachedInSlot. Only relevant for getters. */
494 false, /* isTypedMethod. Only relevant for methods. */
495 0 /* Reserved slot index, if we're stored in a slot, else 0. */
496};
497
498MOZ_CAN_RUN_SCRIPT static bool
499receiveByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
500{
501 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject504( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
502 "TestJSImplInterface", "receiveByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject504( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
503 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject504( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
504 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject504( cx, "TestJSImplInterface"
, "receiveByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
505
506 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
507 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
508 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
509 if (objIsXray) {
510 unwrappedObj.emplace(cx, obj);
511 }
512 if (objIsXray) {
513 // Since our object is an Xray, we can just CheckedUnwrapStatic:
514 // we know Xrays have no dynamic unwrap behavior.
515 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
516 if (!unwrappedObj.ref()) {
517 return false;
518 }
519 }
520 FastErrorResult rv;
521 int8_t result(MOZ_KnownLive(self)(self)->ReceiveByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
522 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByte"
)), 0))
) {
523 return false;
524 }
525 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 525; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
526 args.rval().setInt32(int32_t(result));
527 return true;
528}
529
530static const JSJitInfo receiveByte_methodinfo = {
531 { (JSJitGetterOp)receiveByte },
532 { prototypes::id::TestJSImplInterface },
533 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
534 JSJitInfo::Method,
535 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
536 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
537 false, /* isInfallible. False in setters. */
538 false, /* isMovable. Not relevant for setters. */
539 false, /* isEliminatable. Not relevant for setters. */
540 false, /* isAlwaysInSlot. Only relevant for getters. */
541 false, /* isLazilyCachedInSlot. Only relevant for getters. */
542 false, /* isTypedMethod. Only relevant for methods. */
543 0 /* Reserved slot index, if we're stored in a slot, else 0. */
544};
545
546MOZ_CAN_RUN_SCRIPT static bool
547passOptionalByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
548{
549 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject552( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
550 "TestJSImplInterface", "passOptionalByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject552( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
551 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject552( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
552 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject552( cx, "TestJSImplInterface"
, "passOptionalByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
553
554 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
555 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
556 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
557 if (objIsXray) {
558 unwrappedObj.emplace(cx, obj);
559 }
560 Optional<int8_t> arg0;
561 if (args.hasDefined(0)) {
562 arg0.Construct();
563 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
564 return false;
565 }
566 }
567 if (objIsXray) {
568 // Since our object is an Xray, we can just CheckedUnwrapStatic:
569 // we know Xrays have no dynamic unwrap behavior.
570 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
571 if (!unwrappedObj.ref()) {
572 return false;
573 }
574 }
575 FastErrorResult rv;
576 // NOTE: This assert does NOT call the function.
577 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
578 MOZ_KnownLive(self)(self)->PassOptionalByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
579 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByte"
)), 0))
) {
580 return false;
581 }
582 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 582; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
583 args.rval().setUndefined();
584 return true;
585}
586
587static const JSJitInfo passOptionalByte_methodinfo = {
588 { (JSJitGetterOp)passOptionalByte },
589 { prototypes::id::TestJSImplInterface },
590 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
591 JSJitInfo::Method,
592 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
593 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
594 false, /* isInfallible. False in setters. */
595 false, /* isMovable. Not relevant for setters. */
596 false, /* isEliminatable. Not relevant for setters. */
597 false, /* isAlwaysInSlot. Only relevant for getters. */
598 false, /* isLazilyCachedInSlot. Only relevant for getters. */
599 false, /* isTypedMethod. Only relevant for methods. */
600 0 /* Reserved slot index, if we're stored in a slot, else 0. */
601};
602
603MOZ_CAN_RUN_SCRIPT static bool
604passOptionalByteBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
605{
606 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject609( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
607 "TestJSImplInterface", "passOptionalByteBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject609( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
608 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject609( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
609 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject609( cx, "TestJSImplInterface"
, "passOptionalByteBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
610
611 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
612 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteBeforeRequired", 2)) {
613 return false;
614 }
615 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
616 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
617 if (objIsXray) {
618 unwrappedObj.emplace(cx, obj);
619 }
620 Optional<int8_t> arg0;
621 if (args.hasDefined(0)) {
622 arg0.Construct();
623 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
624 return false;
625 }
626 }
627 int8_t arg1;
628 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
629 return false;
630 }
631 if (objIsXray) {
632 // Since our object is an Xray, we can just CheckedUnwrapStatic:
633 // we know Xrays have no dynamic unwrap behavior.
634 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
635 if (!unwrappedObj.ref()) {
636 return false;
637 }
638 }
639 FastErrorResult rv;
640 // NOTE: This assert does NOT call the function.
641 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
642 MOZ_KnownLive(self)(self)->PassOptionalByteBeforeRequired(Constify(arg0), arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
643 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteBeforeRequired"
)), 0))
) {
644 return false;
645 }
646 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 646); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 646; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
647 args.rval().setUndefined();
648 return true;
649}
650
651static const JSJitInfo passOptionalByteBeforeRequired_methodinfo = {
652 { (JSJitGetterOp)passOptionalByteBeforeRequired },
653 { prototypes::id::TestJSImplInterface },
654 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
655 JSJitInfo::Method,
656 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
657 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
658 false, /* isInfallible. False in setters. */
659 false, /* isMovable. Not relevant for setters. */
660 false, /* isEliminatable. Not relevant for setters. */
661 false, /* isAlwaysInSlot. Only relevant for getters. */
662 false, /* isLazilyCachedInSlot. Only relevant for getters. */
663 false, /* isTypedMethod. Only relevant for methods. */
664 0 /* Reserved slot index, if we're stored in a slot, else 0. */
665};
666
667MOZ_CAN_RUN_SCRIPT static bool
668passOptionalByteWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
669{
670 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject673( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
671 "TestJSImplInterface", "passOptionalByteWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject673( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
672 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject673( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
673 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject673( cx, "TestJSImplInterface"
, "passOptionalByteWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
674
675 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
676 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
677 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
678 if (objIsXray) {
679 unwrappedObj.emplace(cx, obj);
680 }
681 int8_t arg0;
682 if (args.hasDefined(0)) {
683 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
684 return false;
685 }
686 } else {
687 arg0 = 0;
688 }
689 if (objIsXray) {
690 // Since our object is an Xray, we can just CheckedUnwrapStatic:
691 // we know Xrays have no dynamic unwrap behavior.
692 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
693 if (!unwrappedObj.ref()) {
694 return false;
695 }
696 }
697 FastErrorResult rv;
698 // NOTE: This assert does NOT call the function.
699 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
700 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
701 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefault"
)), 0))
) {
702 return false;
703 }
704 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 704); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 704; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
705 args.rval().setUndefined();
706 return true;
707}
708
709static const JSJitInfo passOptionalByteWithDefault_methodinfo = {
710 { (JSJitGetterOp)passOptionalByteWithDefault },
711 { prototypes::id::TestJSImplInterface },
712 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
713 JSJitInfo::Method,
714 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
715 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
716 false, /* isInfallible. False in setters. */
717 false, /* isMovable. Not relevant for setters. */
718 false, /* isEliminatable. Not relevant for setters. */
719 false, /* isAlwaysInSlot. Only relevant for getters. */
720 false, /* isLazilyCachedInSlot. Only relevant for getters. */
721 false, /* isTypedMethod. Only relevant for methods. */
722 0 /* Reserved slot index, if we're stored in a slot, else 0. */
723};
724
725MOZ_CAN_RUN_SCRIPT static bool
726passOptionalByteWithDefaultBeforeRequired(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
727{
728 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject731( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
729 "TestJSImplInterface", "passOptionalByteWithDefaultBeforeRequired", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject731( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
730 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject731( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
731 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject731( cx, "TestJSImplInterface"
, "passOptionalByteWithDefaultBeforeRequired", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
732
733 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
734 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", 2)) {
735 return false;
736 }
737 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
738 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
739 if (objIsXray) {
740 unwrappedObj.emplace(cx, obj);
741 }
742 int8_t arg0;
743 if (args.hasDefined(0)) {
744 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
745 return false;
746 }
747 } else {
748 arg0 = 0;
749 }
750 int8_t arg1;
751 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
752 return false;
753 }
754 if (objIsXray) {
755 // Since our object is an Xray, we can just CheckedUnwrapStatic:
756 // we know Xrays have no dynamic unwrap behavior.
757 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
758 if (!unwrappedObj.ref()) {
759 return false;
760 }
761 }
762 FastErrorResult rv;
763 // NOTE: This assert does NOT call the function.
764 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
765 MOZ_KnownLive(self)(self)->PassOptionalByteWithDefaultBeforeRequired(arg0, arg1, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
766 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired"
)), 0))
) {
767 return false;
768 }
769 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 769); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 769; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
770 args.rval().setUndefined();
771 return true;
772}
773
774static const JSJitInfo passOptionalByteWithDefaultBeforeRequired_methodinfo = {
775 { (JSJitGetterOp)passOptionalByteWithDefaultBeforeRequired },
776 { prototypes::id::TestJSImplInterface },
777 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
778 JSJitInfo::Method,
779 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
780 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
781 false, /* isInfallible. False in setters. */
782 false, /* isMovable. Not relevant for setters. */
783 false, /* isEliminatable. Not relevant for setters. */
784 false, /* isAlwaysInSlot. Only relevant for getters. */
785 false, /* isLazilyCachedInSlot. Only relevant for getters. */
786 false, /* isTypedMethod. Only relevant for methods. */
787 0 /* Reserved slot index, if we're stored in a slot, else 0. */
788};
789
790MOZ_CAN_RUN_SCRIPT static bool
791passNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
792{
793 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject796( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
794 "TestJSImplInterface", "passNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject796( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
795 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject796( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
796 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject796( cx, "TestJSImplInterface"
, "passNullableByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
797
798 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
799 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByte", 1)) {
800 return false;
801 }
802 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
803 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
804 if (objIsXray) {
805 unwrappedObj.emplace(cx, obj);
806 }
807 Nullable<int8_t> arg0;
808 if (args[0].isNullOrUndefined()) {
809 arg0.SetNull();
810 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
811 return false;
812 }
813 if (objIsXray) {
814 // Since our object is an Xray, we can just CheckedUnwrapStatic:
815 // we know Xrays have no dynamic unwrap behavior.
816 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
817 if (!unwrappedObj.ref()) {
818 return false;
819 }
820 }
821 FastErrorResult rv;
822 // NOTE: This assert does NOT call the function.
823 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
824 MOZ_KnownLive(self)(self)->PassNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
825 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByte"
)), 0))
) {
826 return false;
827 }
828 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 828); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 828; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
829 args.rval().setUndefined();
830 return true;
831}
832
833static const JSJitInfo passNullableByte_methodinfo = {
834 { (JSJitGetterOp)passNullableByte },
835 { prototypes::id::TestJSImplInterface },
836 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
837 JSJitInfo::Method,
838 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
839 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
840 false, /* isInfallible. False in setters. */
841 false, /* isMovable. Not relevant for setters. */
842 false, /* isEliminatable. Not relevant for setters. */
843 false, /* isAlwaysInSlot. Only relevant for getters. */
844 false, /* isLazilyCachedInSlot. Only relevant for getters. */
845 false, /* isTypedMethod. Only relevant for methods. */
846 0 /* Reserved slot index, if we're stored in a slot, else 0. */
847};
848
849MOZ_CAN_RUN_SCRIPT static bool
850passOptionalNullableByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
851{
852 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject855( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
853 "TestJSImplInterface", "passOptionalNullableByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject855( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
854 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject855( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
855 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject855( cx, "TestJSImplInterface"
, "passOptionalNullableByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
856
857 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
858 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
859 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
860 if (objIsXray) {
861 unwrappedObj.emplace(cx, obj);
862 }
863 Optional<Nullable<int8_t>> arg0;
864 if (args.hasDefined(0)) {
865 arg0.Construct();
866 if (args[0].isNullOrUndefined()) {
867 arg0.Value().SetNull();
868 } else if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value().SetValue())) {
869 return false;
870 }
871 }
872 if (objIsXray) {
873 // Since our object is an Xray, we can just CheckedUnwrapStatic:
874 // we know Xrays have no dynamic unwrap behavior.
875 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
876 if (!unwrappedObj.ref()) {
877 return false;
878 }
879 }
880 FastErrorResult rv;
881 // NOTE: This assert does NOT call the function.
882 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
883 MOZ_KnownLive(self)(self)->PassOptionalNullableByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
884 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByte"
)), 0))
) {
885 return false;
886 }
887 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 887); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 887; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
888 args.rval().setUndefined();
889 return true;
890}
891
892static const JSJitInfo passOptionalNullableByte_methodinfo = {
893 { (JSJitGetterOp)passOptionalNullableByte },
894 { prototypes::id::TestJSImplInterface },
895 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
896 JSJitInfo::Method,
897 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
898 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
899 false, /* isInfallible. False in setters. */
900 false, /* isMovable. Not relevant for setters. */
901 false, /* isEliminatable. Not relevant for setters. */
902 false, /* isAlwaysInSlot. Only relevant for getters. */
903 false, /* isLazilyCachedInSlot. Only relevant for getters. */
904 false, /* isTypedMethod. Only relevant for methods. */
905 0 /* Reserved slot index, if we're stored in a slot, else 0. */
906};
907
908MOZ_CAN_RUN_SCRIPT static bool
909passVariadicByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
910{
911 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject914( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
912 "TestJSImplInterface", "passVariadicByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject914( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
913 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject914( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
914 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject914( cx, "TestJSImplInterface"
, "passVariadicByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
915
916 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
917 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
918 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
919 if (objIsXray) {
920 unwrappedObj.emplace(cx, obj);
921 }
922 AutoSequence<int8_t> arg0;
923 if (args.length() > 0) {
924 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
925 JS_ReportOutOfMemory(cx);
926 return false;
927 }
928 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
929 // OK to do infallible append here, since we ensured capacity already.
930 int8_t& slot = *arg0.AppendElement();
931 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[variadicArg], "Argument 1", &slot)) {
932 return false;
933 }
934 }
935 }
936 if (objIsXray) {
937 // Since our object is an Xray, we can just CheckedUnwrapStatic:
938 // we know Xrays have no dynamic unwrap behavior.
939 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
940 if (!unwrappedObj.ref()) {
941 return false;
942 }
943 }
944 FastErrorResult rv;
945 // NOTE: This assert does NOT call the function.
946 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
947 MOZ_KnownLive(self)(self)->PassVariadicByte(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
948 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByte"
)), 0))
) {
949 return false;
950 }
951 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 951); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 951; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
952 args.rval().setUndefined();
953 return true;
954}
955
956static const JSJitInfo passVariadicByte_methodinfo = {
957 { (JSJitGetterOp)passVariadicByte },
958 { prototypes::id::TestJSImplInterface },
959 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
960 JSJitInfo::Method,
961 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
962 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
963 false, /* isInfallible. False in setters. */
964 false, /* isMovable. Not relevant for setters. */
965 false, /* isEliminatable. Not relevant for setters. */
966 false, /* isAlwaysInSlot. Only relevant for getters. */
967 false, /* isLazilyCachedInSlot. Only relevant for getters. */
968 false, /* isTypedMethod. Only relevant for methods. */
969 0 /* Reserved slot index, if we're stored in a slot, else 0. */
970};
971
972MOZ_CAN_RUN_SCRIPT static bool
973get_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
974{
975 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject978( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
976 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject978( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
977 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject978( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
978 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject978( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
979
980 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
981 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
982 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
983 if (objIsXray) {
984 unwrappedObj.emplace(cx, obj);
985 }
986 if (objIsXray) {
987 // Since our object is an Xray, we can just CheckedUnwrapStatic:
988 // we know Xrays have no dynamic unwrap behavior.
989 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
990 if (!unwrappedObj.ref()) {
991 return false;
992 }
993 }
994 FastErrorResult rv;
995 int8_t result(MOZ_KnownLive(self)(self)->GetSideEffectFreeByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
996 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte getter"
)), 0))
) {
997 return false;
998 }
999 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 999); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 999; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1000 args.rval().setInt32(int32_t(result));
1001 return true;
1002}
1003
1004MOZ_CAN_RUN_SCRIPT static bool
1005set_sideEffectFreeByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1006{
1007 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1010( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1008 "TestJSImplInterface", "sideEffectFreeByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1010( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1009 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1010( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1010 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1010( cx, "TestJSImplInterface"
, "sideEffectFreeByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1011
1012 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1013 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1014 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1015 if (objIsXray) {
1016 unwrappedObj.emplace(cx, obj);
1017 }
1018 int8_t arg0;
1019 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1020 return false;
1021 }
1022 if (objIsXray) {
1023 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1024 // we know Xrays have no dynamic unwrap behavior.
1025 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1026 if (!unwrappedObj.ref()) {
1027 return false;
1028 }
1029 }
1030 FastErrorResult rv;
1031 // NOTE: This assert does NOT call the function.
1032 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1033 MOZ_KnownLive(self)(self)->SetSideEffectFreeByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1034 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.sideEffectFreeByte setter"
)), 0))
) {
1035 return false;
1036 }
1037 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1037); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1037; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1038
1039 return true;
1040}
1041
1042static const JSJitInfo sideEffectFreeByte_getterinfo = {
1043 { get_sideEffectFreeByte },
1044 { prototypes::id::TestJSImplInterface },
1045 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1046 JSJitInfo::Getter,
1047 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1048 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1049 false, /* isInfallible. False in setters. */
1050 false, /* isMovable. Not relevant for setters. */
1051 false, /* isEliminatable. Not relevant for setters. */
1052 false, /* isAlwaysInSlot. Only relevant for getters. */
1053 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1054 false, /* isTypedMethod. Only relevant for methods. */
1055 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1056};
1057static const JSJitInfo sideEffectFreeByte_setterinfo = {
1058 { (JSJitGetterOp)set_sideEffectFreeByte },
1059 { prototypes::id::TestJSImplInterface },
1060 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1061 JSJitInfo::Setter,
1062 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1063 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1064 false, /* isInfallible. False in setters. */
1065 false, /* isMovable. Not relevant for setters. */
1066 false, /* isEliminatable. Not relevant for setters. */
1067 false, /* isAlwaysInSlot. Only relevant for getters. */
1068 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1069 false, /* isTypedMethod. Only relevant for methods. */
1070 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1071};
1072
1073MOZ_CAN_RUN_SCRIPT static bool
1074get_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1075{
1076 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1079( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1077 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1079( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1078 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1079( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1079 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1079( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1080
1081 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1082 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1083 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1084 if (objIsXray) {
1085 unwrappedObj.emplace(cx, obj);
1086 }
1087 if (objIsXray) {
1088 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1089 // we know Xrays have no dynamic unwrap behavior.
1090 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1091 if (!unwrappedObj.ref()) {
1092 return false;
1093 }
1094 }
1095 FastErrorResult rv;
1096 int8_t result(MOZ_KnownLive(self)(self)->GetDomDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1097 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte getter"
)), 0))
) {
1098 return false;
1099 }
1100 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1100); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1100; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1101 args.rval().setInt32(int32_t(result));
1102 return true;
1103}
1104
1105MOZ_CAN_RUN_SCRIPT static bool
1106set_domDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1107{
1108 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1111( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1109 "TestJSImplInterface", "domDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1111( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1110 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1111( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1111 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1111( cx, "TestJSImplInterface"
, "domDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1112
1113 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1114 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1115 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1116 if (objIsXray) {
1117 unwrappedObj.emplace(cx, obj);
1118 }
1119 int8_t arg0;
1120 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1121 return false;
1122 }
1123 if (objIsXray) {
1124 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1125 // we know Xrays have no dynamic unwrap behavior.
1126 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1127 if (!unwrappedObj.ref()) {
1128 return false;
1129 }
1130 }
1131 FastErrorResult rv;
1132 // NOTE: This assert does NOT call the function.
1133 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1134 MOZ_KnownLive(self)(self)->SetDomDependentByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1135 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.domDependentByte setter"
)), 0))
) {
1136 return false;
1137 }
1138 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1138); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1138; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1139
1140 return true;
1141}
1142
1143static const JSJitInfo domDependentByte_getterinfo = {
1144 { get_domDependentByte },
1145 { prototypes::id::TestJSImplInterface },
1146 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1147 JSJitInfo::Getter,
1148 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1149 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1150 false, /* isInfallible. False in setters. */
1151 false, /* isMovable. Not relevant for setters. */
1152 false, /* isEliminatable. Not relevant for setters. */
1153 false, /* isAlwaysInSlot. Only relevant for getters. */
1154 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1155 false, /* isTypedMethod. Only relevant for methods. */
1156 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1157};
1158static const JSJitInfo domDependentByte_setterinfo = {
1159 { (JSJitGetterOp)set_domDependentByte },
1160 { prototypes::id::TestJSImplInterface },
1161 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1162 JSJitInfo::Setter,
1163 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1164 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1165 false, /* isInfallible. False in setters. */
1166 false, /* isMovable. Not relevant for setters. */
1167 false, /* isEliminatable. Not relevant for setters. */
1168 false, /* isAlwaysInSlot. Only relevant for getters. */
1169 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1170 false, /* isTypedMethod. Only relevant for methods. */
1171 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1172};
1173
1174MOZ_CAN_RUN_SCRIPT static bool
1175get_constantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1176{
1177 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1180( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1178 "TestJSImplInterface", "constantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1180( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1179 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1180( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1180 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1180( cx, "TestJSImplInterface"
, "constantByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1181
1182 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1183 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1184 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1185 if (objIsXray) {
1186 unwrappedObj.emplace(cx, obj);
1187 }
1188 if (objIsXray) {
1189 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1190 // we know Xrays have no dynamic unwrap behavior.
1191 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1192 if (!unwrappedObj.ref()) {
1193 return false;
1194 }
1195 }
1196 FastErrorResult rv;
1197 int8_t result(MOZ_KnownLive(self)(self)->GetConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1198 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.constantByte getter"
)), 0))
) {
1199 return false;
1200 }
1201 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1201); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1201; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1202 args.rval().setInt32(int32_t(result));
1203 return true;
1204}
1205
1206static const JSJitInfo constantByte_getterinfo = {
1207 { get_constantByte },
1208 { prototypes::id::TestJSImplInterface },
1209 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1210 JSJitInfo::Getter,
1211 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1212 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1213 false, /* isInfallible. False in setters. */
1214 false, /* isMovable. Not relevant for setters. */
1215 false, /* isEliminatable. Not relevant for setters. */
1216 false, /* isAlwaysInSlot. Only relevant for getters. */
1217 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1218 false, /* isTypedMethod. Only relevant for methods. */
1219 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1220};
1221
1222MOZ_CAN_RUN_SCRIPT static bool
1223get_deviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1224{
1225 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1228( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1226 "TestJSImplInterface", "deviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1228( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1227 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1228( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1228 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1228( cx, "TestJSImplInterface"
, "deviceStateDependentByte", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1229
1230 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1231 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1232 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1233 if (objIsXray) {
1234 unwrappedObj.emplace(cx, obj);
1235 }
1236 if (objIsXray) {
1237 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1238 // we know Xrays have no dynamic unwrap behavior.
1239 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1240 if (!unwrappedObj.ref()) {
1241 return false;
1242 }
1243 }
1244 FastErrorResult rv;
1245 int8_t result(MOZ_KnownLive(self)(self)->GetDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1246 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deviceStateDependentByte getter"
)), 0))
) {
1247 return false;
1248 }
1249 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1249); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1249; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1250 args.rval().setInt32(int32_t(result));
1251 return true;
1252}
1253
1254static const JSJitInfo deviceStateDependentByte_getterinfo = {
1255 { get_deviceStateDependentByte },
1256 { prototypes::id::TestJSImplInterface },
1257 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1258 JSJitInfo::Getter,
1259 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1260 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1261 false, /* isInfallible. False in setters. */
1262 false, /* isMovable. Not relevant for setters. */
1263 false, /* isEliminatable. Not relevant for setters. */
1264 false, /* isAlwaysInSlot. Only relevant for getters. */
1265 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1266 false, /* isTypedMethod. Only relevant for methods. */
1267 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1268};
1269
1270MOZ_CAN_RUN_SCRIPT static bool
1271returnByteSideEffectFree(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1272{
1273 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1276( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1274 "TestJSImplInterface", "returnByteSideEffectFree", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1276( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1275 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1276( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1276 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1276( cx, "TestJSImplInterface"
, "returnByteSideEffectFree", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1277
1278 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1279 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1280 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1281 if (objIsXray) {
1282 unwrappedObj.emplace(cx, obj);
1283 }
1284 if (objIsXray) {
1285 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1286 // we know Xrays have no dynamic unwrap behavior.
1287 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1288 if (!unwrappedObj.ref()) {
1289 return false;
1290 }
1291 }
1292 FastErrorResult rv;
1293 int8_t result(MOZ_KnownLive(self)(self)->ReturnByteSideEffectFree(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1294 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnByteSideEffectFree"
)), 0))
) {
1295 return false;
1296 }
1297 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1297); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1297; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1298 args.rval().setInt32(int32_t(result));
1299 return true;
1300}
1301
1302static const JSJitInfo::ArgType returnByteSideEffectFree_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1303static const JSTypedMethodJitInfo returnByteSideEffectFree_methodinfo = {
1304 {
1305 { (JSJitGetterOp)returnByteSideEffectFree },
1306 { prototypes::id::TestJSImplInterface },
1307 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1308 JSJitInfo::Method,
1309 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1310 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1311 false, /* isInfallible. False in setters. */
1312 false, /* isMovable. Not relevant for setters. */
1313 false, /* isEliminatable. Not relevant for setters. */
1314 false, /* isAlwaysInSlot. Only relevant for getters. */
1315 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1316 true, /* isTypedMethod. Only relevant for methods. */
1317 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1318 },
1319 returnByteSideEffectFree_methodinfo_argTypes
1320};
1321
1322MOZ_CAN_RUN_SCRIPT static bool
1323returnDOMDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1324{
1325 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1328( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1326 "TestJSImplInterface", "returnDOMDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1328( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1327 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1328( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1328 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1328( cx, "TestJSImplInterface"
, "returnDOMDependentByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1329
1330 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1331 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1332 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1333 if (objIsXray) {
1334 unwrappedObj.emplace(cx, obj);
1335 }
1336 if (objIsXray) {
1337 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1338 // we know Xrays have no dynamic unwrap behavior.
1339 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1340 if (!unwrappedObj.ref()) {
1341 return false;
1342 }
1343 }
1344 FastErrorResult rv;
1345 int8_t result(MOZ_KnownLive(self)(self)->ReturnDOMDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1346 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDOMDependentByte"
)), 0))
) {
1347 return false;
1348 }
1349 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1349); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1349; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1350 args.rval().setInt32(int32_t(result));
1351 return true;
1352}
1353
1354static const JSJitInfo::ArgType returnDOMDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1355static const JSTypedMethodJitInfo returnDOMDependentByte_methodinfo = {
1356 {
1357 { (JSJitGetterOp)returnDOMDependentByte },
1358 { prototypes::id::TestJSImplInterface },
1359 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1360 JSJitInfo::Method,
1361 JSJitInfo::AliasDOMSets, /* aliasSet. Not relevant for setters. */
1362 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1363 false, /* isInfallible. False in setters. */
1364 false, /* isMovable. Not relevant for setters. */
1365 false, /* isEliminatable. Not relevant for setters. */
1366 false, /* isAlwaysInSlot. Only relevant for getters. */
1367 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1368 true, /* isTypedMethod. Only relevant for methods. */
1369 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1370 },
1371 returnDOMDependentByte_methodinfo_argTypes
1372};
1373
1374MOZ_CAN_RUN_SCRIPT static bool
1375returnConstantByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1376{
1377 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1380( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1378 "TestJSImplInterface", "returnConstantByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1380( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1379 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1380( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1380 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1380( cx, "TestJSImplInterface"
, "returnConstantByte", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1381
1382 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1383 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1384 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1385 if (objIsXray) {
1386 unwrappedObj.emplace(cx, obj);
1387 }
1388 if (objIsXray) {
1389 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1390 // we know Xrays have no dynamic unwrap behavior.
1391 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1392 if (!unwrappedObj.ref()) {
1393 return false;
1394 }
1395 }
1396 FastErrorResult rv;
1397 int8_t result(MOZ_KnownLive(self)(self)->ReturnConstantByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1398 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnConstantByte"
)), 0))
) {
1399 return false;
1400 }
1401 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1401); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1401; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1402 args.rval().setInt32(int32_t(result));
1403 return true;
1404}
1405
1406static const JSJitInfo::ArgType returnConstantByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1407static const JSTypedMethodJitInfo returnConstantByte_methodinfo = {
1408 {
1409 { (JSJitGetterOp)returnConstantByte },
1410 { prototypes::id::TestJSImplInterface },
1411 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1412 JSJitInfo::Method,
1413 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1414 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1415 false, /* isInfallible. False in setters. */
1416 false, /* isMovable. Not relevant for setters. */
1417 false, /* isEliminatable. Not relevant for setters. */
1418 false, /* isAlwaysInSlot. Only relevant for getters. */
1419 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1420 true, /* isTypedMethod. Only relevant for methods. */
1421 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1422 },
1423 returnConstantByte_methodinfo_argTypes
1424};
1425
1426MOZ_CAN_RUN_SCRIPT static bool
1427returnDeviceStateDependentByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1428{
1429 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1432( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1430 "TestJSImplInterface", "returnDeviceStateDependentByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1432( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1431 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1432( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1432 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1432( cx, "TestJSImplInterface"
, "returnDeviceStateDependentByte", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1433
1434 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1435 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1436 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1437 if (objIsXray) {
1438 unwrappedObj.emplace(cx, obj);
1439 }
1440 if (objIsXray) {
1441 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1442 // we know Xrays have no dynamic unwrap behavior.
1443 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1444 if (!unwrappedObj.ref()) {
1445 return false;
1446 }
1447 }
1448 FastErrorResult rv;
1449 int8_t result(MOZ_KnownLive(self)(self)->ReturnDeviceStateDependentByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1450 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.returnDeviceStateDependentByte"
)), 0))
) {
1451 return false;
1452 }
1453 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1453); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1453; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1454 args.rval().setInt32(int32_t(result));
1455 return true;
1456}
1457
1458static const JSJitInfo::ArgType returnDeviceStateDependentByte_methodinfo_argTypes[] = { JSJitInfo::ArgTypeListEnd };
1459static const JSTypedMethodJitInfo returnDeviceStateDependentByte_methodinfo = {
1460 {
1461 { (JSJitGetterOp)returnDeviceStateDependentByte },
1462 { prototypes::id::TestJSImplInterface },
1463 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1464 JSJitInfo::Method,
1465 JSJitInfo::AliasNone, /* aliasSet. Not relevant for setters. */
1466 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1467 false, /* isInfallible. False in setters. */
1468 false, /* isMovable. Not relevant for setters. */
1469 false, /* isEliminatable. Not relevant for setters. */
1470 false, /* isAlwaysInSlot. Only relevant for getters. */
1471 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1472 true, /* isTypedMethod. Only relevant for methods. */
1473 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1474 },
1475 returnDeviceStateDependentByte_methodinfo_argTypes
1476};
1477
1478MOZ_CAN_RUN_SCRIPT static bool
1479get_readonlyShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1480{
1481 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1484( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1482 "TestJSImplInterface", "readonlyShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1484( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1483 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1484( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1484 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1484( cx, "TestJSImplInterface"
, "readonlyShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1485
1486 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1487 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1488 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1489 if (objIsXray) {
1490 unwrappedObj.emplace(cx, obj);
1491 }
1492 if (objIsXray) {
1493 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1494 // we know Xrays have no dynamic unwrap behavior.
1495 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1496 if (!unwrappedObj.ref()) {
1497 return false;
1498 }
1499 }
1500 FastErrorResult rv;
1501 int16_t result(MOZ_KnownLive(self)(self)->GetReadonlyShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1502 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyShort getter"
)), 0))
) {
1503 return false;
1504 }
1505 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1505); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1505; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1506 args.rval().setInt32(int32_t(result));
1507 return true;
1508}
1509
1510static const JSJitInfo readonlyShort_getterinfo = {
1511 { get_readonlyShort },
1512 { prototypes::id::TestJSImplInterface },
1513 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1514 JSJitInfo::Getter,
1515 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1516 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1517 false, /* isInfallible. False in setters. */
1518 false, /* isMovable. Not relevant for setters. */
1519 false, /* isEliminatable. Not relevant for setters. */
1520 false, /* isAlwaysInSlot. Only relevant for getters. */
1521 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1522 false, /* isTypedMethod. Only relevant for methods. */
1523 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1524};
1525
1526MOZ_CAN_RUN_SCRIPT static bool
1527get_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1528{
1529 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1532( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1530 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1532( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1531 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1532( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1532 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1532( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1533
1534 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1535 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1536 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1537 if (objIsXray) {
1538 unwrappedObj.emplace(cx, obj);
1539 }
1540 if (objIsXray) {
1541 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1542 // we know Xrays have no dynamic unwrap behavior.
1543 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1544 if (!unwrappedObj.ref()) {
1545 return false;
1546 }
1547 }
1548 FastErrorResult rv;
1549 int16_t result(MOZ_KnownLive(self)(self)->GetWritableShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1550 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort getter"
)), 0))
) {
1551 return false;
1552 }
1553 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1553); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1553; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1554 args.rval().setInt32(int32_t(result));
1555 return true;
1556}
1557
1558MOZ_CAN_RUN_SCRIPT static bool
1559set_writableShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1560{
1561 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1564( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1562 "TestJSImplInterface", "writableShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1564( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1563 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1564( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1564 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1564( cx, "TestJSImplInterface"
, "writableShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1565
1566 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1567 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1568 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1569 if (objIsXray) {
1570 unwrappedObj.emplace(cx, obj);
1571 }
1572 int16_t arg0;
1573 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1574 return false;
1575 }
1576 if (objIsXray) {
1577 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1578 // we know Xrays have no dynamic unwrap behavior.
1579 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1580 if (!unwrappedObj.ref()) {
1581 return false;
1582 }
1583 }
1584 FastErrorResult rv;
1585 // NOTE: This assert does NOT call the function.
1586 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1587 MOZ_KnownLive(self)(self)->SetWritableShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1588 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableShort setter"
)), 0))
) {
1589 return false;
1590 }
1591 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1591); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1591; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1592
1593 return true;
1594}
1595
1596static const JSJitInfo writableShort_getterinfo = {
1597 { get_writableShort },
1598 { prototypes::id::TestJSImplInterface },
1599 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1600 JSJitInfo::Getter,
1601 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1602 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1603 false, /* isInfallible. False in setters. */
1604 false, /* isMovable. Not relevant for setters. */
1605 false, /* isEliminatable. Not relevant for setters. */
1606 false, /* isAlwaysInSlot. Only relevant for getters. */
1607 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1608 false, /* isTypedMethod. Only relevant for methods. */
1609 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1610};
1611static const JSJitInfo writableShort_setterinfo = {
1612 { (JSJitGetterOp)set_writableShort },
1613 { prototypes::id::TestJSImplInterface },
1614 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1615 JSJitInfo::Setter,
1616 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1617 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1618 false, /* isInfallible. False in setters. */
1619 false, /* isMovable. Not relevant for setters. */
1620 false, /* isEliminatable. Not relevant for setters. */
1621 false, /* isAlwaysInSlot. Only relevant for getters. */
1622 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1623 false, /* isTypedMethod. Only relevant for methods. */
1624 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1625};
1626
1627MOZ_CAN_RUN_SCRIPT static bool
1628passShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1629{
1630 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1633( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1631 "TestJSImplInterface", "passShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1633( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1632 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1633( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
1633 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1633( cx, "TestJSImplInterface"
, "passShort", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
1634
1635 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1636 if (!args.requireAtLeast(cx, "TestJSImplInterface.passShort", 1)) {
1637 return false;
1638 }
1639 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1640 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1641 if (objIsXray) {
1642 unwrappedObj.emplace(cx, obj);
1643 }
1644 int16_t arg0;
1645 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1646 return false;
1647 }
1648 if (objIsXray) {
1649 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1650 // we know Xrays have no dynamic unwrap behavior.
1651 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1652 if (!unwrappedObj.ref()) {
1653 return false;
1654 }
1655 }
1656 FastErrorResult rv;
1657 // NOTE: This assert does NOT call the function.
1658 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1659 MOZ_KnownLive(self)(self)->PassShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1660 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passShort"
)), 0))
) {
1661 return false;
1662 }
1663 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1663); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1663; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1664 args.rval().setUndefined();
1665 return true;
1666}
1667
1668static const JSJitInfo passShort_methodinfo = {
1669 { (JSJitGetterOp)passShort },
1670 { prototypes::id::TestJSImplInterface },
1671 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1672 JSJitInfo::Method,
1673 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1674 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1675 false, /* isInfallible. False in setters. */
1676 false, /* isMovable. Not relevant for setters. */
1677 false, /* isEliminatable. Not relevant for setters. */
1678 false, /* isAlwaysInSlot. Only relevant for getters. */
1679 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1680 false, /* isTypedMethod. Only relevant for methods. */
1681 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1682};
1683
1684MOZ_CAN_RUN_SCRIPT static bool
1685receiveShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1686{
1687 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1690( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1688 "TestJSImplInterface", "receiveShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1690( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1689 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1690( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1690 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1690( cx, "TestJSImplInterface"
, "receiveShort", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1691
1692 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1693 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1694 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1695 if (objIsXray) {
1696 unwrappedObj.emplace(cx, obj);
1697 }
1698 if (objIsXray) {
1699 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1700 // we know Xrays have no dynamic unwrap behavior.
1701 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1702 if (!unwrappedObj.ref()) {
1703 return false;
1704 }
1705 }
1706 FastErrorResult rv;
1707 int16_t result(MOZ_KnownLive(self)(self)->ReceiveShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1708 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveShort"
)), 0))
) {
1709 return false;
1710 }
1711 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1711); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1711; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1712 args.rval().setInt32(int32_t(result));
1713 return true;
1714}
1715
1716static const JSJitInfo receiveShort_methodinfo = {
1717 { (JSJitGetterOp)receiveShort },
1718 { prototypes::id::TestJSImplInterface },
1719 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1720 JSJitInfo::Method,
1721 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1722 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1723 false, /* isInfallible. False in setters. */
1724 false, /* isMovable. Not relevant for setters. */
1725 false, /* isEliminatable. Not relevant for setters. */
1726 false, /* isAlwaysInSlot. Only relevant for getters. */
1727 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1728 false, /* isTypedMethod. Only relevant for methods. */
1729 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1730};
1731
1732MOZ_CAN_RUN_SCRIPT static bool
1733passOptionalShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1734{
1735 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1738( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1736 "TestJSImplInterface", "passOptionalShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1738( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1737 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1738( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1738 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1738( cx, "TestJSImplInterface"
, "passOptionalShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1739
1740 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1741 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1742 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1743 if (objIsXray) {
1744 unwrappedObj.emplace(cx, obj);
1745 }
1746 Optional<int16_t> arg0;
1747 if (args.hasDefined(0)) {
1748 arg0.Construct();
1749 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
1750 return false;
1751 }
1752 }
1753 if (objIsXray) {
1754 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1755 // we know Xrays have no dynamic unwrap behavior.
1756 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1757 if (!unwrappedObj.ref()) {
1758 return false;
1759 }
1760 }
1761 FastErrorResult rv;
1762 // NOTE: This assert does NOT call the function.
1763 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1764 MOZ_KnownLive(self)(self)->PassOptionalShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1765 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShort"
)), 0))
) {
1766 return false;
1767 }
1768 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1768); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1768; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1769 args.rval().setUndefined();
1770 return true;
1771}
1772
1773static const JSJitInfo passOptionalShort_methodinfo = {
1774 { (JSJitGetterOp)passOptionalShort },
1775 { prototypes::id::TestJSImplInterface },
1776 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1777 JSJitInfo::Method,
1778 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1779 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1780 false, /* isInfallible. False in setters. */
1781 false, /* isMovable. Not relevant for setters. */
1782 false, /* isEliminatable. Not relevant for setters. */
1783 false, /* isAlwaysInSlot. Only relevant for getters. */
1784 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1785 false, /* isTypedMethod. Only relevant for methods. */
1786 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1787};
1788
1789MOZ_CAN_RUN_SCRIPT static bool
1790passOptionalShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1791{
1792 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1795( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1793 "TestJSImplInterface", "passOptionalShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1795( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1794 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject1795( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
1795 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1795( cx, "TestJSImplInterface"
, "passOptionalShortWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
1796
1797 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1798 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1799 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1800 if (objIsXray) {
1801 unwrappedObj.emplace(cx, obj);
1802 }
1803 int16_t arg0;
1804 if (args.hasDefined(0)) {
1805 if (!ValueToPrimitive<int16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
1806 return false;
1807 }
1808 } else {
1809 arg0 = 5;
1810 }
1811 if (objIsXray) {
1812 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1813 // we know Xrays have no dynamic unwrap behavior.
1814 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1815 if (!unwrappedObj.ref()) {
1816 return false;
1817 }
1818 }
1819 FastErrorResult rv;
1820 // NOTE: This assert does NOT call the function.
1821 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1822 MOZ_KnownLive(self)(self)->PassOptionalShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1823 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalShortWithDefault"
)), 0))
) {
1824 return false;
1825 }
1826 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1826; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1827 args.rval().setUndefined();
1828 return true;
1829}
1830
1831static const JSJitInfo passOptionalShortWithDefault_methodinfo = {
1832 { (JSJitGetterOp)passOptionalShortWithDefault },
1833 { prototypes::id::TestJSImplInterface },
1834 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1835 JSJitInfo::Method,
1836 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1837 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1838 false, /* isInfallible. False in setters. */
1839 false, /* isMovable. Not relevant for setters. */
1840 false, /* isEliminatable. Not relevant for setters. */
1841 false, /* isAlwaysInSlot. Only relevant for getters. */
1842 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1843 false, /* isTypedMethod. Only relevant for methods. */
1844 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1845};
1846
1847MOZ_CAN_RUN_SCRIPT static bool
1848get_readonlyLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1849{
1850 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1853( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1851 "TestJSImplInterface", "readonlyLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1853( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1852 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1853( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1853 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1853( cx, "TestJSImplInterface"
, "readonlyLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1854
1855 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1856 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1857 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1858 if (objIsXray) {
1859 unwrappedObj.emplace(cx, obj);
1860 }
1861 if (objIsXray) {
1862 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1863 // we know Xrays have no dynamic unwrap behavior.
1864 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1865 if (!unwrappedObj.ref()) {
1866 return false;
1867 }
1868 }
1869 FastErrorResult rv;
1870 int32_t result(MOZ_KnownLive(self)(self)->GetReadonlyLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1871 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLong getter"
)), 0))
) {
1872 return false;
1873 }
1874 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1874; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1875 args.rval().setInt32(int32_t(result));
1876 return true;
1877}
1878
1879static const JSJitInfo readonlyLong_getterinfo = {
1880 { get_readonlyLong },
1881 { prototypes::id::TestJSImplInterface },
1882 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1883 JSJitInfo::Getter,
1884 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1885 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1886 false, /* isInfallible. False in setters. */
1887 false, /* isMovable. Not relevant for setters. */
1888 false, /* isEliminatable. Not relevant for setters. */
1889 false, /* isAlwaysInSlot. Only relevant for getters. */
1890 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1891 false, /* isTypedMethod. Only relevant for methods. */
1892 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1893};
1894
1895MOZ_CAN_RUN_SCRIPT static bool
1896get_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
1897{
1898 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1901( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1899 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1901( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1900 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject1901( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1901 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1901( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1902
1903 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1904 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1905 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1906 if (objIsXray) {
1907 unwrappedObj.emplace(cx, obj);
1908 }
1909 if (objIsXray) {
1910 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1911 // we know Xrays have no dynamic unwrap behavior.
1912 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1913 if (!unwrappedObj.ref()) {
1914 return false;
1915 }
1916 }
1917 FastErrorResult rv;
1918 int32_t result(MOZ_KnownLive(self)(self)->GetWritableLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
1919 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong getter"
)), 0))
) {
1920 return false;
1921 }
1922 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1922; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1923 args.rval().setInt32(int32_t(result));
1924 return true;
1925}
1926
1927MOZ_CAN_RUN_SCRIPT static bool
1928set_writableLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
1929{
1930 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject1933( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1931 "TestJSImplInterface", "writableLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject1933( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1932 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject1933( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
1933 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject1933( cx, "TestJSImplInterface"
, "writableLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
1934
1935 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
1936 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
1937 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
1938 if (objIsXray) {
1939 unwrappedObj.emplace(cx, obj);
1940 }
1941 int32_t arg0;
1942 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
1943 return false;
1944 }
1945 if (objIsXray) {
1946 // Since our object is an Xray, we can just CheckedUnwrapStatic:
1947 // we know Xrays have no dynamic unwrap behavior.
1948 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
1949 if (!unwrappedObj.ref()) {
1950 return false;
1951 }
1952 }
1953 FastErrorResult rv;
1954 // NOTE: This assert does NOT call the function.
1955 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
1956 MOZ_KnownLive(self)(self)->SetWritableLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
1957 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLong setter"
)), 0))
) {
1958 return false;
1959 }
1960 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 1960); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 1960; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
1961
1962 return true;
1963}
1964
1965static const JSJitInfo writableLong_getterinfo = {
1966 { get_writableLong },
1967 { prototypes::id::TestJSImplInterface },
1968 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1969 JSJitInfo::Getter,
1970 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1971 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
1972 false, /* isInfallible. False in setters. */
1973 false, /* isMovable. Not relevant for setters. */
1974 false, /* isEliminatable. Not relevant for setters. */
1975 false, /* isAlwaysInSlot. Only relevant for getters. */
1976 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1977 false, /* isTypedMethod. Only relevant for methods. */
1978 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1979};
1980static const JSJitInfo writableLong_setterinfo = {
1981 { (JSJitGetterOp)set_writableLong },
1982 { prototypes::id::TestJSImplInterface },
1983 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
1984 JSJitInfo::Setter,
1985 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
1986 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
1987 false, /* isInfallible. False in setters. */
1988 false, /* isMovable. Not relevant for setters. */
1989 false, /* isEliminatable. Not relevant for setters. */
1990 false, /* isAlwaysInSlot. Only relevant for getters. */
1991 false, /* isLazilyCachedInSlot. Only relevant for getters. */
1992 false, /* isTypedMethod. Only relevant for methods. */
1993 0 /* Reserved slot index, if we're stored in a slot, else 0. */
1994};
1995
1996MOZ_CAN_RUN_SCRIPT static bool
1997passLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
1998{
1999 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2002( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2000 "TestJSImplInterface", "passLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2002( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2001 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2002( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2002 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2002( cx, "TestJSImplInterface"
, "passLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
2003
2004 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2005 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLong", 1)) {
2006 return false;
2007 }
2008 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2009 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2010 if (objIsXray) {
2011 unwrappedObj.emplace(cx, obj);
2012 }
2013 int32_t arg0;
2014 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2015 return false;
2016 }
2017 if (objIsXray) {
2018 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2019 // we know Xrays have no dynamic unwrap behavior.
2020 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2021 if (!unwrappedObj.ref()) {
2022 return false;
2023 }
2024 }
2025 FastErrorResult rv;
2026 // NOTE: This assert does NOT call the function.
2027 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2028 MOZ_KnownLive(self)(self)->PassLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2029 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLong"
)), 0))
) {
2030 return false;
2031 }
2032 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2032); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2032; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2033 args.rval().setUndefined();
2034 return true;
2035}
2036
2037static const JSJitInfo passLong_methodinfo = {
2038 { (JSJitGetterOp)passLong },
2039 { prototypes::id::TestJSImplInterface },
2040 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2041 JSJitInfo::Method,
2042 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2043 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2044 false, /* isInfallible. False in setters. */
2045 false, /* isMovable. Not relevant for setters. */
2046 false, /* isEliminatable. Not relevant for setters. */
2047 false, /* isAlwaysInSlot. Only relevant for getters. */
2048 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2049 false, /* isTypedMethod. Only relevant for methods. */
2050 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2051};
2052
2053MOZ_CAN_RUN_SCRIPT static bool
2054receiveLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2055{
2056 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2059( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2057 "TestJSImplInterface", "receiveLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2059( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2058 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2059( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2059 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2059( cx, "TestJSImplInterface"
, "receiveLong", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2060
2061 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2062 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2063 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2064 if (objIsXray) {
2065 unwrappedObj.emplace(cx, obj);
2066 }
2067 if (objIsXray) {
2068 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2069 // we know Xrays have no dynamic unwrap behavior.
2070 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2071 if (!unwrappedObj.ref()) {
2072 return false;
2073 }
2074 }
2075 FastErrorResult rv;
2076 int32_t result(MOZ_KnownLive(self)(self)->ReceiveLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2077 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLong"
)), 0))
) {
2078 return false;
2079 }
2080 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2080); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2080; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2081 args.rval().setInt32(int32_t(result));
2082 return true;
2083}
2084
2085static const JSJitInfo receiveLong_methodinfo = {
2086 { (JSJitGetterOp)receiveLong },
2087 { prototypes::id::TestJSImplInterface },
2088 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2089 JSJitInfo::Method,
2090 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2091 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2092 false, /* isInfallible. False in setters. */
2093 false, /* isMovable. Not relevant for setters. */
2094 false, /* isEliminatable. Not relevant for setters. */
2095 false, /* isAlwaysInSlot. Only relevant for getters. */
2096 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2097 false, /* isTypedMethod. Only relevant for methods. */
2098 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2099};
2100
2101MOZ_CAN_RUN_SCRIPT static bool
2102passOptionalLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2103{
2104 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2107( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2105 "TestJSImplInterface", "passOptionalLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2107( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2106 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2107( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2107 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2107( cx, "TestJSImplInterface"
, "passOptionalLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2108
2109 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2110 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2111 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2112 if (objIsXray) {
2113 unwrappedObj.emplace(cx, obj);
2114 }
2115 Optional<int32_t> arg0;
2116 if (args.hasDefined(0)) {
2117 arg0.Construct();
2118 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2119 return false;
2120 }
2121 }
2122 if (objIsXray) {
2123 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2124 // we know Xrays have no dynamic unwrap behavior.
2125 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2126 if (!unwrappedObj.ref()) {
2127 return false;
2128 }
2129 }
2130 FastErrorResult rv;
2131 // NOTE: This assert does NOT call the function.
2132 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2133 MOZ_KnownLive(self)(self)->PassOptionalLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2134 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLong"
)), 0))
) {
2135 return false;
2136 }
2137 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2137); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2137; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2138 args.rval().setUndefined();
2139 return true;
2140}
2141
2142static const JSJitInfo passOptionalLong_methodinfo = {
2143 { (JSJitGetterOp)passOptionalLong },
2144 { prototypes::id::TestJSImplInterface },
2145 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2146 JSJitInfo::Method,
2147 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2148 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2149 false, /* isInfallible. False in setters. */
2150 false, /* isMovable. Not relevant for setters. */
2151 false, /* isEliminatable. Not relevant for setters. */
2152 false, /* isAlwaysInSlot. Only relevant for getters. */
2153 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2154 false, /* isTypedMethod. Only relevant for methods. */
2155 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2156};
2157
2158MOZ_CAN_RUN_SCRIPT static bool
2159passOptionalLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2160{
2161 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2164( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2162 "TestJSImplInterface", "passOptionalLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2164( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2163 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2164( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2164 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2164( cx, "TestJSImplInterface"
, "passOptionalLongWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2165
2166 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2167 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2168 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2169 if (objIsXray) {
2170 unwrappedObj.emplace(cx, obj);
2171 }
2172 int32_t arg0;
2173 if (args.hasDefined(0)) {
2174 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2175 return false;
2176 }
2177 } else {
2178 arg0 = 7;
2179 }
2180 if (objIsXray) {
2181 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2182 // we know Xrays have no dynamic unwrap behavior.
2183 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2184 if (!unwrappedObj.ref()) {
2185 return false;
2186 }
2187 }
2188 FastErrorResult rv;
2189 // NOTE: This assert does NOT call the function.
2190 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2191 MOZ_KnownLive(self)(self)->PassOptionalLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2192 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongWithDefault"
)), 0))
) {
2193 return false;
2194 }
2195 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2195; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2196 args.rval().setUndefined();
2197 return true;
2198}
2199
2200static const JSJitInfo passOptionalLongWithDefault_methodinfo = {
2201 { (JSJitGetterOp)passOptionalLongWithDefault },
2202 { prototypes::id::TestJSImplInterface },
2203 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2204 JSJitInfo::Method,
2205 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2206 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2207 false, /* isInfallible. False in setters. */
2208 false, /* isMovable. Not relevant for setters. */
2209 false, /* isEliminatable. Not relevant for setters. */
2210 false, /* isAlwaysInSlot. Only relevant for getters. */
2211 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2212 false, /* isTypedMethod. Only relevant for methods. */
2213 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2214};
2215
2216MOZ_CAN_RUN_SCRIPT static bool
2217get_readonlyLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2218{
2219 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2222( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2220 "TestJSImplInterface", "readonlyLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2222( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2221 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2222( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2222 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2222( cx, "TestJSImplInterface"
, "readonlyLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2223
2224 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2225 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2226 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2227 if (objIsXray) {
2228 unwrappedObj.emplace(cx, obj);
2229 }
2230 if (objIsXray) {
2231 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2232 // we know Xrays have no dynamic unwrap behavior.
2233 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2234 if (!unwrappedObj.ref()) {
2235 return false;
2236 }
2237 }
2238 FastErrorResult rv;
2239 int64_t result(MOZ_KnownLive(self)(self)->GetReadonlyLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2240 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyLongLong getter"
)), 0))
) {
2241 return false;
2242 }
2243 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2243; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2244 args.rval().set(JS_NumberValue(double(result)));
2245 return true;
2246}
2247
2248static const JSJitInfo readonlyLongLong_getterinfo = {
2249 { get_readonlyLongLong },
2250 { prototypes::id::TestJSImplInterface },
2251 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2252 JSJitInfo::Getter,
2253 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2254 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2255 false, /* isInfallible. False in setters. */
2256 false, /* isMovable. Not relevant for setters. */
2257 false, /* isEliminatable. Not relevant for setters. */
2258 false, /* isAlwaysInSlot. Only relevant for getters. */
2259 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2260 false, /* isTypedMethod. Only relevant for methods. */
2261 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2262};
2263
2264MOZ_CAN_RUN_SCRIPT static bool
2265get_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2266{
2267 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2270( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2268 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2270( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2269 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2270( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2270 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2270( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2271
2272 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2273 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2274 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2275 if (objIsXray) {
2276 unwrappedObj.emplace(cx, obj);
2277 }
2278 if (objIsXray) {
2279 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2280 // we know Xrays have no dynamic unwrap behavior.
2281 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2282 if (!unwrappedObj.ref()) {
2283 return false;
2284 }
2285 }
2286 FastErrorResult rv;
2287 int64_t result(MOZ_KnownLive(self)(self)->GetWritableLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2288 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong getter"
)), 0))
) {
2289 return false;
2290 }
2291 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2291); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2291; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2292 args.rval().set(JS_NumberValue(double(result)));
2293 return true;
2294}
2295
2296MOZ_CAN_RUN_SCRIPT static bool
2297set_writableLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2298{
2299 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2302( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2300 "TestJSImplInterface", "writableLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2302( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2301 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2302( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2302 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2302( cx, "TestJSImplInterface"
, "writableLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2303
2304 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2305 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2306 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2307 if (objIsXray) {
2308 unwrappedObj.emplace(cx, obj);
2309 }
2310 int64_t arg0;
2311 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2312 return false;
2313 }
2314 if (objIsXray) {
2315 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2316 // we know Xrays have no dynamic unwrap behavior.
2317 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2318 if (!unwrappedObj.ref()) {
2319 return false;
2320 }
2321 }
2322 FastErrorResult rv;
2323 // NOTE: This assert does NOT call the function.
2324 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2325 MOZ_KnownLive(self)(self)->SetWritableLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2326 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableLongLong setter"
)), 0))
) {
2327 return false;
2328 }
2329 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2329); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2329; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2330
2331 return true;
2332}
2333
2334static const JSJitInfo writableLongLong_getterinfo = {
2335 { get_writableLongLong },
2336 { prototypes::id::TestJSImplInterface },
2337 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2338 JSJitInfo::Getter,
2339 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2340 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2341 false, /* isInfallible. False in setters. */
2342 false, /* isMovable. Not relevant for setters. */
2343 false, /* isEliminatable. Not relevant for setters. */
2344 false, /* isAlwaysInSlot. Only relevant for getters. */
2345 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2346 false, /* isTypedMethod. Only relevant for methods. */
2347 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2348};
2349static const JSJitInfo writableLongLong_setterinfo = {
2350 { (JSJitGetterOp)set_writableLongLong },
2351 { prototypes::id::TestJSImplInterface },
2352 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2353 JSJitInfo::Setter,
2354 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2355 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2356 false, /* isInfallible. False in setters. */
2357 false, /* isMovable. Not relevant for setters. */
2358 false, /* isEliminatable. Not relevant for setters. */
2359 false, /* isAlwaysInSlot. Only relevant for getters. */
2360 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2361 false, /* isTypedMethod. Only relevant for methods. */
2362 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2363};
2364
2365MOZ_CAN_RUN_SCRIPT static bool
2366passLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2367{
2368 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2371( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2369 "TestJSImplInterface", "passLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2371( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2370 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2371( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2371 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2371( cx, "TestJSImplInterface"
, "passLongLong", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2372
2373 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2374 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLongLong", 1)) {
2375 return false;
2376 }
2377 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2378 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2379 if (objIsXray) {
2380 unwrappedObj.emplace(cx, obj);
2381 }
2382 int64_t arg0;
2383 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2384 return false;
2385 }
2386 if (objIsXray) {
2387 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2388 // we know Xrays have no dynamic unwrap behavior.
2389 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2390 if (!unwrappedObj.ref()) {
2391 return false;
2392 }
2393 }
2394 FastErrorResult rv;
2395 // NOTE: This assert does NOT call the function.
2396 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2397 MOZ_KnownLive(self)(self)->PassLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2398 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLongLong"
)), 0))
) {
2399 return false;
2400 }
2401 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2401); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2401; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2402 args.rval().setUndefined();
2403 return true;
2404}
2405
2406static const JSJitInfo passLongLong_methodinfo = {
2407 { (JSJitGetterOp)passLongLong },
2408 { prototypes::id::TestJSImplInterface },
2409 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2410 JSJitInfo::Method,
2411 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2412 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2413 false, /* isInfallible. False in setters. */
2414 false, /* isMovable. Not relevant for setters. */
2415 false, /* isEliminatable. Not relevant for setters. */
2416 false, /* isAlwaysInSlot. Only relevant for getters. */
2417 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2418 false, /* isTypedMethod. Only relevant for methods. */
2419 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2420};
2421
2422MOZ_CAN_RUN_SCRIPT static bool
2423receiveLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2424{
2425 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2428( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2426 "TestJSImplInterface", "receiveLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2428( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2427 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2428( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2428 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2428( cx, "TestJSImplInterface"
, "receiveLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2429
2430 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2431 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2432 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2433 if (objIsXray) {
2434 unwrappedObj.emplace(cx, obj);
2435 }
2436 if (objIsXray) {
2437 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2438 // we know Xrays have no dynamic unwrap behavior.
2439 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2440 if (!unwrappedObj.ref()) {
2441 return false;
2442 }
2443 }
2444 FastErrorResult rv;
2445 int64_t result(MOZ_KnownLive(self)(self)->ReceiveLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2446 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveLongLong"
)), 0))
) {
2447 return false;
2448 }
2449 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2449); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2449; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2450 args.rval().set(JS_NumberValue(double(result)));
2451 return true;
2452}
2453
2454static const JSJitInfo receiveLongLong_methodinfo = {
2455 { (JSJitGetterOp)receiveLongLong },
2456 { prototypes::id::TestJSImplInterface },
2457 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2458 JSJitInfo::Method,
2459 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2460 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
2461 false, /* isInfallible. False in setters. */
2462 false, /* isMovable. Not relevant for setters. */
2463 false, /* isEliminatable. Not relevant for setters. */
2464 false, /* isAlwaysInSlot. Only relevant for getters. */
2465 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2466 false, /* isTypedMethod. Only relevant for methods. */
2467 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2468};
2469
2470MOZ_CAN_RUN_SCRIPT static bool
2471passOptionalLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2472{
2473 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2476( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2474 "TestJSImplInterface", "passOptionalLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2476( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2475 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2476( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2476 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2476( cx, "TestJSImplInterface"
, "passOptionalLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2477
2478 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2479 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2480 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2481 if (objIsXray) {
2482 unwrappedObj.emplace(cx, obj);
2483 }
2484 Optional<int64_t> arg0;
2485 if (args.hasDefined(0)) {
2486 arg0.Construct();
2487 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2488 return false;
2489 }
2490 }
2491 if (objIsXray) {
2492 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2493 // we know Xrays have no dynamic unwrap behavior.
2494 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2495 if (!unwrappedObj.ref()) {
2496 return false;
2497 }
2498 }
2499 FastErrorResult rv;
2500 // NOTE: This assert does NOT call the function.
2501 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2502 MOZ_KnownLive(self)(self)->PassOptionalLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2503 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLong"
)), 0))
) {
2504 return false;
2505 }
2506 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2506; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2507 args.rval().setUndefined();
2508 return true;
2509}
2510
2511static const JSJitInfo passOptionalLongLong_methodinfo = {
2512 { (JSJitGetterOp)passOptionalLongLong },
2513 { prototypes::id::TestJSImplInterface },
2514 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2515 JSJitInfo::Method,
2516 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2517 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2518 false, /* isInfallible. False in setters. */
2519 false, /* isMovable. Not relevant for setters. */
2520 false, /* isEliminatable. Not relevant for setters. */
2521 false, /* isAlwaysInSlot. Only relevant for getters. */
2522 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2523 false, /* isTypedMethod. Only relevant for methods. */
2524 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2525};
2526
2527MOZ_CAN_RUN_SCRIPT static bool
2528passOptionalLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2529{
2530 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2533( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2531 "TestJSImplInterface", "passOptionalLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2533( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2532 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2533( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2533 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2533( cx, "TestJSImplInterface"
, "passOptionalLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2534
2535 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2536 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2537 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2538 if (objIsXray) {
2539 unwrappedObj.emplace(cx, obj);
2540 }
2541 int64_t arg0;
2542 if (args.hasDefined(0)) {
2543 if (!ValueToPrimitive<int64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2544 return false;
2545 }
2546 } else {
2547 arg0 = -12LL;
2548 }
2549 if (objIsXray) {
2550 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2551 // we know Xrays have no dynamic unwrap behavior.
2552 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2553 if (!unwrappedObj.ref()) {
2554 return false;
2555 }
2556 }
2557 FastErrorResult rv;
2558 // NOTE: This assert does NOT call the function.
2559 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2560 MOZ_KnownLive(self)(self)->PassOptionalLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2561 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalLongLongWithDefault"
)), 0))
) {
2562 return false;
2563 }
2564 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2564); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2564; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2565 args.rval().setUndefined();
2566 return true;
2567}
2568
2569static const JSJitInfo passOptionalLongLongWithDefault_methodinfo = {
2570 { (JSJitGetterOp)passOptionalLongLongWithDefault },
2571 { prototypes::id::TestJSImplInterface },
2572 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2573 JSJitInfo::Method,
2574 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2575 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2576 false, /* isInfallible. False in setters. */
2577 false, /* isMovable. Not relevant for setters. */
2578 false, /* isEliminatable. Not relevant for setters. */
2579 false, /* isAlwaysInSlot. Only relevant for getters. */
2580 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2581 false, /* isTypedMethod. Only relevant for methods. */
2582 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2583};
2584
2585MOZ_CAN_RUN_SCRIPT static bool
2586get_readonlyOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2587{
2588 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2591( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2589 "TestJSImplInterface", "readonlyOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2591( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2590 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2591( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2591 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2591( cx, "TestJSImplInterface"
, "readonlyOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2592
2593 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2594 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2595 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2596 if (objIsXray) {
2597 unwrappedObj.emplace(cx, obj);
2598 }
2599 if (objIsXray) {
2600 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2601 // we know Xrays have no dynamic unwrap behavior.
2602 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2603 if (!unwrappedObj.ref()) {
2604 return false;
2605 }
2606 }
2607 FastErrorResult rv;
2608 uint8_t result(MOZ_KnownLive(self)(self)->GetReadonlyOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2609 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyOctet getter"
)), 0))
) {
2610 return false;
2611 }
2612 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2612); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2612; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2613 args.rval().setInt32(int32_t(result));
2614 return true;
2615}
2616
2617static const JSJitInfo readonlyOctet_getterinfo = {
2618 { get_readonlyOctet },
2619 { prototypes::id::TestJSImplInterface },
2620 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2621 JSJitInfo::Getter,
2622 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2623 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2624 false, /* isInfallible. False in setters. */
2625 false, /* isMovable. Not relevant for setters. */
2626 false, /* isEliminatable. Not relevant for setters. */
2627 false, /* isAlwaysInSlot. Only relevant for getters. */
2628 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2629 false, /* isTypedMethod. Only relevant for methods. */
2630 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2631};
2632
2633MOZ_CAN_RUN_SCRIPT static bool
2634get_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2635{
2636 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2639( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2637 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2639( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2638 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2639( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2639 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2639( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2640
2641 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2642 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2643 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2644 if (objIsXray) {
2645 unwrappedObj.emplace(cx, obj);
2646 }
2647 if (objIsXray) {
2648 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2649 // we know Xrays have no dynamic unwrap behavior.
2650 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2651 if (!unwrappedObj.ref()) {
2652 return false;
2653 }
2654 }
2655 FastErrorResult rv;
2656 uint8_t result(MOZ_KnownLive(self)(self)->GetWritableOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2657 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet getter"
)), 0))
) {
2658 return false;
2659 }
2660 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2660); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2660; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2661 args.rval().setInt32(int32_t(result));
2662 return true;
2663}
2664
2665MOZ_CAN_RUN_SCRIPT static bool
2666set_writableOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
2667{
2668 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2671( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2669 "TestJSImplInterface", "writableOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2671( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2670 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject2671( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2671 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2671( cx, "TestJSImplInterface"
, "writableOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2672
2673 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2674 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2675 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2676 if (objIsXray) {
2677 unwrappedObj.emplace(cx, obj);
2678 }
2679 uint8_t arg0;
2680 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
2681 return false;
2682 }
2683 if (objIsXray) {
2684 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2685 // we know Xrays have no dynamic unwrap behavior.
2686 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2687 if (!unwrappedObj.ref()) {
2688 return false;
2689 }
2690 }
2691 FastErrorResult rv;
2692 // NOTE: This assert does NOT call the function.
2693 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2694 MOZ_KnownLive(self)(self)->SetWritableOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2695 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableOctet setter"
)), 0))
) {
2696 return false;
2697 }
2698 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2698; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2699
2700 return true;
2701}
2702
2703static const JSJitInfo writableOctet_getterinfo = {
2704 { get_writableOctet },
2705 { prototypes::id::TestJSImplInterface },
2706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2707 JSJitInfo::Getter,
2708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2709 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2710 false, /* isInfallible. False in setters. */
2711 false, /* isMovable. Not relevant for setters. */
2712 false, /* isEliminatable. Not relevant for setters. */
2713 false, /* isAlwaysInSlot. Only relevant for getters. */
2714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2715 false, /* isTypedMethod. Only relevant for methods. */
2716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2717};
2718static const JSJitInfo writableOctet_setterinfo = {
2719 { (JSJitGetterOp)set_writableOctet },
2720 { prototypes::id::TestJSImplInterface },
2721 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2722 JSJitInfo::Setter,
2723 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2724 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2725 false, /* isInfallible. False in setters. */
2726 false, /* isMovable. Not relevant for setters. */
2727 false, /* isEliminatable. Not relevant for setters. */
2728 false, /* isAlwaysInSlot. Only relevant for getters. */
2729 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2730 false, /* isTypedMethod. Only relevant for methods. */
2731 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2732};
2733
2734MOZ_CAN_RUN_SCRIPT static bool
2735passOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2736{
2737 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2740( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2738 "TestJSImplInterface", "passOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2740( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2739 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2740( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
2740 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2740( cx, "TestJSImplInterface"
, "passOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
2741
2742 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2743 if (!args.requireAtLeast(cx, "TestJSImplInterface.passOctet", 1)) {
2744 return false;
2745 }
2746 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2747 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2748 if (objIsXray) {
2749 unwrappedObj.emplace(cx, obj);
2750 }
2751 uint8_t arg0;
2752 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2753 return false;
2754 }
2755 if (objIsXray) {
2756 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2757 // we know Xrays have no dynamic unwrap behavior.
2758 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2759 if (!unwrappedObj.ref()) {
2760 return false;
2761 }
2762 }
2763 FastErrorResult rv;
2764 // NOTE: This assert does NOT call the function.
2765 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2766 MOZ_KnownLive(self)(self)->PassOctet(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2767 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOctet"
)), 0))
) {
2768 return false;
2769 }
2770 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2770); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2770; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2771 args.rval().setUndefined();
2772 return true;
2773}
2774
2775static const JSJitInfo passOctet_methodinfo = {
2776 { (JSJitGetterOp)passOctet },
2777 { prototypes::id::TestJSImplInterface },
2778 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2779 JSJitInfo::Method,
2780 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2781 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2782 false, /* isInfallible. False in setters. */
2783 false, /* isMovable. Not relevant for setters. */
2784 false, /* isEliminatable. Not relevant for setters. */
2785 false, /* isAlwaysInSlot. Only relevant for getters. */
2786 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2787 false, /* isTypedMethod. Only relevant for methods. */
2788 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2789};
2790
2791MOZ_CAN_RUN_SCRIPT static bool
2792receiveOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2793{
2794 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2797( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2795 "TestJSImplInterface", "receiveOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2797( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2796 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2797( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2797 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2797( cx, "TestJSImplInterface"
, "receiveOctet", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2798
2799 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2800 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2801 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2802 if (objIsXray) {
2803 unwrappedObj.emplace(cx, obj);
2804 }
2805 if (objIsXray) {
2806 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2807 // we know Xrays have no dynamic unwrap behavior.
2808 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2809 if (!unwrappedObj.ref()) {
2810 return false;
2811 }
2812 }
2813 FastErrorResult rv;
2814 uint8_t result(MOZ_KnownLive(self)(self)->ReceiveOctet(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2815 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveOctet"
)), 0))
) {
2816 return false;
2817 }
2818 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2818); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2818; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2819 args.rval().setInt32(int32_t(result));
2820 return true;
2821}
2822
2823static const JSJitInfo receiveOctet_methodinfo = {
2824 { (JSJitGetterOp)receiveOctet },
2825 { prototypes::id::TestJSImplInterface },
2826 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2827 JSJitInfo::Method,
2828 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2829 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2830 false, /* isInfallible. False in setters. */
2831 false, /* isMovable. Not relevant for setters. */
2832 false, /* isEliminatable. Not relevant for setters. */
2833 false, /* isAlwaysInSlot. Only relevant for getters. */
2834 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2835 false, /* isTypedMethod. Only relevant for methods. */
2836 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2837};
2838
2839MOZ_CAN_RUN_SCRIPT static bool
2840passOptionalOctet(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2841{
2842 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2845( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2843 "TestJSImplInterface", "passOptionalOctet", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2845( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2844 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2845( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2845 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2845( cx, "TestJSImplInterface"
, "passOptionalOctet", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2846
2847 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2848 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2849 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2850 if (objIsXray) {
2851 unwrappedObj.emplace(cx, obj);
2852 }
2853 Optional<uint8_t> arg0;
2854 if (args.hasDefined(0)) {
2855 arg0.Construct();
2856 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
2857 return false;
2858 }
2859 }
2860 if (objIsXray) {
2861 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2862 // we know Xrays have no dynamic unwrap behavior.
2863 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2864 if (!unwrappedObj.ref()) {
2865 return false;
2866 }
2867 }
2868 FastErrorResult rv;
2869 // NOTE: This assert does NOT call the function.
2870 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2871 MOZ_KnownLive(self)(self)->PassOptionalOctet(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2872 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctet"
)), 0))
) {
2873 return false;
2874 }
2875 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2875); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2875; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2876 args.rval().setUndefined();
2877 return true;
2878}
2879
2880static const JSJitInfo passOptionalOctet_methodinfo = {
2881 { (JSJitGetterOp)passOptionalOctet },
2882 { prototypes::id::TestJSImplInterface },
2883 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2884 JSJitInfo::Method,
2885 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2886 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2887 false, /* isInfallible. False in setters. */
2888 false, /* isMovable. Not relevant for setters. */
2889 false, /* isEliminatable. Not relevant for setters. */
2890 false, /* isAlwaysInSlot. Only relevant for getters. */
2891 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2892 false, /* isTypedMethod. Only relevant for methods. */
2893 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2894};
2895
2896MOZ_CAN_RUN_SCRIPT static bool
2897passOptionalOctetWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
2898{
2899 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2902( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2900 "TestJSImplInterface", "passOptionalOctetWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2902( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2901 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject2902( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
2902 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2902( cx, "TestJSImplInterface"
, "passOptionalOctetWithDefault", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
2903
2904 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2905 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2906 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2907 if (objIsXray) {
2908 unwrappedObj.emplace(cx, obj);
2909 }
2910 uint8_t arg0;
2911 if (args.hasDefined(0)) {
2912 if (!ValueToPrimitive<uint8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
2913 return false;
2914 }
2915 } else {
2916 arg0 = 19;
2917 }
2918 if (objIsXray) {
2919 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2920 // we know Xrays have no dynamic unwrap behavior.
2921 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2922 if (!unwrappedObj.ref()) {
2923 return false;
2924 }
2925 }
2926 FastErrorResult rv;
2927 // NOTE: This assert does NOT call the function.
2928 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
2929 MOZ_KnownLive(self)(self)->PassOptionalOctetWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
2930 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalOctetWithDefault"
)), 0))
) {
2931 return false;
2932 }
2933 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2933); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2933; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2934 args.rval().setUndefined();
2935 return true;
2936}
2937
2938static const JSJitInfo passOptionalOctetWithDefault_methodinfo = {
2939 { (JSJitGetterOp)passOptionalOctetWithDefault },
2940 { prototypes::id::TestJSImplInterface },
2941 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2942 JSJitInfo::Method,
2943 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2944 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
2945 false, /* isInfallible. False in setters. */
2946 false, /* isMovable. Not relevant for setters. */
2947 false, /* isEliminatable. Not relevant for setters. */
2948 false, /* isAlwaysInSlot. Only relevant for getters. */
2949 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2950 false, /* isTypedMethod. Only relevant for methods. */
2951 0 /* Reserved slot index, if we're stored in a slot, else 0. */
2952};
2953
2954MOZ_CAN_RUN_SCRIPT static bool
2955get_readonlyUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
2956{
2957 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject2960( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2958 "TestJSImplInterface", "readonlyUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject2960( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2959 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject2960( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
2960 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject2960( cx, "TestJSImplInterface"
, "readonlyUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
2961
2962 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
2963 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
2964 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
2965 if (objIsXray) {
2966 unwrappedObj.emplace(cx, obj);
2967 }
2968 if (objIsXray) {
2969 // Since our object is an Xray, we can just CheckedUnwrapStatic:
2970 // we know Xrays have no dynamic unwrap behavior.
2971 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
2972 if (!unwrappedObj.ref()) {
2973 return false;
2974 }
2975 }
2976 FastErrorResult rv;
2977 uint16_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
2978 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedShort getter"
)), 0))
) {
2979 return false;
2980 }
2981 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 2981); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 2981; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
2982 args.rval().setInt32(int32_t(result));
2983 return true;
2984}
2985
2986static const JSJitInfo readonlyUnsignedShort_getterinfo = {
2987 { get_readonlyUnsignedShort },
2988 { prototypes::id::TestJSImplInterface },
2989 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
2990 JSJitInfo::Getter,
2991 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
2992 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
2993 false, /* isInfallible. False in setters. */
2994 false, /* isMovable. Not relevant for setters. */
2995 false, /* isEliminatable. Not relevant for setters. */
2996 false, /* isAlwaysInSlot. Only relevant for getters. */
2997 false, /* isLazilyCachedInSlot. Only relevant for getters. */
2998 false, /* isTypedMethod. Only relevant for methods. */
2999 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3000};
3001
3002MOZ_CAN_RUN_SCRIPT static bool
3003get_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3004{
3005 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3008( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3006 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3008( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3007 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3008( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3008 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3008( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3009
3010 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3011 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3012 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3013 if (objIsXray) {
3014 unwrappedObj.emplace(cx, obj);
3015 }
3016 if (objIsXray) {
3017 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3018 // we know Xrays have no dynamic unwrap behavior.
3019 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3020 if (!unwrappedObj.ref()) {
3021 return false;
3022 }
3023 }
3024 FastErrorResult rv;
3025 uint16_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3026 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort getter"
)), 0))
) {
3027 return false;
3028 }
3029 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3029); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3029; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3030 args.rval().setInt32(int32_t(result));
3031 return true;
3032}
3033
3034MOZ_CAN_RUN_SCRIPT static bool
3035set_writableUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3036{
3037 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3040( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3038 "TestJSImplInterface", "writableUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3040( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3039 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3040( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3040 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3040( cx, "TestJSImplInterface"
, "writableUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3041
3042 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3043 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3044 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3045 if (objIsXray) {
3046 unwrappedObj.emplace(cx, obj);
3047 }
3048 uint16_t arg0;
3049 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3050 return false;
3051 }
3052 if (objIsXray) {
3053 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3054 // we know Xrays have no dynamic unwrap behavior.
3055 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3056 if (!unwrappedObj.ref()) {
3057 return false;
3058 }
3059 }
3060 FastErrorResult rv;
3061 // NOTE: This assert does NOT call the function.
3062 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3063 MOZ_KnownLive(self)(self)->SetWritableUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3064 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedShort setter"
)), 0))
) {
3065 return false;
3066 }
3067 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3067); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3067; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3068
3069 return true;
3070}
3071
3072static const JSJitInfo writableUnsignedShort_getterinfo = {
3073 { get_writableUnsignedShort },
3074 { prototypes::id::TestJSImplInterface },
3075 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3076 JSJitInfo::Getter,
3077 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3078 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3079 false, /* isInfallible. False in setters. */
3080 false, /* isMovable. Not relevant for setters. */
3081 false, /* isEliminatable. Not relevant for setters. */
3082 false, /* isAlwaysInSlot. Only relevant for getters. */
3083 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3084 false, /* isTypedMethod. Only relevant for methods. */
3085 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3086};
3087static const JSJitInfo writableUnsignedShort_setterinfo = {
3088 { (JSJitGetterOp)set_writableUnsignedShort },
3089 { prototypes::id::TestJSImplInterface },
3090 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3091 JSJitInfo::Setter,
3092 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3093 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3094 false, /* isInfallible. False in setters. */
3095 false, /* isMovable. Not relevant for setters. */
3096 false, /* isEliminatable. Not relevant for setters. */
3097 false, /* isAlwaysInSlot. Only relevant for getters. */
3098 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3099 false, /* isTypedMethod. Only relevant for methods. */
3100 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3101};
3102
3103MOZ_CAN_RUN_SCRIPT static bool
3104passUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3105{
3106 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3109( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3107 "TestJSImplInterface", "passUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3109( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3108 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3109( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3109 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3109( cx, "TestJSImplInterface"
, "passUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3110
3111 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3112 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedShort", 1)) {
3113 return false;
3114 }
3115 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3116 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3117 if (objIsXray) {
3118 unwrappedObj.emplace(cx, obj);
3119 }
3120 uint16_t arg0;
3121 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3122 return false;
3123 }
3124 if (objIsXray) {
3125 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3126 // we know Xrays have no dynamic unwrap behavior.
3127 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3128 if (!unwrappedObj.ref()) {
3129 return false;
3130 }
3131 }
3132 FastErrorResult rv;
3133 // NOTE: This assert does NOT call the function.
3134 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3135 MOZ_KnownLive(self)(self)->PassUnsignedShort(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3136 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedShort"
)), 0))
) {
3137 return false;
3138 }
3139 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3139); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3139; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3140 args.rval().setUndefined();
3141 return true;
3142}
3143
3144static const JSJitInfo passUnsignedShort_methodinfo = {
3145 { (JSJitGetterOp)passUnsignedShort },
3146 { prototypes::id::TestJSImplInterface },
3147 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3148 JSJitInfo::Method,
3149 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3150 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3151 false, /* isInfallible. False in setters. */
3152 false, /* isMovable. Not relevant for setters. */
3153 false, /* isEliminatable. Not relevant for setters. */
3154 false, /* isAlwaysInSlot. Only relevant for getters. */
3155 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3156 false, /* isTypedMethod. Only relevant for methods. */
3157 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3158};
3159
3160MOZ_CAN_RUN_SCRIPT static bool
3161receiveUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3162{
3163 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3166( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3164 "TestJSImplInterface", "receiveUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3166( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3165 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3166( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3166 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3166( cx, "TestJSImplInterface"
, "receiveUnsignedShort", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3167
3168 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3169 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3170 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3171 if (objIsXray) {
3172 unwrappedObj.emplace(cx, obj);
3173 }
3174 if (objIsXray) {
3175 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3176 // we know Xrays have no dynamic unwrap behavior.
3177 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3178 if (!unwrappedObj.ref()) {
3179 return false;
3180 }
3181 }
3182 FastErrorResult rv;
3183 uint16_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedShort(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3184 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedShort"
)), 0))
) {
3185 return false;
3186 }
3187 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3187); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3187; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3188 args.rval().setInt32(int32_t(result));
3189 return true;
3190}
3191
3192static const JSJitInfo receiveUnsignedShort_methodinfo = {
3193 { (JSJitGetterOp)receiveUnsignedShort },
3194 { prototypes::id::TestJSImplInterface },
3195 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3196 JSJitInfo::Method,
3197 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3198 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
3199 false, /* isInfallible. False in setters. */
3200 false, /* isMovable. Not relevant for setters. */
3201 false, /* isEliminatable. Not relevant for setters. */
3202 false, /* isAlwaysInSlot. Only relevant for getters. */
3203 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3204 false, /* isTypedMethod. Only relevant for methods. */
3205 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3206};
3207
3208MOZ_CAN_RUN_SCRIPT static bool
3209passOptionalUnsignedShort(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3210{
3211 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3212 "TestJSImplInterface", "passOptionalUnsignedShort", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3213 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3214 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3214( cx, "TestJSImplInterface"
, "passOptionalUnsignedShort", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3215
3216 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3217 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3218 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3219 if (objIsXray) {
3220 unwrappedObj.emplace(cx, obj);
3221 }
3222 Optional<uint16_t> arg0;
3223 if (args.hasDefined(0)) {
3224 arg0.Construct();
3225 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3226 return false;
3227 }
3228 }
3229 if (objIsXray) {
3230 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3231 // we know Xrays have no dynamic unwrap behavior.
3232 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3233 if (!unwrappedObj.ref()) {
3234 return false;
3235 }
3236 }
3237 FastErrorResult rv;
3238 // NOTE: This assert does NOT call the function.
3239 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3240 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShort(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3241 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShort"
)), 0))
) {
3242 return false;
3243 }
3244 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3244); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3244; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3245 args.rval().setUndefined();
3246 return true;
3247}
3248
3249static const JSJitInfo passOptionalUnsignedShort_methodinfo = {
3250 { (JSJitGetterOp)passOptionalUnsignedShort },
3251 { prototypes::id::TestJSImplInterface },
3252 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3253 JSJitInfo::Method,
3254 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3255 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3256 false, /* isInfallible. False in setters. */
3257 false, /* isMovable. Not relevant for setters. */
3258 false, /* isEliminatable. Not relevant for setters. */
3259 false, /* isAlwaysInSlot. Only relevant for getters. */
3260 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3261 false, /* isTypedMethod. Only relevant for methods. */
3262 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3263};
3264
3265MOZ_CAN_RUN_SCRIPT static bool
3266passOptionalUnsignedShortWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3267{
3268 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3271( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3269 "TestJSImplInterface", "passOptionalUnsignedShortWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3271( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3270 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3271( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3271 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3271( cx, "TestJSImplInterface"
, "passOptionalUnsignedShortWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3272
3273 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3274 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3275 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3276 if (objIsXray) {
3277 unwrappedObj.emplace(cx, obj);
3278 }
3279 uint16_t arg0;
3280 if (args.hasDefined(0)) {
3281 if (!ValueToPrimitive<uint16_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3282 return false;
3283 }
3284 } else {
3285 arg0 = 2;
3286 }
3287 if (objIsXray) {
3288 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3289 // we know Xrays have no dynamic unwrap behavior.
3290 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3291 if (!unwrappedObj.ref()) {
3292 return false;
3293 }
3294 }
3295 FastErrorResult rv;
3296 // NOTE: This assert does NOT call the function.
3297 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3298 MOZ_KnownLive(self)(self)->PassOptionalUnsignedShortWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3299 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedShortWithDefault"
)), 0))
) {
3300 return false;
3301 }
3302 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3302; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3303 args.rval().setUndefined();
3304 return true;
3305}
3306
3307static const JSJitInfo passOptionalUnsignedShortWithDefault_methodinfo = {
3308 { (JSJitGetterOp)passOptionalUnsignedShortWithDefault },
3309 { prototypes::id::TestJSImplInterface },
3310 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3311 JSJitInfo::Method,
3312 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3313 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3314 false, /* isInfallible. False in setters. */
3315 false, /* isMovable. Not relevant for setters. */
3316 false, /* isEliminatable. Not relevant for setters. */
3317 false, /* isAlwaysInSlot. Only relevant for getters. */
3318 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3319 false, /* isTypedMethod. Only relevant for methods. */
3320 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3321};
3322
3323MOZ_CAN_RUN_SCRIPT static bool
3324get_readonlyUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3325{
3326 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3329( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3327 "TestJSImplInterface", "readonlyUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3329( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3328 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3329( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3329 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3329( cx, "TestJSImplInterface"
, "readonlyUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3330
3331 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3332 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3333 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3334 if (objIsXray) {
3335 unwrappedObj.emplace(cx, obj);
3336 }
3337 if (objIsXray) {
3338 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3339 // we know Xrays have no dynamic unwrap behavior.
3340 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3341 if (!unwrappedObj.ref()) {
3342 return false;
3343 }
3344 }
3345 FastErrorResult rv;
3346 uint32_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3347 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLong getter"
)), 0))
) {
3348 return false;
3349 }
3350 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3350); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3350; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3351 args.rval().setNumber(result);
3352 return true;
3353}
3354
3355static const JSJitInfo readonlyUnsignedLong_getterinfo = {
3356 { get_readonlyUnsignedLong },
3357 { prototypes::id::TestJSImplInterface },
3358 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3359 JSJitInfo::Getter,
3360 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3361 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3362 false, /* isInfallible. False in setters. */
3363 false, /* isMovable. Not relevant for setters. */
3364 false, /* isEliminatable. Not relevant for setters. */
3365 false, /* isAlwaysInSlot. Only relevant for getters. */
3366 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3367 false, /* isTypedMethod. Only relevant for methods. */
3368 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3369};
3370
3371MOZ_CAN_RUN_SCRIPT static bool
3372get_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3373{
3374 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3377( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3375 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3377( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3376 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3377( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3377 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3377( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3378
3379 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3380 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3381 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3382 if (objIsXray) {
3383 unwrappedObj.emplace(cx, obj);
3384 }
3385 if (objIsXray) {
3386 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3387 // we know Xrays have no dynamic unwrap behavior.
3388 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3389 if (!unwrappedObj.ref()) {
3390 return false;
3391 }
3392 }
3393 FastErrorResult rv;
3394 uint32_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3395 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong getter"
)), 0))
) {
3396 return false;
3397 }
3398 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3398); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3398; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3399 args.rval().setNumber(result);
3400 return true;
3401}
3402
3403MOZ_CAN_RUN_SCRIPT static bool
3404set_writableUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3405{
3406 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3409( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3407 "TestJSImplInterface", "writableUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3409( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3408 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3409( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3409 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3409( cx, "TestJSImplInterface"
, "writableUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3410
3411 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3412 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3413 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3414 if (objIsXray) {
3415 unwrappedObj.emplace(cx, obj);
3416 }
3417 uint32_t arg0;
3418 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3419 return false;
3420 }
3421 if (objIsXray) {
3422 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3423 // we know Xrays have no dynamic unwrap behavior.
3424 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3425 if (!unwrappedObj.ref()) {
3426 return false;
3427 }
3428 }
3429 FastErrorResult rv;
3430 // NOTE: This assert does NOT call the function.
3431 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3432 MOZ_KnownLive(self)(self)->SetWritableUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3433 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLong setter"
)), 0))
) {
3434 return false;
3435 }
3436 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3436); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3436; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3437
3438 return true;
3439}
3440
3441static const JSJitInfo writableUnsignedLong_getterinfo = {
3442 { get_writableUnsignedLong },
3443 { prototypes::id::TestJSImplInterface },
3444 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3445 JSJitInfo::Getter,
3446 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3447 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3448 false, /* isInfallible. False in setters. */
3449 false, /* isMovable. Not relevant for setters. */
3450 false, /* isEliminatable. Not relevant for setters. */
3451 false, /* isAlwaysInSlot. Only relevant for getters. */
3452 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3453 false, /* isTypedMethod. Only relevant for methods. */
3454 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3455};
3456static const JSJitInfo writableUnsignedLong_setterinfo = {
3457 { (JSJitGetterOp)set_writableUnsignedLong },
3458 { prototypes::id::TestJSImplInterface },
3459 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3460 JSJitInfo::Setter,
3461 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3462 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3463 false, /* isInfallible. False in setters. */
3464 false, /* isMovable. Not relevant for setters. */
3465 false, /* isEliminatable. Not relevant for setters. */
3466 false, /* isAlwaysInSlot. Only relevant for getters. */
3467 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3468 false, /* isTypedMethod. Only relevant for methods. */
3469 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3470};
3471
3472MOZ_CAN_RUN_SCRIPT static bool
3473passUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3474{
3475 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3478( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3476 "TestJSImplInterface", "passUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3478( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3477 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3478( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3478 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3478( cx, "TestJSImplInterface"
, "passUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3479
3480 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3481 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLong", 1)) {
3482 return false;
3483 }
3484 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3485 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3486 if (objIsXray) {
3487 unwrappedObj.emplace(cx, obj);
3488 }
3489 uint32_t arg0;
3490 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3491 return false;
3492 }
3493 if (objIsXray) {
3494 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3495 // we know Xrays have no dynamic unwrap behavior.
3496 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3497 if (!unwrappedObj.ref()) {
3498 return false;
3499 }
3500 }
3501 FastErrorResult rv;
3502 // NOTE: This assert does NOT call the function.
3503 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3504 MOZ_KnownLive(self)(self)->PassUnsignedLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3505 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLong"
)), 0))
) {
3506 return false;
3507 }
3508 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3508; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3509 args.rval().setUndefined();
3510 return true;
3511}
3512
3513static const JSJitInfo passUnsignedLong_methodinfo = {
3514 { (JSJitGetterOp)passUnsignedLong },
3515 { prototypes::id::TestJSImplInterface },
3516 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3517 JSJitInfo::Method,
3518 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3519 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3520 false, /* isInfallible. False in setters. */
3521 false, /* isMovable. Not relevant for setters. */
3522 false, /* isEliminatable. Not relevant for setters. */
3523 false, /* isAlwaysInSlot. Only relevant for getters. */
3524 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3525 false, /* isTypedMethod. Only relevant for methods. */
3526 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3527};
3528
3529MOZ_CAN_RUN_SCRIPT static bool
3530receiveUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3531{
3532 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3535( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3533 "TestJSImplInterface", "receiveUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3535( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3534 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3535( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3535 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3535( cx, "TestJSImplInterface"
, "receiveUnsignedLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3536
3537 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3538 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3539 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3540 if (objIsXray) {
3541 unwrappedObj.emplace(cx, obj);
3542 }
3543 if (objIsXray) {
3544 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3545 // we know Xrays have no dynamic unwrap behavior.
3546 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3547 if (!unwrappedObj.ref()) {
3548 return false;
3549 }
3550 }
3551 FastErrorResult rv;
3552 uint32_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3553 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLong"
)), 0))
) {
3554 return false;
3555 }
3556 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3556); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3556; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3557 args.rval().setNumber(result);
3558 return true;
3559}
3560
3561static const JSJitInfo receiveUnsignedLong_methodinfo = {
3562 { (JSJitGetterOp)receiveUnsignedLong },
3563 { prototypes::id::TestJSImplInterface },
3564 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3565 JSJitInfo::Method,
3566 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3567 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3568 false, /* isInfallible. False in setters. */
3569 false, /* isMovable. Not relevant for setters. */
3570 false, /* isEliminatable. Not relevant for setters. */
3571 false, /* isAlwaysInSlot. Only relevant for getters. */
3572 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3573 false, /* isTypedMethod. Only relevant for methods. */
3574 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3575};
3576
3577MOZ_CAN_RUN_SCRIPT static bool
3578passOptionalUnsignedLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3579{
3580 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3583( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3581 "TestJSImplInterface", "passOptionalUnsignedLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3583( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3582 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3583( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3583 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3583( cx, "TestJSImplInterface"
, "passOptionalUnsignedLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3584
3585 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3586 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3587 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3588 if (objIsXray) {
3589 unwrappedObj.emplace(cx, obj);
3590 }
3591 Optional<uint32_t> arg0;
3592 if (args.hasDefined(0)) {
3593 arg0.Construct();
3594 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3595 return false;
3596 }
3597 }
3598 if (objIsXray) {
3599 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3600 // we know Xrays have no dynamic unwrap behavior.
3601 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3602 if (!unwrappedObj.ref()) {
3603 return false;
3604 }
3605 }
3606 FastErrorResult rv;
3607 // NOTE: This assert does NOT call the function.
3608 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3609 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3610 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLong"
)), 0))
) {
3611 return false;
3612 }
3613 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3613); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3613; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3614 args.rval().setUndefined();
3615 return true;
3616}
3617
3618static const JSJitInfo passOptionalUnsignedLong_methodinfo = {
3619 { (JSJitGetterOp)passOptionalUnsignedLong },
3620 { prototypes::id::TestJSImplInterface },
3621 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3622 JSJitInfo::Method,
3623 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3624 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3625 false, /* isInfallible. False in setters. */
3626 false, /* isMovable. Not relevant for setters. */
3627 false, /* isEliminatable. Not relevant for setters. */
3628 false, /* isAlwaysInSlot. Only relevant for getters. */
3629 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3630 false, /* isTypedMethod. Only relevant for methods. */
3631 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3632};
3633
3634MOZ_CAN_RUN_SCRIPT static bool
3635passOptionalUnsignedLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3636{
3637 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3640( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3638 "TestJSImplInterface", "passOptionalUnsignedLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3640( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3639 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3640( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3640 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3640( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3641
3642 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3643 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3644 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3645 if (objIsXray) {
3646 unwrappedObj.emplace(cx, obj);
3647 }
3648 uint32_t arg0;
3649 if (args.hasDefined(0)) {
3650 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3651 return false;
3652 }
3653 } else {
3654 arg0 = 6U;
3655 }
3656 if (objIsXray) {
3657 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3658 // we know Xrays have no dynamic unwrap behavior.
3659 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3660 if (!unwrappedObj.ref()) {
3661 return false;
3662 }
3663 }
3664 FastErrorResult rv;
3665 // NOTE: This assert does NOT call the function.
3666 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3667 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3668 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongWithDefault"
)), 0))
) {
3669 return false;
3670 }
3671 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3671); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3671; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3672 args.rval().setUndefined();
3673 return true;
3674}
3675
3676static const JSJitInfo passOptionalUnsignedLongWithDefault_methodinfo = {
3677 { (JSJitGetterOp)passOptionalUnsignedLongWithDefault },
3678 { prototypes::id::TestJSImplInterface },
3679 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3680 JSJitInfo::Method,
3681 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3682 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3683 false, /* isInfallible. False in setters. */
3684 false, /* isMovable. Not relevant for setters. */
3685 false, /* isEliminatable. Not relevant for setters. */
3686 false, /* isAlwaysInSlot. Only relevant for getters. */
3687 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3688 false, /* isTypedMethod. Only relevant for methods. */
3689 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3690};
3691
3692MOZ_CAN_RUN_SCRIPT static bool
3693get_readonlyUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3694{
3695 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3698( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3696 "TestJSImplInterface", "readonlyUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3698( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3697 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3698( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3698 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3698( cx, "TestJSImplInterface"
, "readonlyUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3699
3700 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3701 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3702 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3703 if (objIsXray) {
3704 unwrappedObj.emplace(cx, obj);
3705 }
3706 if (objIsXray) {
3707 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3708 // we know Xrays have no dynamic unwrap behavior.
3709 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3710 if (!unwrappedObj.ref()) {
3711 return false;
3712 }
3713 }
3714 FastErrorResult rv;
3715 uint64_t result(MOZ_KnownLive(self)(self)->GetReadonlyUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3716 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyUnsignedLongLong getter"
)), 0))
) {
3717 return false;
3718 }
3719 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3719); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3719; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3720 args.rval().set(JS_NumberValue(double(result)));
3721 return true;
3722}
3723
3724static const JSJitInfo readonlyUnsignedLongLong_getterinfo = {
3725 { get_readonlyUnsignedLongLong },
3726 { prototypes::id::TestJSImplInterface },
3727 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3728 JSJitInfo::Getter,
3729 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3730 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3731 false, /* isInfallible. False in setters. */
3732 false, /* isMovable. Not relevant for setters. */
3733 false, /* isEliminatable. Not relevant for setters. */
3734 false, /* isAlwaysInSlot. Only relevant for getters. */
3735 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3736 false, /* isTypedMethod. Only relevant for methods. */
3737 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3738};
3739
3740MOZ_CAN_RUN_SCRIPT static bool
3741get_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
3742{
3743 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3746( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3744 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3746( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3745 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject3746( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3746 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3746( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3747
3748 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3749 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3750 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3751 if (objIsXray) {
3752 unwrappedObj.emplace(cx, obj);
3753 }
3754 if (objIsXray) {
3755 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3756 // we know Xrays have no dynamic unwrap behavior.
3757 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3758 if (!unwrappedObj.ref()) {
3759 return false;
3760 }
3761 }
3762 FastErrorResult rv;
3763 uint64_t result(MOZ_KnownLive(self)(self)->GetWritableUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3764 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong getter"
)), 0))
) {
3765 return false;
3766 }
3767 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3767); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3767; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3768 args.rval().set(JS_NumberValue(double(result)));
3769 return true;
3770}
3771
3772MOZ_CAN_RUN_SCRIPT static bool
3773set_writableUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
3774{
3775 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3778( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3776 "TestJSImplInterface", "writableUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3778( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3777 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject3778( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3778 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3778( cx, "TestJSImplInterface"
, "writableUnsignedLongLong", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3779
3780 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3781 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3782 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3783 if (objIsXray) {
3784 unwrappedObj.emplace(cx, obj);
3785 }
3786 uint64_t arg0;
3787 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
3788 return false;
3789 }
3790 if (objIsXray) {
3791 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3792 // we know Xrays have no dynamic unwrap behavior.
3793 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3794 if (!unwrappedObj.ref()) {
3795 return false;
3796 }
3797 }
3798 FastErrorResult rv;
3799 // NOTE: This assert does NOT call the function.
3800 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3801 MOZ_KnownLive(self)(self)->SetWritableUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3802 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnsignedLongLong setter"
)), 0))
) {
3803 return false;
3804 }
3805 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3805); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3805; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3806
3807 return true;
3808}
3809
3810static const JSJitInfo writableUnsignedLongLong_getterinfo = {
3811 { get_writableUnsignedLongLong },
3812 { prototypes::id::TestJSImplInterface },
3813 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3814 JSJitInfo::Getter,
3815 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3816 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3817 false, /* isInfallible. False in setters. */
3818 false, /* isMovable. Not relevant for setters. */
3819 false, /* isEliminatable. Not relevant for setters. */
3820 false, /* isAlwaysInSlot. Only relevant for getters. */
3821 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3822 false, /* isTypedMethod. Only relevant for methods. */
3823 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3824};
3825static const JSJitInfo writableUnsignedLongLong_setterinfo = {
3826 { (JSJitGetterOp)set_writableUnsignedLongLong },
3827 { prototypes::id::TestJSImplInterface },
3828 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3829 JSJitInfo::Setter,
3830 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3831 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3832 false, /* isInfallible. False in setters. */
3833 false, /* isMovable. Not relevant for setters. */
3834 false, /* isEliminatable. Not relevant for setters. */
3835 false, /* isAlwaysInSlot. Only relevant for getters. */
3836 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3837 false, /* isTypedMethod. Only relevant for methods. */
3838 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3839};
3840
3841MOZ_CAN_RUN_SCRIPT static bool
3842passUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3843{
3844 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3847( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3845 "TestJSImplInterface", "passUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3847( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3846 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3847( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3847 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3847( cx, "TestJSImplInterface"
, "passUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3848
3849 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3850 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnsignedLongLong", 1)) {
3851 return false;
3852 }
3853 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3854 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3855 if (objIsXray) {
3856 unwrappedObj.emplace(cx, obj);
3857 }
3858 uint64_t arg0;
3859 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
3860 return false;
3861 }
3862 if (objIsXray) {
3863 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3864 // we know Xrays have no dynamic unwrap behavior.
3865 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3866 if (!unwrappedObj.ref()) {
3867 return false;
3868 }
3869 }
3870 FastErrorResult rv;
3871 // NOTE: This assert does NOT call the function.
3872 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3873 MOZ_KnownLive(self)(self)->PassUnsignedLongLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3874 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnsignedLongLong"
)), 0))
) {
3875 return false;
3876 }
3877 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3877); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3877; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3878 args.rval().setUndefined();
3879 return true;
3880}
3881
3882static const JSJitInfo passUnsignedLongLong_methodinfo = {
3883 { (JSJitGetterOp)passUnsignedLongLong },
3884 { prototypes::id::TestJSImplInterface },
3885 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3886 JSJitInfo::Method,
3887 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3888 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3889 false, /* isInfallible. False in setters. */
3890 false, /* isMovable. Not relevant for setters. */
3891 false, /* isEliminatable. Not relevant for setters. */
3892 false, /* isAlwaysInSlot. Only relevant for getters. */
3893 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3894 false, /* isTypedMethod. Only relevant for methods. */
3895 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3896};
3897
3898MOZ_CAN_RUN_SCRIPT static bool
3899receiveUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3900{
3901 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3904( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3902 "TestJSImplInterface", "receiveUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3904( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3903 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3904( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
3904 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3904( cx, "TestJSImplInterface"
, "receiveUnsignedLongLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
3905
3906 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3907 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3908 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3909 if (objIsXray) {
3910 unwrappedObj.emplace(cx, obj);
3911 }
3912 if (objIsXray) {
3913 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3914 // we know Xrays have no dynamic unwrap behavior.
3915 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3916 if (!unwrappedObj.ref()) {
3917 return false;
3918 }
3919 }
3920 FastErrorResult rv;
3921 uint64_t result(MOZ_KnownLive(self)(self)->ReceiveUnsignedLongLong(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3922 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnsignedLongLong"
)), 0))
) {
3923 return false;
3924 }
3925 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3925); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3925; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3926 args.rval().set(JS_NumberValue(double(result)));
3927 return true;
3928}
3929
3930static const JSJitInfo receiveUnsignedLongLong_methodinfo = {
3931 { (JSJitGetterOp)receiveUnsignedLongLong },
3932 { prototypes::id::TestJSImplInterface },
3933 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3934 JSJitInfo::Method,
3935 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3936 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
3937 false, /* isInfallible. False in setters. */
3938 false, /* isMovable. Not relevant for setters. */
3939 false, /* isEliminatable. Not relevant for setters. */
3940 false, /* isAlwaysInSlot. Only relevant for getters. */
3941 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3942 false, /* isTypedMethod. Only relevant for methods. */
3943 0 /* Reserved slot index, if we're stored in a slot, else 0. */
3944};
3945
3946MOZ_CAN_RUN_SCRIPT static bool
3947passOptionalUnsignedLongLong(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
3948{
3949 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject3952( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3950 "TestJSImplInterface", "passOptionalUnsignedLongLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject3952( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3951 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject3952( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
3952 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject3952( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLong", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
3953
3954 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
3955 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
3956 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
3957 if (objIsXray) {
3958 unwrappedObj.emplace(cx, obj);
3959 }
3960 Optional<uint64_t> arg0;
3961 if (args.hasDefined(0)) {
3962 arg0.Construct();
3963 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
3964 return false;
3965 }
3966 }
3967 if (objIsXray) {
3968 // Since our object is an Xray, we can just CheckedUnwrapStatic:
3969 // we know Xrays have no dynamic unwrap behavior.
3970 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
3971 if (!unwrappedObj.ref()) {
3972 return false;
3973 }
3974 }
3975 FastErrorResult rv;
3976 // NOTE: This assert does NOT call the function.
3977 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
3978 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
3979 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLong"
)), 0))
) {
3980 return false;
3981 }
3982 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 3982); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 3982; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
3983 args.rval().setUndefined();
3984 return true;
3985}
3986
3987static const JSJitInfo passOptionalUnsignedLongLong_methodinfo = {
3988 { (JSJitGetterOp)passOptionalUnsignedLongLong },
3989 { prototypes::id::TestJSImplInterface },
3990 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
3991 JSJitInfo::Method,
3992 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
3993 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
3994 false, /* isInfallible. False in setters. */
3995 false, /* isMovable. Not relevant for setters. */
3996 false, /* isEliminatable. Not relevant for setters. */
3997 false, /* isAlwaysInSlot. Only relevant for getters. */
3998 false, /* isLazilyCachedInSlot. Only relevant for getters. */
3999 false, /* isTypedMethod. Only relevant for methods. */
4000 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4001};
4002
4003MOZ_CAN_RUN_SCRIPT static bool
4004passOptionalUnsignedLongLongWithDefault(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
4005{
4006 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4009( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4007 "TestJSImplInterface", "passOptionalUnsignedLongLongWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4009( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4008 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4009( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4009 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4009( cx, "TestJSImplInterface"
, "passOptionalUnsignedLongLongWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4010
4011 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4012 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4013 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4014 if (objIsXray) {
4015 unwrappedObj.emplace(cx, obj);
4016 }
4017 uint64_t arg0;
4018 if (args.hasDefined(0)) {
4019 if (!ValueToPrimitive<uint64_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
4020 return false;
4021 }
4022 } else {
4023 arg0 = 17ULL;
4024 }
4025 if (objIsXray) {
4026 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4027 // we know Xrays have no dynamic unwrap behavior.
4028 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4029 if (!unwrappedObj.ref()) {
4030 return false;
4031 }
4032 }
4033 FastErrorResult rv;
4034 // NOTE: This assert does NOT call the function.
4035 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4036 MOZ_KnownLive(self)(self)->PassOptionalUnsignedLongLongWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4037 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault"
)), 0))
) {
4038 return false;
4039 }
4040 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4040); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4040; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4041 args.rval().setUndefined();
4042 return true;
4043}
4044
4045static const JSJitInfo passOptionalUnsignedLongLongWithDefault_methodinfo = {
4046 { (JSJitGetterOp)passOptionalUnsignedLongLongWithDefault },
4047 { prototypes::id::TestJSImplInterface },
4048 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4049 JSJitInfo::Method,
4050 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4051 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4052 false, /* isInfallible. False in setters. */
4053 false, /* isMovable. Not relevant for setters. */
4054 false, /* isEliminatable. Not relevant for setters. */
4055 false, /* isAlwaysInSlot. Only relevant for getters. */
4056 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4057 false, /* isTypedMethod. Only relevant for methods. */
4058 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4059};
4060
4061MOZ_CAN_RUN_SCRIPT static bool
4062get_writableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4063{
4064 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4067( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4065 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4067( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4066 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4067( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4067 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4067( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4068
4069 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4070 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4071 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4072 if (objIsXray) {
4073 unwrappedObj.emplace(cx, obj);
4074 }
4075 if (objIsXray) {
4076 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4077 // we know Xrays have no dynamic unwrap behavior.
4078 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4079 if (!unwrappedObj.ref()) {
4080 return false;
4081 }
4082 }
4083 FastErrorResult rv;
4084 float result(MOZ_KnownLive(self)(self)->GetWritableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4085 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat getter"
)), 0))
) {
4086 return false;
4087 }
4088 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4088); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4088; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4089 args.rval().set(JS_NumberValue(double(result)));
4090 return true;
4091}
4092
4093MOZ_CAN_RUN_SCRIPT static bool
4094set_writableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4095{
4096 BindingCallContext cx(cx_, "TestJSImplInterface.writableFloat setter");
4097 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4100( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4098 "TestJSImplInterface", "writableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4100( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4099 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4100( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4100 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4100( cx, "TestJSImplInterface"
, "writableFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4101
4102 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4103 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4104 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4105 if (objIsXray) {
4106 unwrappedObj.emplace(cx, obj);
4107 }
4108 float arg0;
4109 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4110 return false;
4111 } else if (!std::isfinite(arg0)) {
4112 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4113 return false;
4114 }
4115 if (objIsXray) {
4116 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4117 // we know Xrays have no dynamic unwrap behavior.
4118 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4119 if (!unwrappedObj.ref()) {
4120 return false;
4121 }
4122 }
4123 FastErrorResult rv;
4124 // NOTE: This assert does NOT call the function.
4125 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4126 MOZ_KnownLive(self)(self)->SetWritableFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4127 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableFloat setter"
)), 0))
) {
4128 return false;
4129 }
4130 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4130); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4130; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4131
4132 return true;
4133}
4134
4135static const JSJitInfo writableFloat_getterinfo = {
4136 { get_writableFloat },
4137 { prototypes::id::TestJSImplInterface },
4138 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4139 JSJitInfo::Getter,
4140 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4141 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4142 false, /* isInfallible. False in setters. */
4143 false, /* isMovable. Not relevant for setters. */
4144 false, /* isEliminatable. Not relevant for setters. */
4145 false, /* isAlwaysInSlot. Only relevant for getters. */
4146 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4147 false, /* isTypedMethod. Only relevant for methods. */
4148 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4149};
4150static const JSJitInfo writableFloat_setterinfo = {
4151 { (JSJitGetterOp)set_writableFloat },
4152 { prototypes::id::TestJSImplInterface },
4153 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4154 JSJitInfo::Setter,
4155 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4156 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4157 false, /* isInfallible. False in setters. */
4158 false, /* isMovable. Not relevant for setters. */
4159 false, /* isEliminatable. Not relevant for setters. */
4160 false, /* isAlwaysInSlot. Only relevant for getters. */
4161 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4162 false, /* isTypedMethod. Only relevant for methods. */
4163 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4164};
4165
4166MOZ_CAN_RUN_SCRIPT static bool
4167get_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4168{
4169 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4172( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4170 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4172( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4171 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4172( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4172 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4172( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4173
4174 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4175 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4176 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4177 if (objIsXray) {
4178 unwrappedObj.emplace(cx, obj);
4179 }
4180 if (objIsXray) {
4181 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4182 // we know Xrays have no dynamic unwrap behavior.
4183 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4184 if (!unwrappedObj.ref()) {
4185 return false;
4186 }
4187 }
4188 FastErrorResult rv;
4189 float result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4190 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat getter"
)), 0))
) {
4191 return false;
4192 }
4193 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4193); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4193; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4194 args.rval().set(JS_NumberValue(double(result)));
4195 return true;
4196}
4197
4198MOZ_CAN_RUN_SCRIPT static bool
4199set_writableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4200{
4201 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4204( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4202 "TestJSImplInterface", "writableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4204( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4203 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4204( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4204 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4204( cx, "TestJSImplInterface"
, "writableUnrestrictedFloat", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4205
4206 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4207 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4208 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4209 if (objIsXray) {
4210 unwrappedObj.emplace(cx, obj);
4211 }
4212 float arg0;
4213 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4214 return false;
4215 }
4216 if (objIsXray) {
4217 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4218 // we know Xrays have no dynamic unwrap behavior.
4219 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4220 if (!unwrappedObj.ref()) {
4221 return false;
4222 }
4223 }
4224 FastErrorResult rv;
4225 // NOTE: This assert does NOT call the function.
4226 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4227 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedFloat(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4228 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedFloat setter"
)), 0))
) {
4229 return false;
4230 }
4231 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4231); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4231; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4232
4233 return true;
4234}
4235
4236static const JSJitInfo writableUnrestrictedFloat_getterinfo = {
4237 { get_writableUnrestrictedFloat },
4238 { prototypes::id::TestJSImplInterface },
4239 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4240 JSJitInfo::Getter,
4241 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4242 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4243 false, /* isInfallible. False in setters. */
4244 false, /* isMovable. Not relevant for setters. */
4245 false, /* isEliminatable. Not relevant for setters. */
4246 false, /* isAlwaysInSlot. Only relevant for getters. */
4247 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4248 false, /* isTypedMethod. Only relevant for methods. */
4249 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4250};
4251static const JSJitInfo writableUnrestrictedFloat_setterinfo = {
4252 { (JSJitGetterOp)set_writableUnrestrictedFloat },
4253 { prototypes::id::TestJSImplInterface },
4254 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4255 JSJitInfo::Setter,
4256 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4257 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4258 false, /* isInfallible. False in setters. */
4259 false, /* isMovable. Not relevant for setters. */
4260 false, /* isEliminatable. Not relevant for setters. */
4261 false, /* isAlwaysInSlot. Only relevant for getters. */
4262 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4263 false, /* isTypedMethod. Only relevant for methods. */
4264 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4265};
4266
4267MOZ_CAN_RUN_SCRIPT static bool
4268get_writableNullableFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4269{
4270 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4273( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4271 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4273( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4272 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4273( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4273 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4273( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4274
4275 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4276 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4277 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4278 if (objIsXray) {
4279 unwrappedObj.emplace(cx, obj);
4280 }
4281 if (objIsXray) {
4282 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4283 // we know Xrays have no dynamic unwrap behavior.
4284 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4285 if (!unwrappedObj.ref()) {
4286 return false;
4287 }
4288 }
4289 FastErrorResult rv;
4290 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4291 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat getter"
)), 0))
) {
4292 return false;
4293 }
4294 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4294); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4294; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4295 if (result.IsNull()) {
4296 args.rval().setNull();
4297 return true;
4298 }
4299 args.rval().set(JS_NumberValue(double(result.Value())));
4300 return true;
4301}
4302
4303MOZ_CAN_RUN_SCRIPT static bool
4304set_writableNullableFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4305{
4306 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableFloat setter");
4307 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4310( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4308 "TestJSImplInterface", "writableNullableFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4310( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4309 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4310( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4310 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4310( cx, "TestJSImplInterface"
, "writableNullableFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4311
4312 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4313 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4314 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4315 if (objIsXray) {
4316 unwrappedObj.emplace(cx, obj);
4317 }
4318 Nullable<float> arg0;
4319 if (args[0].isNullOrUndefined()) {
4320 arg0.SetNull();
4321 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4322 return false;
4323 } else if (!std::isfinite(arg0.Value())) {
4324 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4325 return false;
4326 }
4327 if (objIsXray) {
4328 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4329 // we know Xrays have no dynamic unwrap behavior.
4330 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4331 if (!unwrappedObj.ref()) {
4332 return false;
4333 }
4334 }
4335 FastErrorResult rv;
4336 // NOTE: This assert does NOT call the function.
4337 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4338 MOZ_KnownLive(self)(self)->SetWritableNullableFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4339 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableFloat setter"
)), 0))
) {
4340 return false;
4341 }
4342 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4342; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4343
4344 return true;
4345}
4346
4347static const JSJitInfo writableNullableFloat_getterinfo = {
4348 { get_writableNullableFloat },
4349 { prototypes::id::TestJSImplInterface },
4350 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4351 JSJitInfo::Getter,
4352 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4353 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4354 false, /* isInfallible. False in setters. */
4355 false, /* isMovable. Not relevant for setters. */
4356 false, /* isEliminatable. Not relevant for setters. */
4357 false, /* isAlwaysInSlot. Only relevant for getters. */
4358 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4359 false, /* isTypedMethod. Only relevant for methods. */
4360 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4361};
4362static const JSJitInfo writableNullableFloat_setterinfo = {
4363 { (JSJitGetterOp)set_writableNullableFloat },
4364 { prototypes::id::TestJSImplInterface },
4365 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4366 JSJitInfo::Setter,
4367 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4368 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4369 false, /* isInfallible. False in setters. */
4370 false, /* isMovable. Not relevant for setters. */
4371 false, /* isEliminatable. Not relevant for setters. */
4372 false, /* isAlwaysInSlot. Only relevant for getters. */
4373 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4374 false, /* isTypedMethod. Only relevant for methods. */
4375 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4376};
4377
4378MOZ_CAN_RUN_SCRIPT static bool
4379get_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4380{
4381 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4384( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4382 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4384( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4383 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4384( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4384 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4384( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4385
4386 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4387 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4388 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4389 if (objIsXray) {
4390 unwrappedObj.emplace(cx, obj);
4391 }
4392 if (objIsXray) {
4393 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4394 // we know Xrays have no dynamic unwrap behavior.
4395 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4396 if (!unwrappedObj.ref()) {
4397 return false;
4398 }
4399 }
4400 FastErrorResult rv;
4401 Nullable<float> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedFloat(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4402 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat getter"
)), 0))
) {
4403 return false;
4404 }
4405 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4405); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4405; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4406 if (result.IsNull()) {
4407 args.rval().setNull();
4408 return true;
4409 }
4410 args.rval().set(JS_NumberValue(double(result.Value())));
4411 return true;
4412}
4413
4414MOZ_CAN_RUN_SCRIPT static bool
4415set_writableNullableUnrestrictedFloat(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4416{
4417 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4420( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4418 "TestJSImplInterface", "writableNullableUnrestrictedFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4420( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4419 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4420( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4420 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4420( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedFloat", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4421
4422 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4423 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4424 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4425 if (objIsXray) {
4426 unwrappedObj.emplace(cx, obj);
4427 }
4428 Nullable<float> arg0;
4429 if (args[0].isNullOrUndefined()) {
4430 arg0.SetNull();
4431 } else if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4432 return false;
4433 }
4434 if (objIsXray) {
4435 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4436 // we know Xrays have no dynamic unwrap behavior.
4437 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4438 if (!unwrappedObj.ref()) {
4439 return false;
4440 }
4441 }
4442 FastErrorResult rv;
4443 // NOTE: This assert does NOT call the function.
4444 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4445 MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedFloat(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4446 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedFloat setter"
)), 0))
) {
4447 return false;
4448 }
4449 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4449); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4449; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4450
4451 return true;
4452}
4453
4454static const JSJitInfo writableNullableUnrestrictedFloat_getterinfo = {
4455 { get_writableNullableUnrestrictedFloat },
4456 { prototypes::id::TestJSImplInterface },
4457 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4458 JSJitInfo::Getter,
4459 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4460 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4461 false, /* isInfallible. False in setters. */
4462 false, /* isMovable. Not relevant for setters. */
4463 false, /* isEliminatable. Not relevant for setters. */
4464 false, /* isAlwaysInSlot. Only relevant for getters. */
4465 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4466 false, /* isTypedMethod. Only relevant for methods. */
4467 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4468};
4469static const JSJitInfo writableNullableUnrestrictedFloat_setterinfo = {
4470 { (JSJitGetterOp)set_writableNullableUnrestrictedFloat },
4471 { prototypes::id::TestJSImplInterface },
4472 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4473 JSJitInfo::Setter,
4474 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4475 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4476 false, /* isInfallible. False in setters. */
4477 false, /* isMovable. Not relevant for setters. */
4478 false, /* isEliminatable. Not relevant for setters. */
4479 false, /* isAlwaysInSlot. Only relevant for getters. */
4480 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4481 false, /* isTypedMethod. Only relevant for methods. */
4482 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4483};
4484
4485MOZ_CAN_RUN_SCRIPT static bool
4486get_writableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4487{
4488 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4491( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4489 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4491( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4490 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4491( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4491 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4491( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4492
4493 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4494 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4495 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4496 if (objIsXray) {
4497 unwrappedObj.emplace(cx, obj);
4498 }
4499 if (objIsXray) {
4500 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4501 // we know Xrays have no dynamic unwrap behavior.
4502 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4503 if (!unwrappedObj.ref()) {
4504 return false;
4505 }
4506 }
4507 FastErrorResult rv;
4508 double result(MOZ_KnownLive(self)(self)->GetWritableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4509 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble getter"
)), 0))
) {
4510 return false;
4511 }
4512 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4512; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4513 args.rval().set(JS_NumberValue(double(result)));
4514 return true;
4515}
4516
4517MOZ_CAN_RUN_SCRIPT static bool
4518set_writableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4519{
4520 BindingCallContext cx(cx_, "TestJSImplInterface.writableDouble setter");
4521 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4524( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4522 "TestJSImplInterface", "writableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4524( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4523 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4524( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4524 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4524( cx, "TestJSImplInterface"
, "writableDouble", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4525
4526 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4527 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4528 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4529 if (objIsXray) {
4530 unwrappedObj.emplace(cx, obj);
4531 }
4532 double arg0;
4533 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4534 return false;
4535 } else if (!std::isfinite(arg0)) {
4536 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4537 return false;
4538 }
4539 if (objIsXray) {
4540 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4541 // we know Xrays have no dynamic unwrap behavior.
4542 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4543 if (!unwrappedObj.ref()) {
4544 return false;
4545 }
4546 }
4547 FastErrorResult rv;
4548 // NOTE: This assert does NOT call the function.
4549 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4550 MOZ_KnownLive(self)(self)->SetWritableDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4551 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableDouble setter"
)), 0))
) {
4552 return false;
4553 }
4554 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4554); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4554; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4555
4556 return true;
4557}
4558
4559static const JSJitInfo writableDouble_getterinfo = {
4560 { get_writableDouble },
4561 { prototypes::id::TestJSImplInterface },
4562 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4563 JSJitInfo::Getter,
4564 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4565 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4566 false, /* isInfallible. False in setters. */
4567 false, /* isMovable. Not relevant for setters. */
4568 false, /* isEliminatable. Not relevant for setters. */
4569 false, /* isAlwaysInSlot. Only relevant for getters. */
4570 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4571 false, /* isTypedMethod. Only relevant for methods. */
4572 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4573};
4574static const JSJitInfo writableDouble_setterinfo = {
4575 { (JSJitGetterOp)set_writableDouble },
4576 { prototypes::id::TestJSImplInterface },
4577 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4578 JSJitInfo::Setter,
4579 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4580 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4581 false, /* isInfallible. False in setters. */
4582 false, /* isMovable. Not relevant for setters. */
4583 false, /* isEliminatable. Not relevant for setters. */
4584 false, /* isAlwaysInSlot. Only relevant for getters. */
4585 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4586 false, /* isTypedMethod. Only relevant for methods. */
4587 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4588};
4589
4590MOZ_CAN_RUN_SCRIPT static bool
4591get_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4592{
4593 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4596( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4594 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4596( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4595 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4596( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4596 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4596( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4597
4598 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4599 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4600 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4601 if (objIsXray) {
4602 unwrappedObj.emplace(cx, obj);
4603 }
4604 if (objIsXray) {
4605 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4606 // we know Xrays have no dynamic unwrap behavior.
4607 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4608 if (!unwrappedObj.ref()) {
4609 return false;
4610 }
4611 }
4612 FastErrorResult rv;
4613 double result(MOZ_KnownLive(self)(self)->GetWritableUnrestrictedDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4614 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble getter"
)), 0))
) {
4615 return false;
4616 }
4617 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4617); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4617; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4618 args.rval().set(JS_NumberValue(double(result)));
4619 return true;
4620}
4621
4622MOZ_CAN_RUN_SCRIPT static bool
4623set_writableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4624{
4625 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4628( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4626 "TestJSImplInterface", "writableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4628( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4627 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4628( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4628 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4628( cx, "TestJSImplInterface"
, "writableUnrestrictedDouble", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4629
4630 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4631 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4632 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4633 if (objIsXray) {
4634 unwrappedObj.emplace(cx, obj);
4635 }
4636 double arg0;
4637 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
4638 return false;
4639 }
4640 if (objIsXray) {
4641 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4642 // we know Xrays have no dynamic unwrap behavior.
4643 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4644 if (!unwrappedObj.ref()) {
4645 return false;
4646 }
4647 }
4648 FastErrorResult rv;
4649 // NOTE: This assert does NOT call the function.
4650 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4651 MOZ_KnownLive(self)(self)->SetWritableUnrestrictedDouble(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4652 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnrestrictedDouble setter"
)), 0))
) {
4653 return false;
4654 }
4655 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4655); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4655; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4656
4657 return true;
4658}
4659
4660static const JSJitInfo writableUnrestrictedDouble_getterinfo = {
4661 { get_writableUnrestrictedDouble },
4662 { prototypes::id::TestJSImplInterface },
4663 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4664 JSJitInfo::Getter,
4665 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4666 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
4667 false, /* isInfallible. False in setters. */
4668 false, /* isMovable. Not relevant for setters. */
4669 false, /* isEliminatable. Not relevant for setters. */
4670 false, /* isAlwaysInSlot. Only relevant for getters. */
4671 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4672 false, /* isTypedMethod. Only relevant for methods. */
4673 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4674};
4675static const JSJitInfo writableUnrestrictedDouble_setterinfo = {
4676 { (JSJitGetterOp)set_writableUnrestrictedDouble },
4677 { prototypes::id::TestJSImplInterface },
4678 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4679 JSJitInfo::Setter,
4680 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4681 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4682 false, /* isInfallible. False in setters. */
4683 false, /* isMovable. Not relevant for setters. */
4684 false, /* isEliminatable. Not relevant for setters. */
4685 false, /* isAlwaysInSlot. Only relevant for getters. */
4686 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4687 false, /* isTypedMethod. Only relevant for methods. */
4688 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4689};
4690
4691MOZ_CAN_RUN_SCRIPT static bool
4692get_writableNullableDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4693{
4694 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4697( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4695 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4697( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4696 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4697( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4697 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4697( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4698
4699 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4700 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4701 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4702 if (objIsXray) {
4703 unwrappedObj.emplace(cx, obj);
4704 }
4705 if (objIsXray) {
4706 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4707 // we know Xrays have no dynamic unwrap behavior.
4708 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4709 if (!unwrappedObj.ref()) {
4710 return false;
4711 }
4712 }
4713 FastErrorResult rv;
4714 Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4715 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble getter"
)), 0))
) {
4716 return false;
4717 }
4718 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4718); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4718; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4719 if (result.IsNull()) {
4720 args.rval().setNull();
4721 return true;
4722 }
4723 args.rval().set(JS_NumberValue(double(result.Value())));
4724 return true;
4725}
4726
4727MOZ_CAN_RUN_SCRIPT static bool
4728set_writableNullableDouble(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4729{
4730 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableDouble setter");
4731 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4734( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4732 "TestJSImplInterface", "writableNullableDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4734( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4733 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4734( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
4734 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4734( cx, "TestJSImplInterface"
, "writableNullableDouble", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
4735
4736 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4737 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4738 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4739 if (objIsXray) {
4740 unwrappedObj.emplace(cx, obj);
4741 }
4742 Nullable<double> arg0;
4743 if (args[0].isNullOrUndefined()) {
4744 arg0.SetNull();
4745 } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4746 return false;
4747 } else if (!std::isfinite(arg0.Value())) {
4748 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Value being assigned");
4749 return false;
4750 }
4751 if (objIsXray) {
4752 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4753 // we know Xrays have no dynamic unwrap behavior.
4754 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4755 if (!unwrappedObj.ref()) {
4756 return false;
4757 }
4758 }
4759 FastErrorResult rv;
4760 // NOTE: This assert does NOT call the function.
4761 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4762 MOZ_KnownLive(self)(self)->SetWritableNullableDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4763 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableDouble setter"
)), 0))
) {
4764 return false;
4765 }
4766 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4766); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4766; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4767
4768 return true;
4769}
4770
4771static const JSJitInfo writableNullableDouble_getterinfo = {
4772 { get_writableNullableDouble },
4773 { prototypes::id::TestJSImplInterface },
4774 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4775 JSJitInfo::Getter,
4776 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4777 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4778 false, /* isInfallible. False in setters. */
4779 false, /* isMovable. Not relevant for setters. */
4780 false, /* isEliminatable. Not relevant for setters. */
4781 false, /* isAlwaysInSlot. Only relevant for getters. */
4782 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4783 false, /* isTypedMethod. Only relevant for methods. */
4784 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4785};
4786static const JSJitInfo writableNullableDouble_setterinfo = {
4787 { (JSJitGetterOp)set_writableNullableDouble },
4788 { prototypes::id::TestJSImplInterface },
4789 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4790 JSJitInfo::Setter,
4791 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4792 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4793 false, /* isInfallible. False in setters. */
4794 false, /* isMovable. Not relevant for setters. */
4795 false, /* isEliminatable. Not relevant for setters. */
4796 false, /* isAlwaysInSlot. Only relevant for getters. */
4797 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4798 false, /* isTypedMethod. Only relevant for methods. */
4799 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4800};
4801
4802MOZ_CAN_RUN_SCRIPT static bool
4803get_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
4804{
4805 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4808( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4806 "TestJSImplInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4808( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4807 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject4808( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4808 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4808( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4809
4810 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4811 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4812 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4813 if (objIsXray) {
4814 unwrappedObj.emplace(cx, obj);
4815 }
4816 if (objIsXray) {
4817 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4818 // we know Xrays have no dynamic unwrap behavior.
4819 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4820 if (!unwrappedObj.ref()) {
4821 return false;
4822 }
4823 }
4824 FastErrorResult rv;
4825 Nullable<double> result(MOZ_KnownLive(self)(self)->GetWritableNullableUnrestrictedDouble(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
4826 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble getter"
)), 0))
) {
4827 return false;
4828 }
4829 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4829); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4829; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4830 if (result.IsNull()) {
4831 args.rval().setNull();
4832 return true;
4833 }
4834 args.rval().set(JS_NumberValue(double(result.Value())));
4835 return true;
4836}
4837
4838MOZ_CAN_RUN_SCRIPT static bool
4839set_writableNullableUnrestrictedDouble(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
4840{
4841 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4844( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4842 "TestJSImplInterface", "writableNullableUnrestrictedDouble", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4844( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4843 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject4844( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
4844 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4844( cx, "TestJSImplInterface"
, "writableNullableUnrestrictedDouble", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
4845
4846 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4847 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4848 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4849 if (objIsXray) {
4850 unwrappedObj.emplace(cx, obj);
4851 }
4852 Nullable<double> arg0;
4853 if (args[0].isNullOrUndefined()) {
4854 arg0.SetNull();
4855 } else if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
4856 return false;
4857 }
4858 if (objIsXray) {
4859 // Since our object is an Xray, we can just CheckedUnwrapStatic:
4860 // we know Xrays have no dynamic unwrap behavior.
4861 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
4862 if (!unwrappedObj.ref()) {
4863 return false;
4864 }
4865 }
4866 FastErrorResult rv;
4867 // NOTE: This assert does NOT call the function.
4868 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
4869 MOZ_KnownLive(self)(self)->SetWritableNullableUnrestrictedDouble(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
4870 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnrestrictedDouble setter"
)), 0))
) {
4871 return false;
4872 }
4873 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 4873); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 4873; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
4874
4875 return true;
4876}
4877
4878static const JSJitInfo writableNullableUnrestrictedDouble_getterinfo = {
4879 { get_writableNullableUnrestrictedDouble },
4880 { prototypes::id::TestJSImplInterface },
4881 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4882 JSJitInfo::Getter,
4883 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4884 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
4885 false, /* isInfallible. False in setters. */
4886 false, /* isMovable. Not relevant for setters. */
4887 false, /* isEliminatable. Not relevant for setters. */
4888 false, /* isAlwaysInSlot. Only relevant for getters. */
4889 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4890 false, /* isTypedMethod. Only relevant for methods. */
4891 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4892};
4893static const JSJitInfo writableNullableUnrestrictedDouble_setterinfo = {
4894 { (JSJitGetterOp)set_writableNullableUnrestrictedDouble },
4895 { prototypes::id::TestJSImplInterface },
4896 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
4897 JSJitInfo::Setter,
4898 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
4899 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
4900 false, /* isInfallible. False in setters. */
4901 false, /* isMovable. Not relevant for setters. */
4902 false, /* isEliminatable. Not relevant for setters. */
4903 false, /* isAlwaysInSlot. Only relevant for getters. */
4904 false, /* isLazilyCachedInSlot. Only relevant for getters. */
4905 false, /* isTypedMethod. Only relevant for methods. */
4906 0 /* Reserved slot index, if we're stored in a slot, else 0. */
4907};
4908
4909MOZ_CAN_RUN_SCRIPT static bool
4910passFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
4911{
4912 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat");
4913 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject4916( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4914 "TestJSImplInterface", "passFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject4916( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4915 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject4916( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
4916 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject4916( cx, "TestJSImplInterface"
, "passFloat", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
4917
4918 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
4919 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat", 16)) {
4920 return false;
4921 }
4922 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
4923 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
4924 if (objIsXray) {
4925 unwrappedObj.emplace(cx, obj);
4926 }
4927 float arg0;
4928 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
4929 return false;
4930 } else if (!std::isfinite(arg0)) {
4931 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 1");
4932 return false;
4933 }
4934 float arg1;
4935 if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
4936 return false;
4937 }
4938 Nullable<float> arg2;
4939 if (args[2].isNullOrUndefined()) {
4940 arg2.SetNull();
4941 } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
4942 return false;
4943 } else if (!std::isfinite(arg2.Value())) {
4944 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 3");
4945 return false;
4946 }
4947 Nullable<float> arg3;
4948 if (args[3].isNullOrUndefined()) {
4949 arg3.SetNull();
4950 } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) {
4951 return false;
4952 }
4953 double arg4;
4954 if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) {
4955 return false;
4956 } else if (!std::isfinite(arg4)) {
4957 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5");
4958 return false;
4959 }
4960 double arg5;
4961 if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) {
4962 return false;
4963 }
4964 Nullable<double> arg6;
4965 if (args[6].isNullOrUndefined()) {
4966 arg6.SetNull();
4967 } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) {
4968 return false;
4969 } else if (!std::isfinite(arg6.Value())) {
4970 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 7");
4971 return false;
4972 }
4973 Nullable<double> arg7;
4974 if (args[7].isNullOrUndefined()) {
4975 arg7.SetNull();
4976 } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) {
4977 return false;
4978 }
4979 binding_detail::AutoSequence<float> arg8;
4980 if (args[8].isObject()) {
4981 JS::ForOfIterator iter(cx);
4982 if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) {
4983 return false;
4984 }
4985 if (!iter.valueIsIterable()) {
4986 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
4987 return false;
4988 }
4989 binding_detail::AutoSequence<float> &arr = arg8;
4990 JS::Rooted<JS::Value> temp(cx);
4991 while (true) {
4992 bool done;
4993 if (!iter.next(&temp, &done)) {
4994 return false;
4995 }
4996 if (done) {
4997 break;
4998 }
4999 float* slotPtr = arr.AppendElement(mozilla::fallible);
5000 if (!slotPtr) {
5001 JS_ReportOutOfMemory(cx);
5002 return false;
5003 }
5004 float& slot = *slotPtr;
5005 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) {
5006 return false;
5007 } else if (!std::isfinite(slot)) {
5008 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 9");
5009 return false;
5010 }
5011 }
5012 } else {
5013 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5014 return false;
5015 }
5016 binding_detail::AutoSequence<float> arg9;
5017 if (args[9].isObject()) {
5018 JS::ForOfIterator iter(cx);
5019 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
5020 return false;
5021 }
5022 if (!iter.valueIsIterable()) {
5023 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5024 return false;
5025 }
5026 binding_detail::AutoSequence<float> &arr = arg9;
5027 JS::Rooted<JS::Value> temp(cx);
5028 while (true) {
5029 bool done;
5030 if (!iter.next(&temp, &done)) {
5031 return false;
5032 }
5033 if (done) {
5034 break;
5035 }
5036 float* slotPtr = arr.AppendElement(mozilla::fallible);
5037 if (!slotPtr) {
5038 JS_ReportOutOfMemory(cx);
5039 return false;
5040 }
5041 float& slot = *slotPtr;
5042 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) {
5043 return false;
5044 }
5045 }
5046 } else {
5047 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5048 return false;
5049 }
5050 binding_detail::AutoSequence<Nullable<float>> arg10;
5051 if (args[10].isObject()) {
5052 JS::ForOfIterator iter(cx);
5053 if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) {
5054 return false;
5055 }
5056 if (!iter.valueIsIterable()) {
5057 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5058 return false;
5059 }
5060 binding_detail::AutoSequence<Nullable<float>> &arr = arg10;
5061 JS::Rooted<JS::Value> temp(cx);
5062 while (true) {
5063 bool done;
5064 if (!iter.next(&temp, &done)) {
5065 return false;
5066 }
5067 if (done) {
5068 break;
5069 }
5070 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5071 if (!slotPtr) {
5072 JS_ReportOutOfMemory(cx);
5073 return false;
5074 }
5075 Nullable<float>& slot = *slotPtr;
5076 if (temp.isNullOrUndefined()) {
5077 slot.SetNull();
5078 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) {
5079 return false;
5080 } else if (!std::isfinite(slot.Value())) {
5081 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 11");
5082 return false;
5083 }
5084 }
5085 } else {
5086 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5087 return false;
5088 }
5089 binding_detail::AutoSequence<Nullable<float>> arg11;
5090 if (args[11].isObject()) {
5091 JS::ForOfIterator iter(cx);
5092 if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) {
5093 return false;
5094 }
5095 if (!iter.valueIsIterable()) {
5096 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5097 return false;
5098 }
5099 binding_detail::AutoSequence<Nullable<float>> &arr = arg11;
5100 JS::Rooted<JS::Value> temp(cx);
5101 while (true) {
5102 bool done;
5103 if (!iter.next(&temp, &done)) {
5104 return false;
5105 }
5106 if (done) {
5107 break;
5108 }
5109 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5110 if (!slotPtr) {
5111 JS_ReportOutOfMemory(cx);
5112 return false;
5113 }
5114 Nullable<float>& slot = *slotPtr;
5115 if (temp.isNullOrUndefined()) {
5116 slot.SetNull();
5117 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) {
5118 return false;
5119 }
5120 }
5121 } else {
5122 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5123 return false;
5124 }
5125 binding_detail::AutoSequence<double> arg12;
5126 if (args[12].isObject()) {
5127 JS::ForOfIterator iter(cx);
5128 if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) {
5129 return false;
5130 }
5131 if (!iter.valueIsIterable()) {
5132 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5133 return false;
5134 }
5135 binding_detail::AutoSequence<double> &arr = arg12;
5136 JS::Rooted<JS::Value> temp(cx);
5137 while (true) {
5138 bool done;
5139 if (!iter.next(&temp, &done)) {
5140 return false;
5141 }
5142 if (done) {
5143 break;
5144 }
5145 double* slotPtr = arr.AppendElement(mozilla::fallible);
5146 if (!slotPtr) {
5147 JS_ReportOutOfMemory(cx);
5148 return false;
5149 }
5150 double& slot = *slotPtr;
5151 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) {
5152 return false;
5153 } else if (!std::isfinite(slot)) {
5154 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 13");
5155 return false;
5156 }
5157 }
5158 } else {
5159 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5160 return false;
5161 }
5162 binding_detail::AutoSequence<double> arg13;
5163 if (args[13].isObject()) {
5164 JS::ForOfIterator iter(cx);
5165 if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) {
5166 return false;
5167 }
5168 if (!iter.valueIsIterable()) {
5169 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5170 return false;
5171 }
5172 binding_detail::AutoSequence<double> &arr = arg13;
5173 JS::Rooted<JS::Value> temp(cx);
5174 while (true) {
5175 bool done;
5176 if (!iter.next(&temp, &done)) {
5177 return false;
5178 }
5179 if (done) {
5180 break;
5181 }
5182 double* slotPtr = arr.AppendElement(mozilla::fallible);
5183 if (!slotPtr) {
5184 JS_ReportOutOfMemory(cx);
5185 return false;
5186 }
5187 double& slot = *slotPtr;
5188 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) {
5189 return false;
5190 }
5191 }
5192 } else {
5193 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5194 return false;
5195 }
5196 binding_detail::AutoSequence<Nullable<double>> arg14;
5197 if (args[14].isObject()) {
5198 JS::ForOfIterator iter(cx);
5199 if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) {
5200 return false;
5201 }
5202 if (!iter.valueIsIterable()) {
5203 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5204 return false;
5205 }
5206 binding_detail::AutoSequence<Nullable<double>> &arr = arg14;
5207 JS::Rooted<JS::Value> temp(cx);
5208 while (true) {
5209 bool done;
5210 if (!iter.next(&temp, &done)) {
5211 return false;
5212 }
5213 if (done) {
5214 break;
5215 }
5216 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5217 if (!slotPtr) {
5218 JS_ReportOutOfMemory(cx);
5219 return false;
5220 }
5221 Nullable<double>& slot = *slotPtr;
5222 if (temp.isNullOrUndefined()) {
5223 slot.SetNull();
5224 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) {
5225 return false;
5226 } else if (!std::isfinite(slot.Value())) {
5227 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Element of argument 15");
5228 return false;
5229 }
5230 }
5231 } else {
5232 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5233 return false;
5234 }
5235 binding_detail::AutoSequence<Nullable<double>> arg15;
5236 if (args[15].isObject()) {
5237 JS::ForOfIterator iter(cx);
5238 if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) {
5239 return false;
5240 }
5241 if (!iter.valueIsIterable()) {
5242 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5243 return false;
5244 }
5245 binding_detail::AutoSequence<Nullable<double>> &arr = arg15;
5246 JS::Rooted<JS::Value> temp(cx);
5247 while (true) {
5248 bool done;
5249 if (!iter.next(&temp, &done)) {
5250 return false;
5251 }
5252 if (done) {
5253 break;
5254 }
5255 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5256 if (!slotPtr) {
5257 JS_ReportOutOfMemory(cx);
5258 return false;
5259 }
5260 Nullable<double>& slot = *slotPtr;
5261 if (temp.isNullOrUndefined()) {
5262 slot.SetNull();
5263 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) {
5264 return false;
5265 }
5266 }
5267 } else {
5268 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5269 return false;
5270 }
5271 if (objIsXray) {
5272 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5273 // we know Xrays have no dynamic unwrap behavior.
5274 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5275 if (!unwrappedObj.ref()) {
5276 return false;
5277 }
5278 }
5279 FastErrorResult rv;
5280 // NOTE: This assert does NOT call the function.
5281 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
5282 MOZ_KnownLive(self)(self)->PassFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5283 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat"
)), 0))
) {
5284 return false;
5285 }
5286 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5286); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5286; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5287 args.rval().setUndefined();
5288 return true;
5289}
5290
5291static const JSJitInfo passFloat_methodinfo = {
5292 { (JSJitGetterOp)passFloat },
5293 { prototypes::id::TestJSImplInterface },
5294 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5295 JSJitInfo::Method,
5296 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5297 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5298 false, /* isInfallible. False in setters. */
5299 false, /* isMovable. Not relevant for setters. */
5300 false, /* isEliminatable. Not relevant for setters. */
5301 false, /* isAlwaysInSlot. Only relevant for getters. */
5302 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5303 false, /* isTypedMethod. Only relevant for methods. */
5304 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5305};
5306
5307MOZ_CAN_RUN_SCRIPT static bool
5308passLenientFloat(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5309{
5310 BindingCallContext cx(cx_, "TestJSImplInterface.passLenientFloat");
5311 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5314( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5312 "TestJSImplInterface", "passLenientFloat", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5314( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5313 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5314( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5314 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5314( cx, "TestJSImplInterface"
, "passLenientFloat", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5315
5316 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5317 if (!args.requireAtLeast(cx, "TestJSImplInterface.passLenientFloat", 16)) {
5318 return false;
5319 }
5320 bool foundNonFiniteFloat = false;
5321 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5322 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5323 if (objIsXray) {
5324 unwrappedObj.emplace(cx, obj);
5325 }
5326 float arg0;
5327 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Argument 1", &arg0)) {
5328 return false;
5329 } else if (!std::isfinite(arg0)) {
5330 foundNonFiniteFloat = true;
5331 }
5332 float arg1;
5333 if (!ValueToPrimitive<float, eDefault>(cx, args[1], "Argument 2", &arg1)) {
5334 return false;
5335 }
5336 Nullable<float> arg2;
5337 if (args[2].isNullOrUndefined()) {
5338 arg2.SetNull();
5339 } else if (!ValueToPrimitive<float, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
5340 return false;
5341 } else if (!std::isfinite(arg2.Value())) {
5342 foundNonFiniteFloat = true;
5343 }
5344 Nullable<float> arg3;
5345 if (args[3].isNullOrUndefined()) {
5346 arg3.SetNull();
5347 } else if (!ValueToPrimitive<float, eDefault>(cx, args[3], "Argument 4", &arg3.SetValue())) {
5348 return false;
5349 }
5350 double arg4;
5351 if (!ValueToPrimitive<double, eDefault>(cx, args[4], "Argument 5", &arg4)) {
5352 return false;
5353 } else if (!std::isfinite(arg4)) {
5354 foundNonFiniteFloat = true;
5355 }
5356 double arg5;
5357 if (!ValueToPrimitive<double, eDefault>(cx, args[5], "Argument 6", &arg5)) {
5358 return false;
5359 }
5360 Nullable<double> arg6;
5361 if (args[6].isNullOrUndefined()) {
5362 arg6.SetNull();
5363 } else if (!ValueToPrimitive<double, eDefault>(cx, args[6], "Argument 7", &arg6.SetValue())) {
5364 return false;
5365 } else if (!std::isfinite(arg6.Value())) {
5366 foundNonFiniteFloat = true;
5367 }
5368 Nullable<double> arg7;
5369 if (args[7].isNullOrUndefined()) {
5370 arg7.SetNull();
5371 } else if (!ValueToPrimitive<double, eDefault>(cx, args[7], "Argument 8", &arg7.SetValue())) {
5372 return false;
5373 }
5374 binding_detail::AutoSequence<float> arg8;
5375 if (args[8].isObject()) {
5376 JS::ForOfIterator iter(cx);
5377 if (!iter.init(args[8], JS::ForOfIterator::AllowNonIterable)) {
5378 return false;
5379 }
5380 if (!iter.valueIsIterable()) {
5381 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5382 return false;
5383 }
5384 binding_detail::AutoSequence<float> &arr = arg8;
5385 JS::Rooted<JS::Value> temp(cx);
5386 while (true) {
5387 bool done;
5388 if (!iter.next(&temp, &done)) {
5389 return false;
5390 }
5391 if (done) {
5392 break;
5393 }
5394 float* slotPtr = arr.AppendElement(mozilla::fallible);
5395 if (!slotPtr) {
5396 JS_ReportOutOfMemory(cx);
5397 return false;
5398 }
5399 float& slot = *slotPtr;
5400 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 9", &slot)) {
5401 return false;
5402 } else if (!std::isfinite(slot)) {
5403 foundNonFiniteFloat = true;
5404 }
5405 }
5406 } else {
5407 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 9", "sequence");
5408 return false;
5409 }
5410 binding_detail::AutoSequence<float> arg9;
5411 if (args[9].isObject()) {
5412 JS::ForOfIterator iter(cx);
5413 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
5414 return false;
5415 }
5416 if (!iter.valueIsIterable()) {
5417 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5418 return false;
5419 }
5420 binding_detail::AutoSequence<float> &arr = arg9;
5421 JS::Rooted<JS::Value> temp(cx);
5422 while (true) {
5423 bool done;
5424 if (!iter.next(&temp, &done)) {
5425 return false;
5426 }
5427 if (done) {
5428 break;
5429 }
5430 float* slotPtr = arr.AppendElement(mozilla::fallible);
5431 if (!slotPtr) {
5432 JS_ReportOutOfMemory(cx);
5433 return false;
5434 }
5435 float& slot = *slotPtr;
5436 if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 10", &slot)) {
5437 return false;
5438 }
5439 }
5440 } else {
5441 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
5442 return false;
5443 }
5444 binding_detail::AutoSequence<Nullable<float>> arg10;
5445 if (args[10].isObject()) {
5446 JS::ForOfIterator iter(cx);
5447 if (!iter.init(args[10], JS::ForOfIterator::AllowNonIterable)) {
5448 return false;
5449 }
5450 if (!iter.valueIsIterable()) {
5451 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5452 return false;
5453 }
5454 binding_detail::AutoSequence<Nullable<float>> &arr = arg10;
5455 JS::Rooted<JS::Value> temp(cx);
5456 while (true) {
5457 bool done;
5458 if (!iter.next(&temp, &done)) {
5459 return false;
5460 }
5461 if (done) {
5462 break;
5463 }
5464 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5465 if (!slotPtr) {
5466 JS_ReportOutOfMemory(cx);
5467 return false;
5468 }
5469 Nullable<float>& slot = *slotPtr;
5470 if (temp.isNullOrUndefined()) {
5471 slot.SetNull();
5472 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 11", &slot.SetValue())) {
5473 return false;
5474 } else if (!std::isfinite(slot.Value())) {
5475 foundNonFiniteFloat = true;
5476 }
5477 }
5478 } else {
5479 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 11", "sequence");
5480 return false;
5481 }
5482 binding_detail::AutoSequence<Nullable<float>> arg11;
5483 if (args[11].isObject()) {
5484 JS::ForOfIterator iter(cx);
5485 if (!iter.init(args[11], JS::ForOfIterator::AllowNonIterable)) {
5486 return false;
5487 }
5488 if (!iter.valueIsIterable()) {
5489 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5490 return false;
5491 }
5492 binding_detail::AutoSequence<Nullable<float>> &arr = arg11;
5493 JS::Rooted<JS::Value> temp(cx);
5494 while (true) {
5495 bool done;
5496 if (!iter.next(&temp, &done)) {
5497 return false;
5498 }
5499 if (done) {
5500 break;
5501 }
5502 Nullable<float>* slotPtr = arr.AppendElement(mozilla::fallible);
5503 if (!slotPtr) {
5504 JS_ReportOutOfMemory(cx);
5505 return false;
5506 }
5507 Nullable<float>& slot = *slotPtr;
5508 if (temp.isNullOrUndefined()) {
5509 slot.SetNull();
5510 } else if (!ValueToPrimitive<float, eDefault>(cx, temp, "Element of argument 12", &slot.SetValue())) {
5511 return false;
5512 }
5513 }
5514 } else {
5515 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 12", "sequence");
5516 return false;
5517 }
5518 binding_detail::AutoSequence<double> arg12;
5519 if (args[12].isObject()) {
5520 JS::ForOfIterator iter(cx);
5521 if (!iter.init(args[12], JS::ForOfIterator::AllowNonIterable)) {
5522 return false;
5523 }
5524 if (!iter.valueIsIterable()) {
5525 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5526 return false;
5527 }
5528 binding_detail::AutoSequence<double> &arr = arg12;
5529 JS::Rooted<JS::Value> temp(cx);
5530 while (true) {
5531 bool done;
5532 if (!iter.next(&temp, &done)) {
5533 return false;
5534 }
5535 if (done) {
5536 break;
5537 }
5538 double* slotPtr = arr.AppendElement(mozilla::fallible);
5539 if (!slotPtr) {
5540 JS_ReportOutOfMemory(cx);
5541 return false;
5542 }
5543 double& slot = *slotPtr;
5544 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 13", &slot)) {
5545 return false;
5546 } else if (!std::isfinite(slot)) {
5547 foundNonFiniteFloat = true;
5548 }
5549 }
5550 } else {
5551 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 13", "sequence");
5552 return false;
5553 }
5554 binding_detail::AutoSequence<double> arg13;
5555 if (args[13].isObject()) {
5556 JS::ForOfIterator iter(cx);
5557 if (!iter.init(args[13], JS::ForOfIterator::AllowNonIterable)) {
5558 return false;
5559 }
5560 if (!iter.valueIsIterable()) {
5561 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5562 return false;
5563 }
5564 binding_detail::AutoSequence<double> &arr = arg13;
5565 JS::Rooted<JS::Value> temp(cx);
5566 while (true) {
5567 bool done;
5568 if (!iter.next(&temp, &done)) {
5569 return false;
5570 }
5571 if (done) {
5572 break;
5573 }
5574 double* slotPtr = arr.AppendElement(mozilla::fallible);
5575 if (!slotPtr) {
5576 JS_ReportOutOfMemory(cx);
5577 return false;
5578 }
5579 double& slot = *slotPtr;
5580 if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 14", &slot)) {
5581 return false;
5582 }
5583 }
5584 } else {
5585 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 14", "sequence");
5586 return false;
5587 }
5588 binding_detail::AutoSequence<Nullable<double>> arg14;
5589 if (args[14].isObject()) {
5590 JS::ForOfIterator iter(cx);
5591 if (!iter.init(args[14], JS::ForOfIterator::AllowNonIterable)) {
5592 return false;
5593 }
5594 if (!iter.valueIsIterable()) {
5595 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5596 return false;
5597 }
5598 binding_detail::AutoSequence<Nullable<double>> &arr = arg14;
5599 JS::Rooted<JS::Value> temp(cx);
5600 while (true) {
5601 bool done;
5602 if (!iter.next(&temp, &done)) {
5603 return false;
5604 }
5605 if (done) {
5606 break;
5607 }
5608 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5609 if (!slotPtr) {
5610 JS_ReportOutOfMemory(cx);
5611 return false;
5612 }
5613 Nullable<double>& slot = *slotPtr;
5614 if (temp.isNullOrUndefined()) {
5615 slot.SetNull();
5616 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 15", &slot.SetValue())) {
5617 return false;
5618 } else if (!std::isfinite(slot.Value())) {
5619 foundNonFiniteFloat = true;
5620 }
5621 }
5622 } else {
5623 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 15", "sequence");
5624 return false;
5625 }
5626 binding_detail::AutoSequence<Nullable<double>> arg15;
5627 if (args[15].isObject()) {
5628 JS::ForOfIterator iter(cx);
5629 if (!iter.init(args[15], JS::ForOfIterator::AllowNonIterable)) {
5630 return false;
5631 }
5632 if (!iter.valueIsIterable()) {
5633 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5634 return false;
5635 }
5636 binding_detail::AutoSequence<Nullable<double>> &arr = arg15;
5637 JS::Rooted<JS::Value> temp(cx);
5638 while (true) {
5639 bool done;
5640 if (!iter.next(&temp, &done)) {
5641 return false;
5642 }
5643 if (done) {
5644 break;
5645 }
5646 Nullable<double>* slotPtr = arr.AppendElement(mozilla::fallible);
5647 if (!slotPtr) {
5648 JS_ReportOutOfMemory(cx);
5649 return false;
5650 }
5651 Nullable<double>& slot = *slotPtr;
5652 if (temp.isNullOrUndefined()) {
5653 slot.SetNull();
5654 } else if (!ValueToPrimitive<double, eDefault>(cx, temp, "Element of argument 16", &slot.SetValue())) {
5655 return false;
5656 }
5657 }
5658 } else {
5659 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 16", "sequence");
5660 return false;
5661 }
5662 if (foundNonFiniteFloat) {
5663 args.rval().setUndefined();
5664 return true;
5665 }
5666 if (objIsXray) {
5667 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5668 // we know Xrays have no dynamic unwrap behavior.
5669 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5670 if (!unwrappedObj.ref()) {
5671 return false;
5672 }
5673 }
5674 FastErrorResult rv;
5675 // NOTE: This assert does NOT call the function.
5676 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassLenientFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
5677 MOZ_KnownLive(self)(self)->PassLenientFloat(arg0, arg1, Constify(arg2), Constify(arg3), arg4, arg5, Constify(arg6), Constify(arg7), Constify(arg8), Constify(arg9), Constify(arg10), Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), Constify(arg15), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5678 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLenientFloat"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passLenientFloat"
)), 0))
) {
5679 return false;
5680 }
5681 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5681); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5681; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5682 args.rval().setUndefined();
5683 return true;
5684}
5685
5686static const JSJitInfo passLenientFloat_methodinfo = {
5687 { (JSJitGetterOp)passLenientFloat },
5688 { prototypes::id::TestJSImplInterface },
5689 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5690 JSJitInfo::Method,
5691 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5692 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5693 false, /* isInfallible. False in setters. */
5694 false, /* isMovable. Not relevant for setters. */
5695 false, /* isEliminatable. Not relevant for setters. */
5696 false, /* isAlwaysInSlot. Only relevant for getters. */
5697 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5698 false, /* isTypedMethod. Only relevant for methods. */
5699 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5700};
5701
5702MOZ_CAN_RUN_SCRIPT static bool
5703get_lenientFloatAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
5704{
5705 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5708( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5706 "TestJSImplInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5708( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5707 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5708( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5708 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5708( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5709
5710 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5711 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5712 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5713 if (objIsXray) {
5714 unwrappedObj.emplace(cx, obj);
5715 }
5716 if (objIsXray) {
5717 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5718 // we know Xrays have no dynamic unwrap behavior.
5719 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5720 if (!unwrappedObj.ref()) {
5721 return false;
5722 }
5723 }
5724 FastErrorResult rv;
5725 float result(MOZ_KnownLive(self)(self)->GetLenientFloatAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
5726 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr getter"
)), 0))
) {
5727 return false;
5728 }
5729 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5729); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5729; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5730 args.rval().set(JS_NumberValue(double(result)));
5731 return true;
5732}
5733
5734MOZ_CAN_RUN_SCRIPT static bool
5735set_lenientFloatAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
5736{
5737 BindingCallContext cx(cx_, "TestJSImplInterface.lenientFloatAttr setter");
5738 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5741( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5739 "TestJSImplInterface", "lenientFloatAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5741( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5740 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5741( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5741 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5741( cx, "TestJSImplInterface"
, "lenientFloatAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5742
5743 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5744 bool foundNonFiniteFloat = false;
5745 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5746 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5747 if (objIsXray) {
5748 unwrappedObj.emplace(cx, obj);
5749 }
5750 float arg0;
5751 if (!ValueToPrimitive<float, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
5752 return false;
5753 } else if (!std::isfinite(arg0)) {
5754 foundNonFiniteFloat = true;
5755 }
5756 if (foundNonFiniteFloat) {
5757 return true;
5758 }
5759 if (objIsXray) {
5760 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5761 // we know Xrays have no dynamic unwrap behavior.
5762 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5763 if (!unwrappedObj.ref()) {
5764 return false;
5765 }
5766 }
5767 FastErrorResult rv;
5768 // NOTE: This assert does NOT call the function.
5769 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetLenientFloatAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
5770 MOZ_KnownLive(self)(self)->SetLenientFloatAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5771 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientFloatAttr setter"
)), 0))
) {
5772 return false;
5773 }
5774 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5774); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5774; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5775
5776 return true;
5777}
5778
5779static const JSJitInfo lenientFloatAttr_getterinfo = {
5780 { get_lenientFloatAttr },
5781 { prototypes::id::TestJSImplInterface },
5782 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5783 JSJitInfo::Getter,
5784 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5785 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
5786 false, /* isInfallible. False in setters. */
5787 false, /* isMovable. Not relevant for setters. */
5788 false, /* isEliminatable. Not relevant for setters. */
5789 false, /* isAlwaysInSlot. Only relevant for getters. */
5790 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5791 false, /* isTypedMethod. Only relevant for methods. */
5792 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5793};
5794static const JSJitInfo lenientFloatAttr_setterinfo = {
5795 { (JSJitGetterOp)set_lenientFloatAttr },
5796 { prototypes::id::TestJSImplInterface },
5797 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5798 JSJitInfo::Setter,
5799 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5800 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5801 false, /* isInfallible. False in setters. */
5802 false, /* isMovable. Not relevant for setters. */
5803 false, /* isEliminatable. Not relevant for setters. */
5804 false, /* isAlwaysInSlot. Only relevant for getters. */
5805 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5806 false, /* isTypedMethod. Only relevant for methods. */
5807 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5808};
5809
5810MOZ_CAN_RUN_SCRIPT static bool
5811get_lenientDoubleAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
5812{
5813 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5816( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5814 "TestJSImplInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5816( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5815 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject5816( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5816 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5816( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5817
5818 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5819 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5820 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5821 if (objIsXray) {
5822 unwrappedObj.emplace(cx, obj);
5823 }
5824 if (objIsXray) {
5825 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5826 // we know Xrays have no dynamic unwrap behavior.
5827 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5828 if (!unwrappedObj.ref()) {
5829 return false;
5830 }
5831 }
5832 FastErrorResult rv;
5833 double result(MOZ_KnownLive(self)(self)->GetLenientDoubleAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
5834 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr getter"
)), 0))
) {
5835 return false;
5836 }
5837 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5837); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5837; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5838 args.rval().set(JS_NumberValue(double(result)));
5839 return true;
5840}
5841
5842MOZ_CAN_RUN_SCRIPT static bool
5843set_lenientDoubleAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
5844{
5845 BindingCallContext cx(cx_, "TestJSImplInterface.lenientDoubleAttr setter");
5846 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5849( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5847 "TestJSImplInterface", "lenientDoubleAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5849( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5848 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject5849( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5849 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5849( cx, "TestJSImplInterface"
, "lenientDoubleAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5850
5851 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5852 bool foundNonFiniteFloat = false;
5853 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5854 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5855 if (objIsXray) {
5856 unwrappedObj.emplace(cx, obj);
5857 }
5858 double arg0;
5859 if (!ValueToPrimitive<double, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
5860 return false;
5861 } else if (!std::isfinite(arg0)) {
5862 foundNonFiniteFloat = true;
5863 }
5864 if (foundNonFiniteFloat) {
5865 return true;
5866 }
5867 if (objIsXray) {
5868 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5869 // we know Xrays have no dynamic unwrap behavior.
5870 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5871 if (!unwrappedObj.ref()) {
5872 return false;
5873 }
5874 }
5875 FastErrorResult rv;
5876 // NOTE: This assert does NOT call the function.
5877 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetLenientDoubleAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
5878 MOZ_KnownLive(self)(self)->SetLenientDoubleAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
5879 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.lenientDoubleAttr setter"
)), 0))
) {
5880 return false;
5881 }
5882 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5882); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5882; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5883
5884 return true;
5885}
5886
5887static const JSJitInfo lenientDoubleAttr_getterinfo = {
5888 { get_lenientDoubleAttr },
5889 { prototypes::id::TestJSImplInterface },
5890 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5891 JSJitInfo::Getter,
5892 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5893 JSVAL_TYPE_DOUBLE, /* returnType. Not relevant for setters. */
5894 false, /* isInfallible. False in setters. */
5895 false, /* isMovable. Not relevant for setters. */
5896 false, /* isEliminatable. Not relevant for setters. */
5897 false, /* isAlwaysInSlot. Only relevant for getters. */
5898 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5899 false, /* isTypedMethod. Only relevant for methods. */
5900 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5901};
5902static const JSJitInfo lenientDoubleAttr_setterinfo = {
5903 { (JSJitGetterOp)set_lenientDoubleAttr },
5904 { prototypes::id::TestJSImplInterface },
5905 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5906 JSJitInfo::Setter,
5907 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5908 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
5909 false, /* isInfallible. False in setters. */
5910 false, /* isMovable. Not relevant for setters. */
5911 false, /* isEliminatable. Not relevant for setters. */
5912 false, /* isAlwaysInSlot. Only relevant for getters. */
5913 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5914 false, /* isTypedMethod. Only relevant for methods. */
5915 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5916};
5917
5918MOZ_CAN_RUN_SCRIPT static bool
5919receiveSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5920{
5921 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5924( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5922 "TestJSImplInterface", "receiveSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5924( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5923 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5924( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5924 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5924( cx, "TestJSImplInterface"
, "receiveSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5925
5926 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5927 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5928 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5929 if (objIsXray) {
5930 unwrappedObj.emplace(cx, obj);
5931 }
5932 if (objIsXray) {
5933 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5934 // we know Xrays have no dynamic unwrap behavior.
5935 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5936 if (!unwrappedObj.ref()) {
5937 return false;
5938 }
5939 }
5940 FastErrorResult rv;
5941 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
5942 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSelf"
)), 0))
) {
5943 return false;
5944 }
5945 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5945); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5945; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5946 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
5947 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5947); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 5947; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
5948 return false;
5949 }
5950 return true;
5951}
5952
5953static const JSJitInfo receiveSelf_methodinfo = {
5954 { (JSJitGetterOp)receiveSelf },
5955 { prototypes::id::TestJSImplInterface },
5956 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
5957 JSJitInfo::Method,
5958 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
5959 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
5960 false, /* isInfallible. False in setters. */
5961 false, /* isMovable. Not relevant for setters. */
5962 false, /* isEliminatable. Not relevant for setters. */
5963 false, /* isAlwaysInSlot. Only relevant for getters. */
5964 false, /* isLazilyCachedInSlot. Only relevant for getters. */
5965 false, /* isTypedMethod. Only relevant for methods. */
5966 0 /* Reserved slot index, if we're stored in a slot, else 0. */
5967};
5968
5969MOZ_CAN_RUN_SCRIPT static bool
5970receiveNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
5971{
5972 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject5975( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5973 "TestJSImplInterface", "receiveNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject5975( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5974 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject5975( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
5975 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject5975( cx, "TestJSImplInterface"
, "receiveNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
5976
5977 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
5978 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
5979 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
5980 if (objIsXray) {
5981 unwrappedObj.emplace(cx, obj);
5982 }
5983 if (objIsXray) {
5984 // Since our object is an Xray, we can just CheckedUnwrapStatic:
5985 // we know Xrays have no dynamic unwrap behavior.
5986 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
5987 if (!unwrappedObj.ref()) {
5988 return false;
5989 }
5990 }
5991 FastErrorResult rv;
5992 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
5993 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSelf"
)), 0))
) {
5994 return false;
5995 }
5996 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 5996); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 5996; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
5997 if (!result) {
5998 args.rval().setNull();
5999 return true;
6000 }
6001 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6002 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6002); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6002; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6003 return false;
6004 }
6005 return true;
6006}
6007
6008static const JSJitInfo receiveNullableSelf_methodinfo = {
6009 { (JSJitGetterOp)receiveNullableSelf },
6010 { prototypes::id::TestJSImplInterface },
6011 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6012 JSJitInfo::Method,
6013 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6014 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6015 false, /* isInfallible. False in setters. */
6016 false, /* isMovable. Not relevant for setters. */
6017 false, /* isEliminatable. Not relevant for setters. */
6018 false, /* isAlwaysInSlot. Only relevant for getters. */
6019 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6020 false, /* isTypedMethod. Only relevant for methods. */
6021 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6022};
6023
6024MOZ_CAN_RUN_SCRIPT static bool
6025receiveWeakSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6026{
6027 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6030( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6028 "TestJSImplInterface", "receiveWeakSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6030( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6029 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6030( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6030 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6030( cx, "TestJSImplInterface"
, "receiveWeakSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6031
6032 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6033 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6034 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6035 if (objIsXray) {
6036 unwrappedObj.emplace(cx, obj);
6037 }
6038 if (objIsXray) {
6039 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6040 // we know Xrays have no dynamic unwrap behavior.
6041 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6042 if (!unwrappedObj.ref()) {
6043 return false;
6044 }
6045 }
6046 FastErrorResult rv;
6047 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6048 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakSelf"
)), 0))
) {
6049 return false;
6050 }
6051 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6051); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6051; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6052 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6053 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6053); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6053; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6054 return false;
6055 }
6056 return true;
6057}
6058
6059static const JSJitInfo receiveWeakSelf_methodinfo = {
6060 { (JSJitGetterOp)receiveWeakSelf },
6061 { prototypes::id::TestJSImplInterface },
6062 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6063 JSJitInfo::Method,
6064 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6065 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6066 false, /* isInfallible. False in setters. */
6067 false, /* isMovable. Not relevant for setters. */
6068 false, /* isEliminatable. Not relevant for setters. */
6069 false, /* isAlwaysInSlot. Only relevant for getters. */
6070 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6071 false, /* isTypedMethod. Only relevant for methods. */
6072 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6073};
6074
6075MOZ_CAN_RUN_SCRIPT static bool
6076receiveWeakNullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6077{
6078 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6081( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6079 "TestJSImplInterface", "receiveWeakNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6081( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6080 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6081( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6081 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6081( cx, "TestJSImplInterface"
, "receiveWeakNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6082
6083 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6084 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6085 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6086 if (objIsXray) {
6087 unwrappedObj.emplace(cx, obj);
6088 }
6089 if (objIsXray) {
6090 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6091 // we know Xrays have no dynamic unwrap behavior.
6092 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6093 if (!unwrappedObj.ref()) {
6094 return false;
6095 }
6096 }
6097 FastErrorResult rv;
6098 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6099 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableSelf"
)), 0))
) {
6100 return false;
6101 }
6102 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6102); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6102; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6103 if (!result) {
6104 args.rval().setNull();
6105 return true;
6106 }
6107 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6108 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6108); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6108; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6109 return false;
6110 }
6111 return true;
6112}
6113
6114static const JSJitInfo receiveWeakNullableSelf_methodinfo = {
6115 { (JSJitGetterOp)receiveWeakNullableSelf },
6116 { prototypes::id::TestJSImplInterface },
6117 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6118 JSJitInfo::Method,
6119 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6120 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6121 false, /* isInfallible. False in setters. */
6122 false, /* isMovable. Not relevant for setters. */
6123 false, /* isEliminatable. Not relevant for setters. */
6124 false, /* isAlwaysInSlot. Only relevant for getters. */
6125 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6126 false, /* isTypedMethod. Only relevant for methods. */
6127 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6128};
6129
6130MOZ_CAN_RUN_SCRIPT static bool
6131passSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6132{
6133 BindingCallContext cx(cx_, "TestJSImplInterface.passSelf");
6134 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6137( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6135 "TestJSImplInterface", "passSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6137( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6136 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6137( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
6137 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6137( cx, "TestJSImplInterface"
, "passSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
6138
6139 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6140 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSelf", 1)) {
6141 return false;
6142 }
6143 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6144 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6145 if (objIsXray) {
6146 unwrappedObj.emplace(cx, obj);
6147 }
6148 NonNull<mozilla::dom::TestJSImplInterface> arg0;
6149 if (args[0].isObject()) {
6150 {
6151 // Our JSContext should be in the right global to do unwrapping in.
6152 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6153 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6154 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6155 return false;
6156 }
6157 }
6158 } else {
6159 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6160 return false;
6161 }
6162 if (objIsXray) {
6163 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6164 // we know Xrays have no dynamic unwrap behavior.
6165 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6166 if (!unwrappedObj.ref()) {
6167 return false;
6168 }
6169 }
6170 FastErrorResult rv;
6171 // NOTE: This assert does NOT call the function.
6172 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6173 MOZ_KnownLive(self)(self)->PassSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6174 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSelf"
)), 0))
) {
6175 return false;
6176 }
6177 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6177); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6177; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6178 args.rval().setUndefined();
6179 return true;
6180}
6181
6182static const JSJitInfo passSelf_methodinfo = {
6183 { (JSJitGetterOp)passSelf },
6184 { prototypes::id::TestJSImplInterface },
6185 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6186 JSJitInfo::Method,
6187 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6188 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6189 false, /* isInfallible. False in setters. */
6190 false, /* isMovable. Not relevant for setters. */
6191 false, /* isEliminatable. Not relevant for setters. */
6192 false, /* isAlwaysInSlot. Only relevant for getters. */
6193 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6194 false, /* isTypedMethod. Only relevant for methods. */
6195 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6196};
6197
6198MOZ_CAN_RUN_SCRIPT static bool
6199passNullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6200{
6201 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSelf");
6202 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6205( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6203 "TestJSImplInterface", "passNullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6205( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6204 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6205( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6205 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6205( cx, "TestJSImplInterface"
, "passNullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6206
6207 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6208 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSelf", 1)) {
6209 return false;
6210 }
6211 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6212 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6213 if (objIsXray) {
6214 unwrappedObj.emplace(cx, obj);
6215 }
6216 mozilla::dom::TestJSImplInterface* arg0;
6217 if (args[0].isObject()) {
6218 {
6219 // Our JSContext should be in the right global to do unwrapping in.
6220 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6221 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6222 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6223 return false;
6224 }
6225 }
6226 } else if (args[0].isNullOrUndefined()) {
6227 arg0 = nullptr;
6228 } else {
6229 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6230 return false;
6231 }
6232 if (objIsXray) {
6233 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6234 // we know Xrays have no dynamic unwrap behavior.
6235 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6236 if (!unwrappedObj.ref()) {
6237 return false;
6238 }
6239 }
6240 FastErrorResult rv;
6241 // NOTE: This assert does NOT call the function.
6242 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6243 MOZ_KnownLive(self)(self)->PassNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6244 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSelf"
)), 0))
) {
6245 return false;
6246 }
6247 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6247); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6247; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6248 args.rval().setUndefined();
6249 return true;
6250}
6251
6252static const JSJitInfo passNullableSelf_methodinfo = {
6253 { (JSJitGetterOp)passNullableSelf },
6254 { prototypes::id::TestJSImplInterface },
6255 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6256 JSJitInfo::Method,
6257 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6258 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6259 false, /* isInfallible. False in setters. */
6260 false, /* isMovable. Not relevant for setters. */
6261 false, /* isEliminatable. Not relevant for setters. */
6262 false, /* isAlwaysInSlot. Only relevant for getters. */
6263 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6264 false, /* isTypedMethod. Only relevant for methods. */
6265 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6266};
6267
6268MOZ_CAN_RUN_SCRIPT static bool
6269get_nonNullSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
6270{
6271 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6274( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6272 "TestJSImplInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6274( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6273 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6274( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6274 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6274( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6275
6276 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6277 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6278 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6279 if (objIsXray) {
6280 unwrappedObj.emplace(cx, obj);
6281 }
6282 if (objIsXray) {
6283 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6284 // we know Xrays have no dynamic unwrap behavior.
6285 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6286 if (!unwrappedObj.ref()) {
6287 return false;
6288 }
6289 }
6290 FastErrorResult rv;
6291 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetNonNullSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6292 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf getter"
)), 0))
) {
6293 return false;
6294 }
6295 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6295); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6295; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6296 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6297 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6297); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6297; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6298 return false;
6299 }
6300 return true;
6301}
6302
6303MOZ_CAN_RUN_SCRIPT static bool
6304set_nonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
6305{
6306 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullSelf setter");
6307 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6310( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6308 "TestJSImplInterface", "nonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6310( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6309 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6310( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6310 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6310( cx, "TestJSImplInterface"
, "nonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6311
6312 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6313 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6314 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6315 if (objIsXray) {
6316 unwrappedObj.emplace(cx, obj);
6317 }
6318 NonNull<mozilla::dom::TestJSImplInterface> arg0;
6319 if (args[0].isObject()) {
6320 {
6321 // Our JSContext should be in the right global to do unwrapping in.
6322 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6323 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6324 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestJSImplInterface");
6325 return false;
6326 }
6327 }
6328 } else {
6329 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
6330 return false;
6331 }
6332 if (objIsXray) {
6333 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6334 // we know Xrays have no dynamic unwrap behavior.
6335 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6336 if (!unwrappedObj.ref()) {
6337 return false;
6338 }
6339 }
6340 FastErrorResult rv;
6341 // NOTE: This assert does NOT call the function.
6342 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6343 MOZ_KnownLive(self)(self)->SetNonNullSelf(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6344 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullSelf setter"
)), 0))
) {
6345 return false;
6346 }
6347 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6347); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6347; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6348
6349 return true;
6350}
6351
6352static const JSJitInfo nonNullSelf_getterinfo = {
6353 { get_nonNullSelf },
6354 { prototypes::id::TestJSImplInterface },
6355 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6356 JSJitInfo::Getter,
6357 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6358 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6359 false, /* isInfallible. False in setters. */
6360 false, /* isMovable. Not relevant for setters. */
6361 false, /* isEliminatable. Not relevant for setters. */
6362 false, /* isAlwaysInSlot. Only relevant for getters. */
6363 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6364 false, /* isTypedMethod. Only relevant for methods. */
6365 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6366};
6367static const JSJitInfo nonNullSelf_setterinfo = {
6368 { (JSJitGetterOp)set_nonNullSelf },
6369 { prototypes::id::TestJSImplInterface },
6370 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6371 JSJitInfo::Setter,
6372 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6373 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6374 false, /* isInfallible. False in setters. */
6375 false, /* isMovable. Not relevant for setters. */
6376 false, /* isEliminatable. Not relevant for setters. */
6377 false, /* isAlwaysInSlot. Only relevant for getters. */
6378 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6379 false, /* isTypedMethod. Only relevant for methods. */
6380 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6381};
6382
6383MOZ_CAN_RUN_SCRIPT static bool
6384get_nullableSelf(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
6385{
6386 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6389( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6387 "TestJSImplInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6389( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6388 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject6389( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6389 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6389( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6390
6391 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6392 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6393 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6394 if (objIsXray) {
6395 unwrappedObj.emplace(cx, obj);
6396 }
6397 if (objIsXray) {
6398 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6399 // we know Xrays have no dynamic unwrap behavior.
6400 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6401 if (!unwrappedObj.ref()) {
6402 return false;
6403 }
6404 }
6405 FastErrorResult rv;
6406 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetNullableSelf(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6407 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf getter"
)), 0))
) {
6408 return false;
6409 }
6410 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6410); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6410; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6411 if (!result) {
6412 args.rval().setNull();
6413 return true;
6414 }
6415 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
6416 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6416); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6416; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6417 return false;
6418 }
6419 return true;
6420}
6421
6422MOZ_CAN_RUN_SCRIPT static bool
6423set_nullableSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
6424{
6425 BindingCallContext cx(cx_, "TestJSImplInterface.nullableSelf setter");
6426 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6429( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6427 "TestJSImplInterface", "nullableSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6429( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6428 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject6429( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6429 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6429( cx, "TestJSImplInterface"
, "nullableSelf", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6430
6431 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6432 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6433 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6434 if (objIsXray) {
6435 unwrappedObj.emplace(cx, obj);
6436 }
6437 mozilla::dom::TestJSImplInterface* arg0;
6438 if (args[0].isObject()) {
6439 {
6440 // Our JSContext should be in the right global to do unwrapping in.
6441 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6442 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6443 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestJSImplInterface");
6444 return false;
6445 }
6446 }
6447 } else if (args[0].isNullOrUndefined()) {
6448 arg0 = nullptr;
6449 } else {
6450 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
6451 return false;
6452 }
6453 if (objIsXray) {
6454 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6455 // we know Xrays have no dynamic unwrap behavior.
6456 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6457 if (!unwrappedObj.ref()) {
6458 return false;
6459 }
6460 }
6461 FastErrorResult rv;
6462 // NOTE: This assert does NOT call the function.
6463 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6464 MOZ_KnownLive(self)(self)->SetNullableSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6465 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableSelf setter"
)), 0))
) {
6466 return false;
6467 }
6468 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6468); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6468; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6469
6470 return true;
6471}
6472
6473static const JSJitInfo nullableSelf_getterinfo = {
6474 { get_nullableSelf },
6475 { prototypes::id::TestJSImplInterface },
6476 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6477 JSJitInfo::Getter,
6478 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6479 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6480 false, /* isInfallible. False in setters. */
6481 false, /* isMovable. Not relevant for setters. */
6482 false, /* isEliminatable. Not relevant for setters. */
6483 false, /* isAlwaysInSlot. Only relevant for getters. */
6484 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6485 false, /* isTypedMethod. Only relevant for methods. */
6486 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6487};
6488static const JSJitInfo nullableSelf_setterinfo = {
6489 { (JSJitGetterOp)set_nullableSelf },
6490 { prototypes::id::TestJSImplInterface },
6491 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6492 JSJitInfo::Setter,
6493 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6494 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6495 false, /* isInfallible. False in setters. */
6496 false, /* isMovable. Not relevant for setters. */
6497 false, /* isEliminatable. Not relevant for setters. */
6498 false, /* isAlwaysInSlot. Only relevant for getters. */
6499 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6500 false, /* isTypedMethod. Only relevant for methods. */
6501 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6502};
6503
6504MOZ_CAN_RUN_SCRIPT static bool
6505passOptionalSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6506{
6507 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSelf");
6508 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6511( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6509 "TestJSImplInterface", "passOptionalSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6511( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6510 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6511( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6511 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6511( cx, "TestJSImplInterface"
, "passOptionalSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6512
6513 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6514 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6515 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6516 if (objIsXray) {
6517 unwrappedObj.emplace(cx, obj);
6518 }
6519 Optional<mozilla::dom::TestJSImplInterface*> arg0;
6520 if (args.hasDefined(0)) {
6521 arg0.Construct();
6522 if (args[0].isObject()) {
6523 {
6524 // Our JSContext should be in the right global to do unwrapping in.
6525 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0.Value(), cx);
6526 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6527 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6528 return false;
6529 }
6530 }
6531 } else if (args[0].isNullOrUndefined()) {
6532 arg0.Value() = nullptr;
6533 } else {
6534 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6535 return false;
6536 }
6537 }
6538 if (objIsXray) {
6539 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6540 // we know Xrays have no dynamic unwrap behavior.
6541 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6542 if (!unwrappedObj.ref()) {
6543 return false;
6544 }
6545 }
6546 FastErrorResult rv;
6547 // NOTE: This assert does NOT call the function.
6548 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6549 MOZ_KnownLive(self)(self)->PassOptionalSelf(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6550 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelf"
)), 0))
) {
6551 return false;
6552 }
6553 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6553); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6553; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6554 args.rval().setUndefined();
6555 return true;
6556}
6557
6558static const JSJitInfo passOptionalSelf_methodinfo = {
6559 { (JSJitGetterOp)passOptionalSelf },
6560 { prototypes::id::TestJSImplInterface },
6561 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6562 JSJitInfo::Method,
6563 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6564 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6565 false, /* isInfallible. False in setters. */
6566 false, /* isMovable. Not relevant for setters. */
6567 false, /* isEliminatable. Not relevant for setters. */
6568 false, /* isAlwaysInSlot. Only relevant for getters. */
6569 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6570 false, /* isTypedMethod. Only relevant for methods. */
6571 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6572};
6573
6574MOZ_CAN_RUN_SCRIPT static bool
6575passOptionalNonNullSelf(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6576{
6577 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullSelf");
6578 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6581( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6579 "TestJSImplInterface", "passOptionalNonNullSelf", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6581( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6580 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6581( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
6581 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6581( cx, "TestJSImplInterface"
, "passOptionalNonNullSelf", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
6582
6583 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6584 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6585 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6586 if (objIsXray) {
6587 unwrappedObj.emplace(cx, obj);
6588 }
6589 Optional<NonNull<mozilla::dom::TestJSImplInterface>> arg0;
6590 if (args.hasDefined(0)) {
6591 arg0.Construct();
6592 if (args[0].isObject()) {
6593 {
6594 // Our JSContext should be in the right global to do unwrapping in.
6595 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0.Value(), cx);
6596 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6597 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6598 return false;
6599 }
6600 }
6601 } else {
6602 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6603 return false;
6604 }
6605 }
6606 if (objIsXray) {
6607 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6608 // we know Xrays have no dynamic unwrap behavior.
6609 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6610 if (!unwrappedObj.ref()) {
6611 return false;
6612 }
6613 }
6614 FastErrorResult rv;
6615 // NOTE: This assert does NOT call the function.
6616 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullSelf(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6617 MOZ_KnownLive(self)(self)->PassOptionalNonNullSelf(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6618 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullSelf"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullSelf"
)), 0))
) {
6619 return false;
6620 }
6621 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6621); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6621; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6622 args.rval().setUndefined();
6623 return true;
6624}
6625
6626static const JSJitInfo passOptionalNonNullSelf_methodinfo = {
6627 { (JSJitGetterOp)passOptionalNonNullSelf },
6628 { prototypes::id::TestJSImplInterface },
6629 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6630 JSJitInfo::Method,
6631 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6632 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6633 false, /* isInfallible. False in setters. */
6634 false, /* isMovable. Not relevant for setters. */
6635 false, /* isEliminatable. Not relevant for setters. */
6636 false, /* isAlwaysInSlot. Only relevant for getters. */
6637 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6638 false, /* isTypedMethod. Only relevant for methods. */
6639 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6640};
6641
6642MOZ_CAN_RUN_SCRIPT static bool
6643passOptionalSelfWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6644{
6645 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSelfWithDefault");
6646 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6649( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6647 "TestJSImplInterface", "passOptionalSelfWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6649( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6648 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6649( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6649 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6649( cx, "TestJSImplInterface"
, "passOptionalSelfWithDefault", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6650
6651 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6652 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6653 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6654 if (objIsXray) {
6655 unwrappedObj.emplace(cx, obj);
6656 }
6657 mozilla::dom::TestJSImplInterface* arg0;
6658 if (args.hasDefined(0)) {
6659 if (args[0].isObject()) {
6660 {
6661 // Our JSContext should be in the right global to do unwrapping in.
6662 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
6663 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
6664 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
6665 return false;
6666 }
6667 }
6668 } else if (args[0].isNullOrUndefined()) {
6669 arg0 = nullptr;
6670 } else {
6671 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
6672 return false;
6673 }
6674 } else {
6675 arg0 = nullptr;
6676 }
6677 if (objIsXray) {
6678 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6679 // we know Xrays have no dynamic unwrap behavior.
6680 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6681 if (!unwrappedObj.ref()) {
6682 return false;
6683 }
6684 }
6685 FastErrorResult rv;
6686 // NOTE: This assert does NOT call the function.
6687 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSelfWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6688 MOZ_KnownLive(self)(self)->PassOptionalSelfWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6689 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelfWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSelfWithDefault"
)), 0))
) {
6690 return false;
6691 }
6692 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6692); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6692; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6693 args.rval().setUndefined();
6694 return true;
6695}
6696
6697static const JSJitInfo passOptionalSelfWithDefault_methodinfo = {
6698 { (JSJitGetterOp)passOptionalSelfWithDefault },
6699 { prototypes::id::TestJSImplInterface },
6700 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6701 JSJitInfo::Method,
6702 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6703 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
6704 false, /* isInfallible. False in setters. */
6705 false, /* isMovable. Not relevant for setters. */
6706 false, /* isEliminatable. Not relevant for setters. */
6707 false, /* isAlwaysInSlot. Only relevant for getters. */
6708 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6709 false, /* isTypedMethod. Only relevant for methods. */
6710 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6711};
6712
6713MOZ_CAN_RUN_SCRIPT static bool
6714receiveNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6715{
6716 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6719( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6717 "TestJSImplInterface", "receiveNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6719( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6718 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6719( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6719 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6719( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6720
6721 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6722 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6723 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6724 if (objIsXray) {
6725 unwrappedObj.emplace(cx, obj);
6726 }
6727 if (objIsXray) {
6728 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6729 // we know Xrays have no dynamic unwrap behavior.
6730 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6731 if (!unwrappedObj.ref()) {
6732 return false;
6733 }
6734 }
6735 FastErrorResult rv;
6736 auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6737 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterface"
)), 0))
) {
6738 return false;
6739 }
6740 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6740); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6740; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6741 static_assert(!std::is_pointer_v<decltype(result)>,
6742 "NewObject implies that we need to keep the object alive with a strong reference.");
6743 if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
6744 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6744); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6744; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6745 return false;
6746 }
6747 return true;
6748}
6749
6750static const JSJitInfo receiveNonWrapperCacheInterface_methodinfo = {
6751 { (JSJitGetterOp)receiveNonWrapperCacheInterface },
6752 { prototypes::id::TestJSImplInterface },
6753 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6754 JSJitInfo::Method,
6755 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6756 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6757 false, /* isInfallible. False in setters. */
6758 false, /* isMovable. Not relevant for setters. */
6759 false, /* isEliminatable. Not relevant for setters. */
6760 false, /* isAlwaysInSlot. Only relevant for getters. */
6761 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6762 false, /* isTypedMethod. Only relevant for methods. */
6763 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6764};
6765
6766MOZ_CAN_RUN_SCRIPT static bool
6767receiveNullableNonWrapperCacheInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6768{
6769 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6772( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6770 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6772( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6771 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6772( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6772 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6772( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6773
6774 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6775 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6776 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6777 if (objIsXray) {
6778 unwrappedObj.emplace(cx, obj);
6779 }
6780 if (objIsXray) {
6781 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6782 // we know Xrays have no dynamic unwrap behavior.
6783 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6784 if (!unwrappedObj.ref()) {
6785 return false;
6786 }
6787 }
6788 FastErrorResult rv;
6789 auto result(StrongOrRawPtr<mozilla::dom::TestNonWrapperCacheInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
6790 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface"
)), 0))
) {
6791 return false;
6792 }
6793 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6793); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6793; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6794 static_assert(!std::is_pointer_v<decltype(result)>,
6795 "NewObject implies that we need to keep the object alive with a strong reference.");
6796 if (!result) {
6797 args.rval().setNull();
6798 return true;
6799 }
6800 if (!WrapNewBindingNonWrapperCachedObject(cx, obj, result, args.rval())) {
6801 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6801); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6801; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6802 return false;
6803 }
6804 return true;
6805}
6806
6807static const JSJitInfo receiveNullableNonWrapperCacheInterface_methodinfo = {
6808 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterface },
6809 { prototypes::id::TestJSImplInterface },
6810 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6811 JSJitInfo::Method,
6812 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6813 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
6814 false, /* isInfallible. False in setters. */
6815 false, /* isMovable. Not relevant for setters. */
6816 false, /* isEliminatable. Not relevant for setters. */
6817 false, /* isAlwaysInSlot. Only relevant for getters. */
6818 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6819 false, /* isTypedMethod. Only relevant for methods. */
6820 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6821};
6822
6823MOZ_CAN_RUN_SCRIPT static bool
6824receiveNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6825{
6826 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6829( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6827 "TestJSImplInterface", "receiveNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6829( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6828 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6829( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6829 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6829( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6830
6831 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6832 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6833 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6834 if (objIsXray) {
6835 unwrappedObj.emplace(cx, obj);
6836 }
6837 if (objIsXray) {
6838 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6839 // we know Xrays have no dynamic unwrap behavior.
6840 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6841 if (!unwrappedObj.ref()) {
6842 return false;
6843 }
6844 }
6845 FastErrorResult rv;
6846 nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result;
6847 // NOTE: This assert does NOT call the function.
6848 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6849 MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6850 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence"
)), 0))
) {
6851 return false;
6852 }
6853 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6853); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6853; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6854
6855 uint32_t length = result.Length();
6856 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
6857 if (!returnArray) {
6858 return false;
6859 }
6860 // Scope for 'tmp'
6861 {
6862 JS::Rooted<JS::Value> tmp(cx);
6863 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6864 // Control block to let us common up the JS_DefineElement calls when there
6865 // are different ways to succeed at wrapping the object.
6866 do {
6867 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) {
6868 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6868); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6868; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6869 return false;
6870 }
6871 break;
6872 } while (false);
6873 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6874 JSPROP_ENUMERATE)) {
6875 return false;
6876 }
6877 }
6878 }
6879 args.rval().setObject(*returnArray);
6880 return true;
6881}
6882
6883static const JSJitInfo receiveNonWrapperCacheInterfaceSequence_methodinfo = {
6884 { (JSJitGetterOp)receiveNonWrapperCacheInterfaceSequence },
6885 { prototypes::id::TestJSImplInterface },
6886 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6887 JSJitInfo::Method,
6888 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6889 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6890 false, /* isInfallible. False in setters. */
6891 false, /* isMovable. Not relevant for setters. */
6892 false, /* isEliminatable. Not relevant for setters. */
6893 false, /* isAlwaysInSlot. Only relevant for getters. */
6894 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6895 false, /* isTypedMethod. Only relevant for methods. */
6896 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6897};
6898
6899MOZ_CAN_RUN_SCRIPT static bool
6900receiveNullableNonWrapperCacheInterfaceSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6901{
6902 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6905( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6903 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6905( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6904 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6905( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6905 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6905( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6906
6907 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6908 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6909 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6910 if (objIsXray) {
6911 unwrappedObj.emplace(cx, obj);
6912 }
6913 if (objIsXray) {
6914 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6915 // we know Xrays have no dynamic unwrap behavior.
6916 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6917 if (!unwrappedObj.ref()) {
6918 return false;
6919 }
6920 }
6921 FastErrorResult rv;
6922 nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>> result;
6923 // NOTE: This assert does NOT call the function.
6924 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
6925 MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
6926 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence"
)), 0))
) {
6927 return false;
6928 }
6929 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6929); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 6929; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
6930
6931 uint32_t length = result.Length();
6932 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
6933 if (!returnArray) {
6934 return false;
6935 }
6936 // Scope for 'tmp'
6937 {
6938 JS::Rooted<JS::Value> tmp(cx);
6939 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
6940 // Control block to let us common up the JS_DefineElement calls when there
6941 // are different ways to succeed at wrapping the object.
6942 do {
6943 if (!result[sequenceIdx0]) {
6944 tmp.setNull();
6945 break;
6946 }
6947 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result[sequenceIdx0], &tmp)) {
6948 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 6948); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 6948; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
6949 return false;
6950 }
6951 break;
6952 } while (false);
6953 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
6954 JSPROP_ENUMERATE)) {
6955 return false;
6956 }
6957 }
6958 }
6959 args.rval().setObject(*returnArray);
6960 return true;
6961}
6962
6963static const JSJitInfo receiveNullableNonWrapperCacheInterfaceSequence_methodinfo = {
6964 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceSequence },
6965 { prototypes::id::TestJSImplInterface },
6966 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
6967 JSJitInfo::Method,
6968 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
6969 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
6970 false, /* isInfallible. False in setters. */
6971 false, /* isMovable. Not relevant for setters. */
6972 false, /* isEliminatable. Not relevant for setters. */
6973 false, /* isAlwaysInSlot. Only relevant for getters. */
6974 false, /* isLazilyCachedInSlot. Only relevant for getters. */
6975 false, /* isTypedMethod. Only relevant for methods. */
6976 0 /* Reserved slot index, if we're stored in a slot, else 0. */
6977};
6978
6979MOZ_CAN_RUN_SCRIPT static bool
6980receiveNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
6981{
6982 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject6985( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6983 "TestJSImplInterface", "receiveNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject6985( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6984 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject6985( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
6985 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject6985( cx, "TestJSImplInterface"
, "receiveNonWrapperCacheInterfaceNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
6986
6987 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
6988 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
6989 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
6990 if (objIsXray) {
6991 unwrappedObj.emplace(cx, obj);
6992 }
6993 if (objIsXray) {
6994 // Since our object is an Xray, we can just CheckedUnwrapStatic:
6995 // we know Xrays have no dynamic unwrap behavior.
6996 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
6997 if (!unwrappedObj.ref()) {
6998 return false;
6999 }
7000 }
7001 FastErrorResult rv;
7002 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result;
7003 // NOTE: This assert does NOT call the function.
7004 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7005 MOZ_KnownLive(self)(self)->ReceiveNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7006 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence"
)), 0))
) {
7007 return false;
7008 }
7009 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7009; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7010
7011 if (result.IsNull()) {
7012 args.rval().setNull();
7013 return true;
7014 }
7015
7016 uint32_t length = result.Value().Length();
7017 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
7018 if (!returnArray) {
7019 return false;
7020 }
7021 // Scope for 'tmp'
7022 {
7023 JS::Rooted<JS::Value> tmp(cx);
7024 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
7025 // Control block to let us common up the JS_DefineElement calls when there
7026 // are different ways to succeed at wrapping the object.
7027 do {
7028 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) {
7029 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7029); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 7029; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
7030 return false;
7031 }
7032 break;
7033 } while (false);
7034 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
7035 JSPROP_ENUMERATE)) {
7036 return false;
7037 }
7038 }
7039 }
7040 args.rval().setObject(*returnArray);
7041 return true;
7042}
7043
7044static const JSJitInfo receiveNonWrapperCacheInterfaceNullableSequence_methodinfo = {
7045 { (JSJitGetterOp)receiveNonWrapperCacheInterfaceNullableSequence },
7046 { prototypes::id::TestJSImplInterface },
7047 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7048 JSJitInfo::Method,
7049 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7050 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7051 false, /* isInfallible. False in setters. */
7052 false, /* isMovable. Not relevant for setters. */
7053 false, /* isEliminatable. Not relevant for setters. */
7054 false, /* isAlwaysInSlot. Only relevant for getters. */
7055 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7056 false, /* isTypedMethod. Only relevant for methods. */
7057 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7058};
7059
7060MOZ_CAN_RUN_SCRIPT static bool
7061receiveNullableNonWrapperCacheInterfaceNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7062{
7063 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7066( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7064 "TestJSImplInterface", "receiveNullableNonWrapperCacheInterfaceNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7066( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7065 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7066( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
7066 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7066( cx, "TestJSImplInterface"
, "receiveNullableNonWrapperCacheInterfaceNullableSequence", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
7067
7068 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7069 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7070 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7071 if (objIsXray) {
7072 unwrappedObj.emplace(cx, obj);
7073 }
7074 if (objIsXray) {
7075 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7076 // we know Xrays have no dynamic unwrap behavior.
7077 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7078 if (!unwrappedObj.ref()) {
7079 return false;
7080 }
7081 }
7082 FastErrorResult rv;
7083 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestNonWrapperCacheInterface>>> result;
7084 // NOTE: This assert does NOT call the function.
7085 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7086 MOZ_KnownLive(self)(self)->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7087 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence"
)), 0))
) {
7088 return false;
7089 }
7090 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7090); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7090; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7091
7092 if (result.IsNull()) {
7093 args.rval().setNull();
7094 return true;
7095 }
7096
7097 uint32_t length = result.Value().Length();
7098 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
7099 if (!returnArray) {
7100 return false;
7101 }
7102 // Scope for 'tmp'
7103 {
7104 JS::Rooted<JS::Value> tmp(cx);
7105 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
7106 // Control block to let us common up the JS_DefineElement calls when there
7107 // are different ways to succeed at wrapping the object.
7108 do {
7109 if (!result.Value()[sequenceIdx0]) {
7110 tmp.setNull();
7111 break;
7112 }
7113 if (!WrapNewBindingNonWrapperCachedObject(cx, returnArray, result.Value()[sequenceIdx0], &tmp)) {
7114 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7114); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 7114; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
7115 return false;
7116 }
7117 break;
7118 } while (false);
7119 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
7120 JSPROP_ENUMERATE)) {
7121 return false;
7122 }
7123 }
7124 }
7125 args.rval().setObject(*returnArray);
7126 return true;
7127}
7128
7129static const JSJitInfo receiveNullableNonWrapperCacheInterfaceNullableSequence_methodinfo = {
7130 { (JSJitGetterOp)receiveNullableNonWrapperCacheInterfaceNullableSequence },
7131 { prototypes::id::TestJSImplInterface },
7132 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7133 JSJitInfo::Method,
7134 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7135 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7136 false, /* isInfallible. False in setters. */
7137 false, /* isMovable. Not relevant for setters. */
7138 false, /* isEliminatable. Not relevant for setters. */
7139 false, /* isAlwaysInSlot. Only relevant for getters. */
7140 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7141 false, /* isTypedMethod. Only relevant for methods. */
7142 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7143};
7144
7145MOZ_CAN_RUN_SCRIPT static bool
7146receiveExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7147{
7148 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7151( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7149 "TestJSImplInterface", "receiveExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7151( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7150 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7151( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7151 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7151( cx, "TestJSImplInterface"
, "receiveExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7152
7153 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7154 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7155 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7156 if (objIsXray) {
7157 unwrappedObj.emplace(cx, obj);
7158 }
7159 if (objIsXray) {
7160 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7161 // we know Xrays have no dynamic unwrap behavior.
7162 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7163 if (!unwrappedObj.ref()) {
7164 return false;
7165 }
7166 }
7167 FastErrorResult rv;
7168 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7169 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveExternal"
)), 0))
) {
7170 return false;
7171 }
7172 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7172); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7172; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7173 if (!WrapObject(cx, result, args.rval())) {
7174 return false;
7175 }
7176 return true;
7177}
7178
7179static const JSJitInfo receiveExternal_methodinfo = {
7180 { (JSJitGetterOp)receiveExternal },
7181 { prototypes::id::TestJSImplInterface },
7182 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7183 JSJitInfo::Method,
7184 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7185 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7186 false, /* isInfallible. False in setters. */
7187 false, /* isMovable. Not relevant for setters. */
7188 false, /* isEliminatable. Not relevant for setters. */
7189 false, /* isAlwaysInSlot. Only relevant for getters. */
7190 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7191 false, /* isTypedMethod. Only relevant for methods. */
7192 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7193};
7194
7195MOZ_CAN_RUN_SCRIPT static bool
7196receiveNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7197{
7198 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7201( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7199 "TestJSImplInterface", "receiveNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7201( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7200 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7201( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7201 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7201( cx, "TestJSImplInterface"
, "receiveNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7202
7203 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7204 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7205 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7206 if (objIsXray) {
7207 unwrappedObj.emplace(cx, obj);
7208 }
7209 if (objIsXray) {
7210 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7211 // we know Xrays have no dynamic unwrap behavior.
7212 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7213 if (!unwrappedObj.ref()) {
7214 return false;
7215 }
7216 }
7217 FastErrorResult rv;
7218 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7219 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableExternal"
)), 0))
) {
7220 return false;
7221 }
7222 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7222); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7222; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7223 if (!result) {
7224 args.rval().setNull();
7225 return true;
7226 }
7227 if (!WrapObject(cx, result, args.rval())) {
7228 return false;
7229 }
7230 return true;
7231}
7232
7233static const JSJitInfo receiveNullableExternal_methodinfo = {
7234 { (JSJitGetterOp)receiveNullableExternal },
7235 { prototypes::id::TestJSImplInterface },
7236 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7237 JSJitInfo::Method,
7238 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7239 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7240 false, /* isInfallible. False in setters. */
7241 false, /* isMovable. Not relevant for setters. */
7242 false, /* isEliminatable. Not relevant for setters. */
7243 false, /* isAlwaysInSlot. Only relevant for getters. */
7244 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7245 false, /* isTypedMethod. Only relevant for methods. */
7246 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7247};
7248
7249MOZ_CAN_RUN_SCRIPT static bool
7250receiveWeakExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7251{
7252 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7255( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7253 "TestJSImplInterface", "receiveWeakExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7255( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7254 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7255( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7255 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7255( cx, "TestJSImplInterface"
, "receiveWeakExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7256
7257 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7258 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7259 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7260 if (objIsXray) {
7261 unwrappedObj.emplace(cx, obj);
7262 }
7263 if (objIsXray) {
7264 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7265 // we know Xrays have no dynamic unwrap behavior.
7266 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7267 if (!unwrappedObj.ref()) {
7268 return false;
7269 }
7270 }
7271 FastErrorResult rv;
7272 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7273 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakExternal"
)), 0))
) {
7274 return false;
7275 }
7276 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7276); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7276; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7277 if (!WrapObject(cx, result, args.rval())) {
7278 return false;
7279 }
7280 return true;
7281}
7282
7283static const JSJitInfo receiveWeakExternal_methodinfo = {
7284 { (JSJitGetterOp)receiveWeakExternal },
7285 { prototypes::id::TestJSImplInterface },
7286 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7287 JSJitInfo::Method,
7288 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7289 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7290 false, /* isInfallible. False in setters. */
7291 false, /* isMovable. Not relevant for setters. */
7292 false, /* isEliminatable. Not relevant for setters. */
7293 false, /* isAlwaysInSlot. Only relevant for getters. */
7294 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7295 false, /* isTypedMethod. Only relevant for methods. */
7296 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7297};
7298
7299MOZ_CAN_RUN_SCRIPT static bool
7300receiveWeakNullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7301{
7302 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7305( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7303 "TestJSImplInterface", "receiveWeakNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7305( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7304 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7305( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7305 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7305( cx, "TestJSImplInterface"
, "receiveWeakNullableExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7306
7307 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7308 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7309 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7310 if (objIsXray) {
7311 unwrappedObj.emplace(cx, obj);
7312 }
7313 if (objIsXray) {
7314 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7315 // we know Xrays have no dynamic unwrap behavior.
7316 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7317 if (!unwrappedObj.ref()) {
7318 return false;
7319 }
7320 }
7321 FastErrorResult rv;
7322 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7323 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableExternal"
)), 0))
) {
7324 return false;
7325 }
7326 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7326); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7326; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7327 if (!result) {
7328 args.rval().setNull();
7329 return true;
7330 }
7331 if (!WrapObject(cx, result, args.rval())) {
7332 return false;
7333 }
7334 return true;
7335}
7336
7337static const JSJitInfo receiveWeakNullableExternal_methodinfo = {
7338 { (JSJitGetterOp)receiveWeakNullableExternal },
7339 { prototypes::id::TestJSImplInterface },
7340 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7341 JSJitInfo::Method,
7342 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7343 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7344 false, /* isInfallible. False in setters. */
7345 false, /* isMovable. Not relevant for setters. */
7346 false, /* isEliminatable. Not relevant for setters. */
7347 false, /* isAlwaysInSlot. Only relevant for getters. */
7348 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7349 false, /* isTypedMethod. Only relevant for methods. */
7350 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7351};
7352
7353MOZ_CAN_RUN_SCRIPT static bool
7354passExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7355{
7356 BindingCallContext cx(cx_, "TestJSImplInterface.passExternal");
7357 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7360( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7358 "TestJSImplInterface", "passExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7360( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7359 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7360( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7360 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7360( cx, "TestJSImplInterface"
, "passExternal", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7361
7362 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7363 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternal", 1)) {
7364 return false;
7365 }
7366 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7367 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7368 if (objIsXray) {
7369 unwrappedObj.emplace(cx, obj);
7370 }
7371 mozilla::dom::TestExternalInterface* arg0;
7372 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7373 if (args[0].isObject()) {
7374 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7375 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
)))), 0)))
) {
7376 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7377 return false;
7378 }
7379 MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestJSImplGenBinding.cpp"
, 7379); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { *((volatile int*)__null) = 7379; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7380 arg0 = arg0_holder;
7381 } else {
7382 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7383 return false;
7384 }
7385 if (objIsXray) {
7386 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7387 // we know Xrays have no dynamic unwrap behavior.
7388 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7389 if (!unwrappedObj.ref()) {
7390 return false;
7391 }
7392 }
7393 FastErrorResult rv;
7394 // NOTE: This assert does NOT call the function.
7395 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7396 MOZ_KnownLive(self)(self)->PassExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7397 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternal"
)), 0))
) {
7398 return false;
7399 }
7400 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7400); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7400; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7401 args.rval().setUndefined();
7402 return true;
7403}
7404
7405static const JSJitInfo passExternal_methodinfo = {
7406 { (JSJitGetterOp)passExternal },
7407 { prototypes::id::TestJSImplInterface },
7408 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7409 JSJitInfo::Method,
7410 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7411 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7412 false, /* isInfallible. False in setters. */
7413 false, /* isMovable. Not relevant for setters. */
7414 false, /* isEliminatable. Not relevant for setters. */
7415 false, /* isAlwaysInSlot. Only relevant for getters. */
7416 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7417 false, /* isTypedMethod. Only relevant for methods. */
7418 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7419};
7420
7421MOZ_CAN_RUN_SCRIPT static bool
7422passNullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7423{
7424 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternal");
7425 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7428( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7426 "TestJSImplInterface", "passNullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7428( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7427 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7428( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7428 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7428( cx, "TestJSImplInterface"
, "passNullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7429
7430 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7431 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternal", 1)) {
7432 return false;
7433 }
7434 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7435 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7436 if (objIsXray) {
7437 unwrappedObj.emplace(cx, obj);
7438 }
7439 mozilla::dom::TestExternalInterface* arg0;
7440 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7441 if (args[0].isObject()) {
7442 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7443 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
)))), 0)))
) {
7444 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7445 return false;
7446 }
7447 MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestJSImplGenBinding.cpp"
, 7447); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { *((volatile int*)__null) = 7447; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7448 arg0 = arg0_holder;
7449 } else if (args[0].isNullOrUndefined()) {
7450 arg0 = nullptr;
7451 } else {
7452 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7453 return false;
7454 }
7455 if (objIsXray) {
7456 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7457 // we know Xrays have no dynamic unwrap behavior.
7458 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7459 if (!unwrappedObj.ref()) {
7460 return false;
7461 }
7462 }
7463 FastErrorResult rv;
7464 // NOTE: This assert does NOT call the function.
7465 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7466 MOZ_KnownLive(self)(self)->PassNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7467 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternal"
)), 0))
) {
7468 return false;
7469 }
7470 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7470); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7470; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7471 args.rval().setUndefined();
7472 return true;
7473}
7474
7475static const JSJitInfo passNullableExternal_methodinfo = {
7476 { (JSJitGetterOp)passNullableExternal },
7477 { prototypes::id::TestJSImplInterface },
7478 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7479 JSJitInfo::Method,
7480 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7481 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7482 false, /* isInfallible. False in setters. */
7483 false, /* isMovable. Not relevant for setters. */
7484 false, /* isEliminatable. Not relevant for setters. */
7485 false, /* isAlwaysInSlot. Only relevant for getters. */
7486 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7487 false, /* isTypedMethod. Only relevant for methods. */
7488 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7489};
7490
7491MOZ_CAN_RUN_SCRIPT static bool
7492get_nonNullExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
7493{
7494 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7497( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7495 "TestJSImplInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7497( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7496 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7497( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7497 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7497( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7498
7499 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7500 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7501 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7502 if (objIsXray) {
7503 unwrappedObj.emplace(cx, obj);
7504 }
7505 if (objIsXray) {
7506 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7507 // we know Xrays have no dynamic unwrap behavior.
7508 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7509 if (!unwrappedObj.ref()) {
7510 return false;
7511 }
7512 }
7513 FastErrorResult rv;
7514 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->GetNonNullExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7515 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal getter"
)), 0))
) {
7516 return false;
7517 }
7518 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7518; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7519 if (!WrapObject(cx, result, args.rval())) {
7520 return false;
7521 }
7522 return true;
7523}
7524
7525MOZ_CAN_RUN_SCRIPT static bool
7526set_nonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
7527{
7528 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullExternal setter");
7529 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7532( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7530 "TestJSImplInterface", "nonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7532( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7531 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7532( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7532 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7532( cx, "TestJSImplInterface"
, "nonNullExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7533
7534 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7535 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7536 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7537 if (objIsXray) {
7538 unwrappedObj.emplace(cx, obj);
7539 }
7540 mozilla::dom::TestExternalInterface* arg0;
7541 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7542 if (args[0].isObject()) {
7543 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7544 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
)))), 0)))
) {
7545 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface");
7546 return false;
7547 }
7548 MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestJSImplGenBinding.cpp"
, 7548); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { *((volatile int*)__null) = 7548; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7549 arg0 = arg0_holder;
7550 } else {
7551 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
7552 return false;
7553 }
7554 if (objIsXray) {
7555 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7556 // we know Xrays have no dynamic unwrap behavior.
7557 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7558 if (!unwrappedObj.ref()) {
7559 return false;
7560 }
7561 }
7562 FastErrorResult rv;
7563 // NOTE: This assert does NOT call the function.
7564 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7565 MOZ_KnownLive(self)(self)->SetNonNullExternal(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7566 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullExternal setter"
)), 0))
) {
7567 return false;
7568 }
7569 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7569; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7570
7571 return true;
7572}
7573
7574static const JSJitInfo nonNullExternal_getterinfo = {
7575 { get_nonNullExternal },
7576 { prototypes::id::TestJSImplInterface },
7577 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7578 JSJitInfo::Getter,
7579 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7580 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7581 false, /* isInfallible. False in setters. */
7582 false, /* isMovable. Not relevant for setters. */
7583 false, /* isEliminatable. Not relevant for setters. */
7584 false, /* isAlwaysInSlot. Only relevant for getters. */
7585 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7586 false, /* isTypedMethod. Only relevant for methods. */
7587 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7588};
7589static const JSJitInfo nonNullExternal_setterinfo = {
7590 { (JSJitGetterOp)set_nonNullExternal },
7591 { prototypes::id::TestJSImplInterface },
7592 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7593 JSJitInfo::Setter,
7594 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7595 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7596 false, /* isInfallible. False in setters. */
7597 false, /* isMovable. Not relevant for setters. */
7598 false, /* isEliminatable. Not relevant for setters. */
7599 false, /* isAlwaysInSlot. Only relevant for getters. */
7600 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7601 false, /* isTypedMethod. Only relevant for methods. */
7602 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7603};
7604
7605MOZ_CAN_RUN_SCRIPT static bool
7606get_nullableExternal(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
7607{
7608 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7611( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7609 "TestJSImplInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7611( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7610 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject7611( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7611 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7611( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7612
7613 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7614 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7615 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7616 if (objIsXray) {
7617 unwrappedObj.emplace(cx, obj);
7618 }
7619 if (objIsXray) {
7620 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7621 // we know Xrays have no dynamic unwrap behavior.
7622 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7623 if (!unwrappedObj.ref()) {
7624 return false;
7625 }
7626 }
7627 FastErrorResult rv;
7628 auto result(StrongOrRawPtr<mozilla::dom::TestExternalInterface>(MOZ_KnownLive(self)(self)->GetNullableExternal(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7629 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal getter"
)), 0))
) {
7630 return false;
7631 }
7632 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7632); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7632; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7633 if (!result) {
7634 args.rval().setNull();
7635 return true;
7636 }
7637 if (!WrapObject(cx, result, args.rval())) {
7638 return false;
7639 }
7640 return true;
7641}
7642
7643MOZ_CAN_RUN_SCRIPT static bool
7644set_nullableExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
7645{
7646 BindingCallContext cx(cx_, "TestJSImplInterface.nullableExternal setter");
7647 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7650( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7648 "TestJSImplInterface", "nullableExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7650( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7649 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject7650( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7650 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7650( cx, "TestJSImplInterface"
, "nullableExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7651
7652 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7653 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7654 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7655 if (objIsXray) {
7656 unwrappedObj.emplace(cx, obj);
7657 }
7658 mozilla::dom::TestExternalInterface* arg0;
7659 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7660 if (args[0].isObject()) {
7661 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7662 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
)))), 0)))
) {
7663 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestExternalInterface");
7664 return false;
7665 }
7666 MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestJSImplGenBinding.cpp"
, 7666); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { *((volatile int*)__null) = 7666; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7667 arg0 = arg0_holder;
7668 } else if (args[0].isNullOrUndefined()) {
7669 arg0 = nullptr;
7670 } else {
7671 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
7672 return false;
7673 }
7674 if (objIsXray) {
7675 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7676 // we know Xrays have no dynamic unwrap behavior.
7677 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7678 if (!unwrappedObj.ref()) {
7679 return false;
7680 }
7681 }
7682 FastErrorResult rv;
7683 // NOTE: This assert does NOT call the function.
7684 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7685 MOZ_KnownLive(self)(self)->SetNullableExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7686 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableExternal setter"
)), 0))
) {
7687 return false;
7688 }
7689 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7689); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7689; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7690
7691 return true;
7692}
7693
7694static const JSJitInfo nullableExternal_getterinfo = {
7695 { get_nullableExternal },
7696 { prototypes::id::TestJSImplInterface },
7697 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7698 JSJitInfo::Getter,
7699 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7700 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
7701 false, /* isInfallible. False in setters. */
7702 false, /* isMovable. Not relevant for setters. */
7703 false, /* isEliminatable. Not relevant for setters. */
7704 false, /* isAlwaysInSlot. Only relevant for getters. */
7705 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7706 false, /* isTypedMethod. Only relevant for methods. */
7707 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7708};
7709static const JSJitInfo nullableExternal_setterinfo = {
7710 { (JSJitGetterOp)set_nullableExternal },
7711 { prototypes::id::TestJSImplInterface },
7712 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7713 JSJitInfo::Setter,
7714 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7715 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7716 false, /* isInfallible. False in setters. */
7717 false, /* isMovable. Not relevant for setters. */
7718 false, /* isEliminatable. Not relevant for setters. */
7719 false, /* isAlwaysInSlot. Only relevant for getters. */
7720 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7721 false, /* isTypedMethod. Only relevant for methods. */
7722 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7723};
7724
7725MOZ_CAN_RUN_SCRIPT static bool
7726passOptionalExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7727{
7728 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalExternal");
7729 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7730 "TestJSImplInterface", "passOptionalExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7731 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
7732 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7732( cx, "TestJSImplInterface"
, "passOptionalExternal", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
7733
7734 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7735 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7736 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7737 if (objIsXray) {
7738 unwrappedObj.emplace(cx, obj);
7739 }
7740 Optional<mozilla::dom::TestExternalInterface*> arg0;
7741 Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder;
7742 if (args.hasDefined(0)) {
7743 arg0.Construct();
7744 arg0_holder.emplace();
7745 if (args[0].isObject()) {
7746 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7747 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder.ref())))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
.ref())))), 0)))
) {
7748 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7749 return false;
7750 }
7751 MOZ_ASSERT(arg0_holder.ref())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder.ref())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder.ref()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("arg0_holder.ref()"
, "../TestJSImplGenBinding.cpp", 7751); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { *((volatile int
*)__null) = 7751; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
7752 arg0.Value() = arg0_holder.ref();
7753 } else if (args[0].isNullOrUndefined()) {
7754 arg0.Value() = nullptr;
7755 } else {
7756 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7757 return false;
7758 }
7759 }
7760 if (objIsXray) {
7761 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7762 // we know Xrays have no dynamic unwrap behavior.
7763 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7764 if (!unwrappedObj.ref()) {
7765 return false;
7766 }
7767 }
7768 FastErrorResult rv;
7769 // NOTE: This assert does NOT call the function.
7770 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7771 MOZ_KnownLive(self)(self)->PassOptionalExternal(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7772 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternal"
)), 0))
) {
7773 return false;
7774 }
7775 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7775); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7775; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7776 args.rval().setUndefined();
7777 return true;
7778}
7779
7780static const JSJitInfo passOptionalExternal_methodinfo = {
7781 { (JSJitGetterOp)passOptionalExternal },
7782 { prototypes::id::TestJSImplInterface },
7783 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7784 JSJitInfo::Method,
7785 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7786 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7787 false, /* isInfallible. False in setters. */
7788 false, /* isMovable. Not relevant for setters. */
7789 false, /* isEliminatable. Not relevant for setters. */
7790 false, /* isAlwaysInSlot. Only relevant for getters. */
7791 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7792 false, /* isTypedMethod. Only relevant for methods. */
7793 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7794};
7795
7796MOZ_CAN_RUN_SCRIPT static bool
7797passOptionalNonNullExternal(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7798{
7799 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullExternal");
7800 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7803( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7801 "TestJSImplInterface", "passOptionalNonNullExternal", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7803( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7802 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7803( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7803 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7803( cx, "TestJSImplInterface"
, "passOptionalNonNullExternal", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7804
7805 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7806 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7807 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7808 if (objIsXray) {
7809 unwrappedObj.emplace(cx, obj);
7810 }
7811 Optional<mozilla::dom::TestExternalInterface*> arg0;
7812 Maybe<RefPtr<mozilla::dom::TestExternalInterface>> arg0_holder;
7813 if (args.hasDefined(0)) {
7814 arg0.Construct();
7815 arg0_holder.emplace();
7816 if (args[0].isObject()) {
7817 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7818 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder.ref())))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
.ref())))), 0)))
) {
7819 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7820 return false;
7821 }
7822 MOZ_ASSERT(arg0_holder.ref())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder.ref())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder.ref()))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("arg0_holder.ref()"
, "../TestJSImplGenBinding.cpp", 7822); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "arg0_holder.ref()" ")"); do { *((volatile int
*)__null) = 7822; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
7823 arg0.Value() = arg0_holder.ref();
7824 } else {
7825 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7826 return false;
7827 }
7828 }
7829 if (objIsXray) {
7830 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7831 // we know Xrays have no dynamic unwrap behavior.
7832 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7833 if (!unwrappedObj.ref()) {
7834 return false;
7835 }
7836 }
7837 FastErrorResult rv;
7838 // NOTE: This assert does NOT call the function.
7839 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullExternal(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7840 MOZ_KnownLive(self)(self)->PassOptionalNonNullExternal(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7841 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullExternal"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullExternal"
)), 0))
) {
7842 return false;
7843 }
7844 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7844); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7844; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7845 args.rval().setUndefined();
7846 return true;
7847}
7848
7849static const JSJitInfo passOptionalNonNullExternal_methodinfo = {
7850 { (JSJitGetterOp)passOptionalNonNullExternal },
7851 { prototypes::id::TestJSImplInterface },
7852 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7853 JSJitInfo::Method,
7854 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7855 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7856 false, /* isInfallible. False in setters. */
7857 false, /* isMovable. Not relevant for setters. */
7858 false, /* isEliminatable. Not relevant for setters. */
7859 false, /* isAlwaysInSlot. Only relevant for getters. */
7860 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7861 false, /* isTypedMethod. Only relevant for methods. */
7862 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7863};
7864
7865MOZ_CAN_RUN_SCRIPT static bool
7866passOptionalExternalWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7867{
7868 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalExternalWithDefault");
7869 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7872( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7870 "TestJSImplInterface", "passOptionalExternalWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7872( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7871 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7872( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7872 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7872( cx, "TestJSImplInterface"
, "passOptionalExternalWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7873
7874 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7875 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7876 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7877 if (objIsXray) {
7878 unwrappedObj.emplace(cx, obj);
7879 }
7880 mozilla::dom::TestExternalInterface* arg0;
7881 RefPtr<mozilla::dom::TestExternalInterface> arg0_holder;
7882 if (args.hasDefined(0)) {
7883 if (args[0].isObject()) {
7884 JS::Rooted<JSObject*> source(cx, &args[0].toObject());
7885 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(arg0_holder
)))), 0)))
) {
7886 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestExternalInterface");
7887 return false;
7888 }
7889 MOZ_ASSERT(arg0_holder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(arg0_holder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(arg0_holder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("arg0_holder", "../TestJSImplGenBinding.cpp"
, 7889); AnnotateMozCrashReason("MOZ_ASSERT" "(" "arg0_holder"
")"); do { *((volatile int*)__null) = 7889; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
7890 arg0 = arg0_holder;
7891 } else if (args[0].isNullOrUndefined()) {
7892 arg0 = nullptr;
7893 } else {
7894 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
7895 return false;
7896 }
7897 } else {
7898 arg0 = nullptr;
7899 }
7900 if (objIsXray) {
7901 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7902 // we know Xrays have no dynamic unwrap behavior.
7903 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7904 if (!unwrappedObj.ref()) {
7905 return false;
7906 }
7907 }
7908 FastErrorResult rv;
7909 // NOTE: This assert does NOT call the function.
7910 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalExternalWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
7911 MOZ_KnownLive(self)(self)->PassOptionalExternalWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
7912 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternalWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalExternalWithDefault"
)), 0))
) {
7913 return false;
7914 }
7915 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7915); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7915; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7916 args.rval().setUndefined();
7917 return true;
7918}
7919
7920static const JSJitInfo passOptionalExternalWithDefault_methodinfo = {
7921 { (JSJitGetterOp)passOptionalExternalWithDefault },
7922 { prototypes::id::TestJSImplInterface },
7923 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7924 JSJitInfo::Method,
7925 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7926 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
7927 false, /* isInfallible. False in setters. */
7928 false, /* isMovable. Not relevant for setters. */
7929 false, /* isEliminatable. Not relevant for setters. */
7930 false, /* isAlwaysInSlot. Only relevant for getters. */
7931 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7932 false, /* isTypedMethod. Only relevant for methods. */
7933 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7934};
7935
7936MOZ_CAN_RUN_SCRIPT static bool
7937receiveCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7938{
7939 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7942( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7940 "TestJSImplInterface", "receiveCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7942( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7941 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7942( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7942 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7942( cx, "TestJSImplInterface"
, "receiveCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7943
7944 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7945 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7946 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7947 if (objIsXray) {
7948 unwrappedObj.emplace(cx, obj);
7949 }
7950 if (objIsXray) {
7951 // Since our object is an Xray, we can just CheckedUnwrapStatic:
7952 // we know Xrays have no dynamic unwrap behavior.
7953 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
7954 if (!unwrappedObj.ref()) {
7955 return false;
7956 }
7957 }
7958 FastErrorResult rv;
7959 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
7960 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackInterface"
)), 0))
) {
7961 return false;
7962 }
7963 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 7963); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 7963; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
7964 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
7965 if (!MaybeWrapObjectValue(cx, args.rval())) {
7966 return false;
7967 }
7968 return true;
7969}
7970
7971static const JSJitInfo receiveCallbackInterface_methodinfo = {
7972 { (JSJitGetterOp)receiveCallbackInterface },
7973 { prototypes::id::TestJSImplInterface },
7974 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
7975 JSJitInfo::Method,
7976 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
7977 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
7978 false, /* isInfallible. False in setters. */
7979 false, /* isMovable. Not relevant for setters. */
7980 false, /* isEliminatable. Not relevant for setters. */
7981 false, /* isAlwaysInSlot. Only relevant for getters. */
7982 false, /* isLazilyCachedInSlot. Only relevant for getters. */
7983 false, /* isTypedMethod. Only relevant for methods. */
7984 0 /* Reserved slot index, if we're stored in a slot, else 0. */
7985};
7986
7987MOZ_CAN_RUN_SCRIPT static bool
7988receiveNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
7989{
7990 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject7993( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7991 "TestJSImplInterface", "receiveNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject7993( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7992 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject7993( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
7993 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject7993( cx, "TestJSImplInterface"
, "receiveNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
7994
7995 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
7996 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
7997 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
7998 if (objIsXray) {
7999 unwrappedObj.emplace(cx, obj);
8000 }
8001 if (objIsXray) {
8002 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8003 // we know Xrays have no dynamic unwrap behavior.
8004 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8005 if (!unwrappedObj.ref()) {
8006 return false;
8007 }
8008 }
8009 FastErrorResult rv;
8010 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8011 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackInterface"
)), 0))
) {
8012 return false;
8013 }
8014 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8014); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8014; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8015 if (result) {
8016 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8017 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8018 return false;
8019 }
8020 return true;
8021 } else {
8022 args.rval().setNull();
8023 return true;
8024 }
8025}
8026
8027static const JSJitInfo receiveNullableCallbackInterface_methodinfo = {
8028 { (JSJitGetterOp)receiveNullableCallbackInterface },
8029 { prototypes::id::TestJSImplInterface },
8030 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8031 JSJitInfo::Method,
8032 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8033 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8034 false, /* isInfallible. False in setters. */
8035 false, /* isMovable. Not relevant for setters. */
8036 false, /* isEliminatable. Not relevant for setters. */
8037 false, /* isAlwaysInSlot. Only relevant for getters. */
8038 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8039 false, /* isTypedMethod. Only relevant for methods. */
8040 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8041};
8042
8043MOZ_CAN_RUN_SCRIPT static bool
8044receiveWeakCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8045{
8046 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8049( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8047 "TestJSImplInterface", "receiveWeakCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8049( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8048 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8049( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8049 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8049( cx, "TestJSImplInterface"
, "receiveWeakCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8050
8051 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8052 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8053 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8054 if (objIsXray) {
8055 unwrappedObj.emplace(cx, obj);
8056 }
8057 if (objIsXray) {
8058 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8059 // we know Xrays have no dynamic unwrap behavior.
8060 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8061 if (!unwrappedObj.ref()) {
8062 return false;
8063 }
8064 }
8065 FastErrorResult rv;
8066 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8067 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCallbackInterface"
)), 0))
) {
8068 return false;
8069 }
8070 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8070); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8070; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8071 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8072 if (!MaybeWrapObjectValue(cx, args.rval())) {
8073 return false;
8074 }
8075 return true;
8076}
8077
8078static const JSJitInfo receiveWeakCallbackInterface_methodinfo = {
8079 { (JSJitGetterOp)receiveWeakCallbackInterface },
8080 { prototypes::id::TestJSImplInterface },
8081 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8082 JSJitInfo::Method,
8083 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8084 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8085 false, /* isInfallible. False in setters. */
8086 false, /* isMovable. Not relevant for setters. */
8087 false, /* isEliminatable. Not relevant for setters. */
8088 false, /* isAlwaysInSlot. Only relevant for getters. */
8089 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8090 false, /* isTypedMethod. Only relevant for methods. */
8091 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8092};
8093
8094MOZ_CAN_RUN_SCRIPT static bool
8095receiveWeakNullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8096{
8097 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8100( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8098 "TestJSImplInterface", "receiveWeakNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8100( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8099 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8100( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8100 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8100( cx, "TestJSImplInterface"
, "receiveWeakNullableCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8101
8102 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8103 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8104 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8105 if (objIsXray) {
8106 unwrappedObj.emplace(cx, obj);
8107 }
8108 if (objIsXray) {
8109 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8110 // we know Xrays have no dynamic unwrap behavior.
8111 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8112 if (!unwrappedObj.ref()) {
8113 return false;
8114 }
8115 }
8116 FastErrorResult rv;
8117 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8118 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCallbackInterface"
)), 0))
) {
8119 return false;
8120 }
8121 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8121); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8121; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8122 if (result) {
8123 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8124 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8125 return false;
8126 }
8127 return true;
8128 } else {
8129 args.rval().setNull();
8130 return true;
8131 }
8132}
8133
8134static const JSJitInfo receiveWeakNullableCallbackInterface_methodinfo = {
8135 { (JSJitGetterOp)receiveWeakNullableCallbackInterface },
8136 { prototypes::id::TestJSImplInterface },
8137 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8138 JSJitInfo::Method,
8139 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8140 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8141 false, /* isInfallible. False in setters. */
8142 false, /* isMovable. Not relevant for setters. */
8143 false, /* isEliminatable. Not relevant for setters. */
8144 false, /* isAlwaysInSlot. Only relevant for getters. */
8145 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8146 false, /* isTypedMethod. Only relevant for methods. */
8147 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8148};
8149
8150MOZ_CAN_RUN_SCRIPT static bool
8151passCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8152{
8153 BindingCallContext cx(cx_, "TestJSImplInterface.passCallbackInterface");
8154 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8157( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8155 "TestJSImplInterface", "passCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8157( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8156 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8157( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8157 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8157( cx, "TestJSImplInterface"
, "passCallbackInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8158
8159 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8160 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCallbackInterface", 1)) {
8161 return false;
8162 }
8163 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8164 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8165 if (objIsXray) {
8166 unwrappedObj.emplace(cx, obj);
8167 }
8168 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
8169 if (args[0].isObject()) {
8170 { // scope for tempRoot and tempGlobalRoot if needed
8171 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8172 }
8173 } else {
8174 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8175 return false;
8176 }
8177 if (objIsXray) {
8178 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8179 // we know Xrays have no dynamic unwrap behavior.
8180 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8181 if (!unwrappedObj.ref()) {
8182 return false;
8183 }
8184 }
8185 FastErrorResult rv;
8186 // NOTE: This assert does NOT call the function.
8187 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8188 MOZ_KnownLive(self)(self)->PassCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8189 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallbackInterface"
)), 0))
) {
8190 return false;
8191 }
8192 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8192); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8192; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8193 args.rval().setUndefined();
8194 return true;
8195}
8196
8197static const JSJitInfo passCallbackInterface_methodinfo = {
8198 { (JSJitGetterOp)passCallbackInterface },
8199 { prototypes::id::TestJSImplInterface },
8200 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8201 JSJitInfo::Method,
8202 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8203 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8204 false, /* isInfallible. False in setters. */
8205 false, /* isMovable. Not relevant for setters. */
8206 false, /* isEliminatable. Not relevant for setters. */
8207 false, /* isAlwaysInSlot. Only relevant for getters. */
8208 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8209 false, /* isTypedMethod. Only relevant for methods. */
8210 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8211};
8212
8213MOZ_CAN_RUN_SCRIPT static bool
8214passNullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8215{
8216 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCallbackInterface");
8217 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8220( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8218 "TestJSImplInterface", "passNullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8220( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8219 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8220( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8220 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8220( cx, "TestJSImplInterface"
, "passNullableCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8221
8222 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8223 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCallbackInterface", 1)) {
8224 return false;
8225 }
8226 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8227 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8228 if (objIsXray) {
8229 unwrappedObj.emplace(cx, obj);
8230 }
8231 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8232 if (args[0].isObject()) {
8233 { // scope for tempRoot and tempGlobalRoot if needed
8234 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8235 }
8236 } else if (args[0].isNullOrUndefined()) {
8237 arg0 = nullptr;
8238 } else {
8239 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8240 return false;
8241 }
8242 if (objIsXray) {
8243 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8244 // we know Xrays have no dynamic unwrap behavior.
8245 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8246 if (!unwrappedObj.ref()) {
8247 return false;
8248 }
8249 }
8250 FastErrorResult rv;
8251 // NOTE: This assert does NOT call the function.
8252 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8253 MOZ_KnownLive(self)(self)->PassNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8254 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallbackInterface"
)), 0))
) {
8255 return false;
8256 }
8257 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8257); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8257; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8258 args.rval().setUndefined();
8259 return true;
8260}
8261
8262static const JSJitInfo passNullableCallbackInterface_methodinfo = {
8263 { (JSJitGetterOp)passNullableCallbackInterface },
8264 { prototypes::id::TestJSImplInterface },
8265 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8266 JSJitInfo::Method,
8267 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8268 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8269 false, /* isInfallible. False in setters. */
8270 false, /* isMovable. Not relevant for setters. */
8271 false, /* isEliminatable. Not relevant for setters. */
8272 false, /* isAlwaysInSlot. Only relevant for getters. */
8273 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8274 false, /* isTypedMethod. Only relevant for methods. */
8275 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8276};
8277
8278MOZ_CAN_RUN_SCRIPT static bool
8279get_nonNullCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
8280{
8281 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8284( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8282 "TestJSImplInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8284( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8283 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8284( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8284 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8284( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8285
8286 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8287 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8288 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8289 if (objIsXray) {
8290 unwrappedObj.emplace(cx, obj);
8291 }
8292 if (objIsXray) {
8293 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8294 // we know Xrays have no dynamic unwrap behavior.
8295 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8296 if (!unwrappedObj.ref()) {
8297 return false;
8298 }
8299 }
8300 FastErrorResult rv;
8301 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetNonNullCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8302 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface getter"
)), 0))
) {
8303 return false;
8304 }
8305 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8305); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8305; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8306 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8307 if (!MaybeWrapObjectValue(cx, args.rval())) {
8308 return false;
8309 }
8310 return true;
8311}
8312
8313MOZ_CAN_RUN_SCRIPT static bool
8314set_nonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
8315{
8316 BindingCallContext cx(cx_, "TestJSImplInterface.nonNullCallbackInterface setter");
8317 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8320( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8318 "TestJSImplInterface", "nonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8320( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8319 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject8320( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8320 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8320( cx, "TestJSImplInterface"
, "nonNullCallbackInterface", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8321
8322 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8323 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8324 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8325 if (objIsXray) {
8326 unwrappedObj.emplace(cx, obj);
8327 }
8328 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
8329 if (args[0].isObject()) {
8330 { // scope for tempRoot and tempGlobalRoot if needed
8331 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8332 }
8333 } else {
8334 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
8335 return false;
8336 }
8337 if (objIsXray) {
8338 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8339 // we know Xrays have no dynamic unwrap behavior.
8340 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8341 if (!unwrappedObj.ref()) {
8342 return false;
8343 }
8344 }
8345 FastErrorResult rv;
8346 // NOTE: This assert does NOT call the function.
8347 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8348 MOZ_KnownLive(self)(self)->SetNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8349 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonNullCallbackInterface setter"
)), 0))
) {
8350 return false;
8351 }
8352 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8352); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8352; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8353
8354 return true;
8355}
8356
8357static const JSJitInfo nonNullCallbackInterface_getterinfo = {
8358 { get_nonNullCallbackInterface },
8359 { prototypes::id::TestJSImplInterface },
8360 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8361 JSJitInfo::Getter,
8362 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8363 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8364 false, /* isInfallible. False in setters. */
8365 false, /* isMovable. Not relevant for setters. */
8366 false, /* isEliminatable. Not relevant for setters. */
8367 false, /* isAlwaysInSlot. Only relevant for getters. */
8368 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8369 false, /* isTypedMethod. Only relevant for methods. */
8370 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8371};
8372static const JSJitInfo nonNullCallbackInterface_setterinfo = {
8373 { (JSJitGetterOp)set_nonNullCallbackInterface },
8374 { prototypes::id::TestJSImplInterface },
8375 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8376 JSJitInfo::Setter,
8377 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8378 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8379 false, /* isInfallible. False in setters. */
8380 false, /* isMovable. Not relevant for setters. */
8381 false, /* isEliminatable. Not relevant for setters. */
8382 false, /* isAlwaysInSlot. Only relevant for getters. */
8383 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8384 false, /* isTypedMethod. Only relevant for methods. */
8385 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8386};
8387
8388MOZ_CAN_RUN_SCRIPT static bool
8389get_nullableCallbackInterface(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
8390{
8391 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8394( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8392 "TestJSImplInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8394( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8393 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject8394( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8394 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8394( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8395
8396 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8397 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8398 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8399 if (objIsXray) {
8400 unwrappedObj.emplace(cx, obj);
8401 }
8402 if (objIsXray) {
8403 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8404 // we know Xrays have no dynamic unwrap behavior.
8405 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8406 if (!unwrappedObj.ref()) {
8407 return false;
8408 }
8409 }
8410 FastErrorResult rv;
8411 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetNullableCallbackInterface(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
8412 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface getter"
)), 0))
) {
8413 return false;
8414 }
8415 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8415); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8415; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8416 if (result) {
8417 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
8418 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
8419 return false;
8420 }
8421 return true;
8422 } else {
8423 args.rval().setNull();
8424 return true;
8425 }
8426}
8427
8428MOZ_CAN_RUN_SCRIPT static bool
8429set_nullableCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
8430{
8431 BindingCallContext cx(cx_, "TestJSImplInterface.nullableCallbackInterface setter");
8432 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8435( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8433 "TestJSImplInterface", "nullableCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8435( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8434 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject8435( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8435 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8435( cx, "TestJSImplInterface"
, "nullableCallbackInterface", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8436
8437 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8438 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8439 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8440 if (objIsXray) {
8441 unwrappedObj.emplace(cx, obj);
8442 }
8443 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8444 if (args[0].isObject()) {
8445 { // scope for tempRoot and tempGlobalRoot if needed
8446 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8447 }
8448 } else if (args[0].isNullOrUndefined()) {
8449 arg0 = nullptr;
8450 } else {
8451 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
8452 return false;
8453 }
8454 if (objIsXray) {
8455 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8456 // we know Xrays have no dynamic unwrap behavior.
8457 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8458 if (!unwrappedObj.ref()) {
8459 return false;
8460 }
8461 }
8462 FastErrorResult rv;
8463 // NOTE: This assert does NOT call the function.
8464 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8465 MOZ_KnownLive(self)(self)->SetNullableCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8466 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nullableCallbackInterface setter"
)), 0))
) {
8467 return false;
8468 }
8469 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8469; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8470
8471 return true;
8472}
8473
8474static const JSJitInfo nullableCallbackInterface_getterinfo = {
8475 { get_nullableCallbackInterface },
8476 { prototypes::id::TestJSImplInterface },
8477 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8478 JSJitInfo::Getter,
8479 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8480 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8481 false, /* isInfallible. False in setters. */
8482 false, /* isMovable. Not relevant for setters. */
8483 false, /* isEliminatable. Not relevant for setters. */
8484 false, /* isAlwaysInSlot. Only relevant for getters. */
8485 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8486 false, /* isTypedMethod. Only relevant for methods. */
8487 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8488};
8489static const JSJitInfo nullableCallbackInterface_setterinfo = {
8490 { (JSJitGetterOp)set_nullableCallbackInterface },
8491 { prototypes::id::TestJSImplInterface },
8492 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8493 JSJitInfo::Setter,
8494 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8495 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8496 false, /* isInfallible. False in setters. */
8497 false, /* isMovable. Not relevant for setters. */
8498 false, /* isEliminatable. Not relevant for setters. */
8499 false, /* isAlwaysInSlot. Only relevant for getters. */
8500 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8501 false, /* isTypedMethod. Only relevant for methods. */
8502 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8503};
8504
8505MOZ_CAN_RUN_SCRIPT static bool
8506passOptionalCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8507{
8508 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallbackInterface");
8509 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8512( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8510 "TestJSImplInterface", "passOptionalCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8512( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8511 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8512( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8512 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8512( cx, "TestJSImplInterface"
, "passOptionalCallbackInterface", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8513
8514 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8515 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8516 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8517 if (objIsXray) {
8518 unwrappedObj.emplace(cx, obj);
8519 }
8520 Optional<RefPtr<TestCallbackInterface>> arg0;
8521 if (args.hasDefined(0)) {
8522 arg0.Construct();
8523 if (args[0].isObject()) {
8524 { // scope for tempRoot and tempGlobalRoot if needed
8525 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
8526 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
8527 arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
8528 }
8529 } else if (args[0].isNullOrUndefined()) {
8530 arg0.Value() = nullptr;
8531 } else {
8532 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8533 return false;
8534 }
8535 }
8536 if (objIsXray) {
8537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8538 // we know Xrays have no dynamic unwrap behavior.
8539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8540 if (!unwrappedObj.ref()) {
8541 return false;
8542 }
8543 }
8544 FastErrorResult rv;
8545 // NOTE: This assert does NOT call the function.
8546 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8547 MOZ_KnownLive(self)(self)->PassOptionalCallbackInterface(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterface"
)), 0))
) {
8549 return false;
8550 }
8551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8551; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8552 args.rval().setUndefined();
8553 return true;
8554}
8555
8556static const JSJitInfo passOptionalCallbackInterface_methodinfo = {
8557 { (JSJitGetterOp)passOptionalCallbackInterface },
8558 { prototypes::id::TestJSImplInterface },
8559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8560 JSJitInfo::Method,
8561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8563 false, /* isInfallible. False in setters. */
8564 false, /* isMovable. Not relevant for setters. */
8565 false, /* isEliminatable. Not relevant for setters. */
8566 false, /* isAlwaysInSlot. Only relevant for getters. */
8567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8568 false, /* isTypedMethod. Only relevant for methods. */
8569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8570};
8571
8572MOZ_CAN_RUN_SCRIPT static bool
8573passOptionalNonNullCallbackInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8574{
8575 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNonNullCallbackInterface");
8576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8579( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8577 "TestJSImplInterface", "passOptionalNonNullCallbackInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8579( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8579( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8579( cx, "TestJSImplInterface"
, "passOptionalNonNullCallbackInterface", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8580
8581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8584 if (objIsXray) {
8585 unwrappedObj.emplace(cx, obj);
8586 }
8587 Optional<OwningNonNull<TestCallbackInterface>> arg0;
8588 if (args.hasDefined(0)) {
8589 arg0.Construct();
8590 if (args[0].isObject()) {
8591 { // scope for tempRoot and tempGlobalRoot if needed
8592 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
8593 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
8594 arg0.Value() = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
8595 }
8596 } else {
8597 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8598 return false;
8599 }
8600 }
8601 if (objIsXray) {
8602 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8603 // we know Xrays have no dynamic unwrap behavior.
8604 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8605 if (!unwrappedObj.ref()) {
8606 return false;
8607 }
8608 }
8609 FastErrorResult rv;
8610 // NOTE: This assert does NOT call the function.
8611 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8612 MOZ_KnownLive(self)(self)->PassOptionalNonNullCallbackInterface(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8613 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullCallbackInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNonNullCallbackInterface"
)), 0))
) {
8614 return false;
8615 }
8616 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8616); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8616; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8617 args.rval().setUndefined();
8618 return true;
8619}
8620
8621static const JSJitInfo passOptionalNonNullCallbackInterface_methodinfo = {
8622 { (JSJitGetterOp)passOptionalNonNullCallbackInterface },
8623 { prototypes::id::TestJSImplInterface },
8624 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8625 JSJitInfo::Method,
8626 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8627 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8628 false, /* isInfallible. False in setters. */
8629 false, /* isMovable. Not relevant for setters. */
8630 false, /* isEliminatable. Not relevant for setters. */
8631 false, /* isAlwaysInSlot. Only relevant for getters. */
8632 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8633 false, /* isTypedMethod. Only relevant for methods. */
8634 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8635};
8636
8637MOZ_CAN_RUN_SCRIPT static bool
8638passOptionalCallbackInterfaceWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8639{
8640 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault");
8641 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8644( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8642 "TestJSImplInterface", "passOptionalCallbackInterfaceWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8644( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8643 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8644( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8644 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8644( cx, "TestJSImplInterface"
, "passOptionalCallbackInterfaceWithDefault", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8645
8646 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8647 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8648 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8649 if (objIsXray) {
8650 unwrappedObj.emplace(cx, obj);
8651 }
8652 RootedCallback<RefPtr<binding_detail::FastTestCallbackInterface>> arg0(cx);
8653 if (args.hasDefined(0)) {
8654 if (args[0].isObject()) {
8655 { // scope for tempRoot and tempGlobalRoot if needed
8656 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
8657 }
8658 } else if (args[0].isNullOrUndefined()) {
8659 arg0 = nullptr;
8660 } else {
8661 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
8662 return false;
8663 }
8664 } else {
8665 arg0 = nullptr;
8666 }
8667 if (objIsXray) {
8668 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8669 // we know Xrays have no dynamic unwrap behavior.
8670 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8671 if (!unwrappedObj.ref()) {
8672 return false;
8673 }
8674 }
8675 FastErrorResult rv;
8676 // NOTE: This assert does NOT call the function.
8677 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallbackInterfaceWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8678 MOZ_KnownLive(self)(self)->PassOptionalCallbackInterfaceWithDefault(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8679 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault"
)), 0))
) {
8680 return false;
8681 }
8682 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8682); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8682; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8683 args.rval().setUndefined();
8684 return true;
8685}
8686
8687static const JSJitInfo passOptionalCallbackInterfaceWithDefault_methodinfo = {
8688 { (JSJitGetterOp)passOptionalCallbackInterfaceWithDefault },
8689 { prototypes::id::TestJSImplInterface },
8690 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8691 JSJitInfo::Method,
8692 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8693 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
8694 false, /* isInfallible. False in setters. */
8695 false, /* isMovable. Not relevant for setters. */
8696 false, /* isEliminatable. Not relevant for setters. */
8697 false, /* isAlwaysInSlot. Only relevant for getters. */
8698 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8699 false, /* isTypedMethod. Only relevant for methods. */
8700 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8701};
8702
8703MOZ_CAN_RUN_SCRIPT static bool
8704receiveSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8705{
8706 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8709( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8707 "TestJSImplInterface", "receiveSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8709( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8708 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8709( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8709 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8709( cx, "TestJSImplInterface"
, "receiveSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8710
8711 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8712 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8713 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8714 if (objIsXray) {
8715 unwrappedObj.emplace(cx, obj);
8716 }
8717 if (objIsXray) {
8718 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8719 // we know Xrays have no dynamic unwrap behavior.
8720 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8721 if (!unwrappedObj.ref()) {
8722 return false;
8723 }
8724 }
8725 FastErrorResult rv;
8726 nsTArray<int32_t> result;
8727 // NOTE: This assert does NOT call the function.
8728 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8729 MOZ_KnownLive(self)(self)->ReceiveSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8730 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequence"
)), 0))
) {
8731 return false;
8732 }
8733 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8733); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8733; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8734
8735 uint32_t length = result.Length();
8736 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8737 if (!returnArray) {
8738 return false;
8739 }
8740 // Scope for 'tmp'
8741 {
8742 JS::Rooted<JS::Value> tmp(cx);
8743 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8744 // Control block to let us common up the JS_DefineElement calls when there
8745 // are different ways to succeed at wrapping the object.
8746 do {
8747 tmp.setInt32(int32_t(result[sequenceIdx0]));
8748 break;
8749 } while (false);
8750 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8751 JSPROP_ENUMERATE)) {
8752 return false;
8753 }
8754 }
8755 }
8756 args.rval().setObject(*returnArray);
8757 return true;
8758}
8759
8760static const JSJitInfo receiveSequence_methodinfo = {
8761 { (JSJitGetterOp)receiveSequence },
8762 { prototypes::id::TestJSImplInterface },
8763 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8764 JSJitInfo::Method,
8765 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8766 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8767 false, /* isInfallible. False in setters. */
8768 false, /* isMovable. Not relevant for setters. */
8769 false, /* isEliminatable. Not relevant for setters. */
8770 false, /* isAlwaysInSlot. Only relevant for getters. */
8771 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8772 false, /* isTypedMethod. Only relevant for methods. */
8773 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8774};
8775
8776MOZ_CAN_RUN_SCRIPT static bool
8777receiveNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8778{
8779 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8782( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8780 "TestJSImplInterface", "receiveNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8782( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8781 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8782( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
8782 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8782( cx, "TestJSImplInterface"
, "receiveNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
8783
8784 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8785 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8786 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8787 if (objIsXray) {
8788 unwrappedObj.emplace(cx, obj);
8789 }
8790 if (objIsXray) {
8791 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8792 // we know Xrays have no dynamic unwrap behavior.
8793 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8794 if (!unwrappedObj.ref()) {
8795 return false;
8796 }
8797 }
8798 FastErrorResult rv;
8799 Nullable<nsTArray<int32_t>> result;
8800 // NOTE: This assert does NOT call the function.
8801 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8802 MOZ_KnownLive(self)(self)->ReceiveNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8803 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequence"
)), 0))
) {
8804 return false;
8805 }
8806 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8806); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8806; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8807
8808 if (result.IsNull()) {
8809 args.rval().setNull();
8810 return true;
8811 }
8812
8813 uint32_t length = result.Value().Length();
8814 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8815 if (!returnArray) {
8816 return false;
8817 }
8818 // Scope for 'tmp'
8819 {
8820 JS::Rooted<JS::Value> tmp(cx);
8821 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8822 // Control block to let us common up the JS_DefineElement calls when there
8823 // are different ways to succeed at wrapping the object.
8824 do {
8825 tmp.setInt32(int32_t(result.Value()[sequenceIdx0]));
8826 break;
8827 } while (false);
8828 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8829 JSPROP_ENUMERATE)) {
8830 return false;
8831 }
8832 }
8833 }
8834 args.rval().setObject(*returnArray);
8835 return true;
8836}
8837
8838static const JSJitInfo receiveNullableSequence_methodinfo = {
8839 { (JSJitGetterOp)receiveNullableSequence },
8840 { prototypes::id::TestJSImplInterface },
8841 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8842 JSJitInfo::Method,
8843 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8844 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
8845 false, /* isInfallible. False in setters. */
8846 false, /* isMovable. Not relevant for setters. */
8847 false, /* isEliminatable. Not relevant for setters. */
8848 false, /* isAlwaysInSlot. Only relevant for getters. */
8849 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8850 false, /* isTypedMethod. Only relevant for methods. */
8851 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8852};
8853
8854MOZ_CAN_RUN_SCRIPT static bool
8855receiveSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8856{
8857 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8860( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8858 "TestJSImplInterface", "receiveSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8860( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8859 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8860( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8860 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8860( cx, "TestJSImplInterface"
, "receiveSequenceOfNullableInts", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8861
8862 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8863 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8864 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8865 if (objIsXray) {
8866 unwrappedObj.emplace(cx, obj);
8867 }
8868 if (objIsXray) {
8869 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8870 // we know Xrays have no dynamic unwrap behavior.
8871 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8872 if (!unwrappedObj.ref()) {
8873 return false;
8874 }
8875 }
8876 FastErrorResult rv;
8877 nsTArray<Nullable<int32_t>> result;
8878 // NOTE: This assert does NOT call the function.
8879 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8880 MOZ_KnownLive(self)(self)->ReceiveSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8881 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSequenceOfNullableInts"
)), 0))
) {
8882 return false;
8883 }
8884 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8884); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8884; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8885
8886 uint32_t length = result.Length();
8887 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8888 if (!returnArray) {
8889 return false;
8890 }
8891 // Scope for 'tmp'
8892 {
8893 JS::Rooted<JS::Value> tmp(cx);
8894 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8895 // Control block to let us common up the JS_DefineElement calls when there
8896 // are different ways to succeed at wrapping the object.
8897 do {
8898 if (result[sequenceIdx0].IsNull()) {
8899 tmp.setNull();
8900 break;
8901 }
8902 tmp.setInt32(int32_t(result[sequenceIdx0].Value()));
8903 break;
8904 } while (false);
8905 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8906 JSPROP_ENUMERATE)) {
8907 return false;
8908 }
8909 }
8910 }
8911 args.rval().setObject(*returnArray);
8912 return true;
8913}
8914
8915static const JSJitInfo receiveSequenceOfNullableInts_methodinfo = {
8916 { (JSJitGetterOp)receiveSequenceOfNullableInts },
8917 { prototypes::id::TestJSImplInterface },
8918 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
8919 JSJitInfo::Method,
8920 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
8921 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
8922 false, /* isInfallible. False in setters. */
8923 false, /* isMovable. Not relevant for setters. */
8924 false, /* isEliminatable. Not relevant for setters. */
8925 false, /* isAlwaysInSlot. Only relevant for getters. */
8926 false, /* isLazilyCachedInSlot. Only relevant for getters. */
8927 false, /* isTypedMethod. Only relevant for methods. */
8928 0 /* Reserved slot index, if we're stored in a slot, else 0. */
8929};
8930
8931MOZ_CAN_RUN_SCRIPT static bool
8932receiveNullableSequenceOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
8933{
8934 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject8937( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8935 "TestJSImplInterface", "receiveNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject8937( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8936 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject8937( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
8937 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject8937( cx, "TestJSImplInterface"
, "receiveNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
8938
8939 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
8940 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
8941 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
8942 if (objIsXray) {
8943 unwrappedObj.emplace(cx, obj);
8944 }
8945 if (objIsXray) {
8946 // Since our object is an Xray, we can just CheckedUnwrapStatic:
8947 // we know Xrays have no dynamic unwrap behavior.
8948 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
8949 if (!unwrappedObj.ref()) {
8950 return false;
8951 }
8952 }
8953 FastErrorResult rv;
8954 Nullable<nsTArray<Nullable<int32_t>>> result;
8955 // NOTE: This assert does NOT call the function.
8956 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
8957 MOZ_KnownLive(self)(self)->ReceiveNullableSequenceOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
8958 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableSequenceOfNullableInts"
)), 0))
) {
8959 return false;
8960 }
8961 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 8961); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 8961; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
8962
8963 if (result.IsNull()) {
8964 args.rval().setNull();
8965 return true;
8966 }
8967
8968 uint32_t length = result.Value().Length();
8969 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
8970 if (!returnArray) {
8971 return false;
8972 }
8973 // Scope for 'tmp'
8974 {
8975 JS::Rooted<JS::Value> tmp(cx);
8976 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
8977 // Control block to let us common up the JS_DefineElement calls when there
8978 // are different ways to succeed at wrapping the object.
8979 do {
8980 if (result.Value()[sequenceIdx0].IsNull()) {
8981 tmp.setNull();
8982 break;
8983 }
8984 tmp.setInt32(int32_t(result.Value()[sequenceIdx0].Value()));
8985 break;
8986 } while (false);
8987 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
8988 JSPROP_ENUMERATE)) {
8989 return false;
8990 }
8991 }
8992 }
8993 args.rval().setObject(*returnArray);
8994 return true;
8995}
8996
8997static const JSJitInfo receiveNullableSequenceOfNullableInts_methodinfo = {
8998 { (JSJitGetterOp)receiveNullableSequenceOfNullableInts },
8999 { prototypes::id::TestJSImplInterface },
9000 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9001 JSJitInfo::Method,
9002 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9003 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9004 false, /* isInfallible. False in setters. */
9005 false, /* isMovable. Not relevant for setters. */
9006 false, /* isEliminatable. Not relevant for setters. */
9007 false, /* isAlwaysInSlot. Only relevant for getters. */
9008 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9009 false, /* isTypedMethod. Only relevant for methods. */
9010 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9011};
9012
9013MOZ_CAN_RUN_SCRIPT static bool
9014passSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9015{
9016 BindingCallContext cx(cx_, "TestJSImplInterface.passSequence");
9017 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9020( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9018 "TestJSImplInterface", "passSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9020( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9019 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9020( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9020 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9020( cx, "TestJSImplInterface"
, "passSequence", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
9021
9022 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9023 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequence", 1)) {
9024 return false;
9025 }
9026 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9027 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9028 if (objIsXray) {
9029 unwrappedObj.emplace(cx, obj);
9030 }
9031 binding_detail::AutoSequence<int32_t> arg0;
9032 if (args[0].isObject()) {
9033 JS::ForOfIterator iter(cx);
9034 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9035 return false;
9036 }
9037 if (!iter.valueIsIterable()) {
9038 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9039 return false;
9040 }
9041 binding_detail::AutoSequence<int32_t> &arr = arg0;
9042 JS::Rooted<JS::Value> temp(cx);
9043 while (true) {
9044 bool done;
9045 if (!iter.next(&temp, &done)) {
9046 return false;
9047 }
9048 if (done) {
9049 break;
9050 }
9051 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
9052 if (!slotPtr) {
9053 JS_ReportOutOfMemory(cx);
9054 return false;
9055 }
9056 int32_t& slot = *slotPtr;
9057 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
9058 return false;
9059 }
9060 }
9061 } else {
9062 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9063 return false;
9064 }
9065 if (objIsXray) {
9066 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9067 // we know Xrays have no dynamic unwrap behavior.
9068 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9069 if (!unwrappedObj.ref()) {
9070 return false;
9071 }
9072 }
9073 FastErrorResult rv;
9074 // NOTE: This assert does NOT call the function.
9075 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9076 MOZ_KnownLive(self)(self)->PassSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9077 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequence"
)), 0))
) {
9078 return false;
9079 }
9080 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9080); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9080; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9081 args.rval().setUndefined();
9082 return true;
9083}
9084
9085static const JSJitInfo passSequence_methodinfo = {
9086 { (JSJitGetterOp)passSequence },
9087 { prototypes::id::TestJSImplInterface },
9088 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9089 JSJitInfo::Method,
9090 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9091 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9092 false, /* isInfallible. False in setters. */
9093 false, /* isMovable. Not relevant for setters. */
9094 false, /* isEliminatable. Not relevant for setters. */
9095 false, /* isAlwaysInSlot. Only relevant for getters. */
9096 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9097 false, /* isTypedMethod. Only relevant for methods. */
9098 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9099};
9100
9101MOZ_CAN_RUN_SCRIPT static bool
9102passNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9103{
9104 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequence");
9105 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9108( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9106 "TestJSImplInterface", "passNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9108( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9107 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9108( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
9108 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9108( cx, "TestJSImplInterface"
, "passNullableSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
9109
9110 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9111 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequence", 1)) {
9112 return false;
9113 }
9114 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9115 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9116 if (objIsXray) {
9117 unwrappedObj.emplace(cx, obj);
9118 }
9119 Nullable<Sequence<int32_t>> arg0;
9120 if (args[0].isObject()) {
9121 JS::ForOfIterator iter(cx);
9122 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9123 return false;
9124 }
9125 if (!iter.valueIsIterable()) {
9126 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9127 return false;
9128 }
9129 Sequence<int32_t> &arr = arg0.SetValue();
9130 JS::Rooted<JS::Value> temp(cx);
9131 while (true) {
9132 bool done;
9133 if (!iter.next(&temp, &done)) {
9134 return false;
9135 }
9136 if (done) {
9137 break;
9138 }
9139 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
9140 if (!slotPtr) {
9141 JS_ReportOutOfMemory(cx);
9142 return false;
9143 }
9144 int32_t& slot = *slotPtr;
9145 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
9146 return false;
9147 }
9148 }
9149 } else if (args[0].isNullOrUndefined()) {
9150 arg0.SetNull();
9151 } else {
9152 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9153 return false;
9154 }
9155 if (objIsXray) {
9156 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9157 // we know Xrays have no dynamic unwrap behavior.
9158 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9159 if (!unwrappedObj.ref()) {
9160 return false;
9161 }
9162 }
9163 FastErrorResult rv;
9164 // NOTE: This assert does NOT call the function.
9165 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9166 MOZ_KnownLive(self)(self)->PassNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9167 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequence"
)), 0))
) {
9168 return false;
9169 }
9170 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9170); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9170; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9171 args.rval().setUndefined();
9172 return true;
9173}
9174
9175static const JSJitInfo passNullableSequence_methodinfo = {
9176 { (JSJitGetterOp)passNullableSequence },
9177 { prototypes::id::TestJSImplInterface },
9178 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9179 JSJitInfo::Method,
9180 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9181 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9182 false, /* isInfallible. False in setters. */
9183 false, /* isMovable. Not relevant for setters. */
9184 false, /* isEliminatable. Not relevant for setters. */
9185 false, /* isAlwaysInSlot. Only relevant for getters. */
9186 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9187 false, /* isTypedMethod. Only relevant for methods. */
9188 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9189};
9190
9191MOZ_CAN_RUN_SCRIPT static bool
9192passSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9193{
9194 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableInts");
9195 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9198( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9196 "TestJSImplInterface", "passSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9198( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9197 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9198( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9198 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9198( cx, "TestJSImplInterface"
, "passSequenceOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9199
9200 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9201 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableInts", 1)) {
9202 return false;
9203 }
9204 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9205 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9206 if (objIsXray) {
9207 unwrappedObj.emplace(cx, obj);
9208 }
9209 binding_detail::AutoSequence<Nullable<int32_t>> arg0;
9210 if (args[0].isObject()) {
9211 JS::ForOfIterator iter(cx);
9212 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9213 return false;
9214 }
9215 if (!iter.valueIsIterable()) {
9216 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9217 return false;
9218 }
9219 binding_detail::AutoSequence<Nullable<int32_t>> &arr = arg0;
9220 JS::Rooted<JS::Value> temp(cx);
9221 while (true) {
9222 bool done;
9223 if (!iter.next(&temp, &done)) {
9224 return false;
9225 }
9226 if (done) {
9227 break;
9228 }
9229 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9230 if (!slotPtr) {
9231 JS_ReportOutOfMemory(cx);
9232 return false;
9233 }
9234 Nullable<int32_t>& slot = *slotPtr;
9235 if (temp.isNullOrUndefined()) {
9236 slot.SetNull();
9237 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9238 return false;
9239 }
9240 }
9241 } else {
9242 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9243 return false;
9244 }
9245 if (objIsXray) {
9246 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9247 // we know Xrays have no dynamic unwrap behavior.
9248 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9249 if (!unwrappedObj.ref()) {
9250 return false;
9251 }
9252 }
9253 FastErrorResult rv;
9254 // NOTE: This assert does NOT call the function.
9255 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9256 MOZ_KnownLive(self)(self)->PassSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9257 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableInts"
)), 0))
) {
9258 return false;
9259 }
9260 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9260); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9260; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9261 args.rval().setUndefined();
9262 return true;
9263}
9264
9265static const JSJitInfo passSequenceOfNullableInts_methodinfo = {
9266 { (JSJitGetterOp)passSequenceOfNullableInts },
9267 { prototypes::id::TestJSImplInterface },
9268 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9269 JSJitInfo::Method,
9270 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9271 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9272 false, /* isInfallible. False in setters. */
9273 false, /* isMovable. Not relevant for setters. */
9274 false, /* isEliminatable. Not relevant for setters. */
9275 false, /* isAlwaysInSlot. Only relevant for getters. */
9276 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9277 false, /* isTypedMethod. Only relevant for methods. */
9278 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9279};
9280
9281MOZ_CAN_RUN_SCRIPT static bool
9282passOptionalSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9283{
9284 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfNullableInts");
9285 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9288( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9286 "TestJSImplInterface", "passOptionalSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9288( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9287 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9288( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9288 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9288( cx, "TestJSImplInterface"
, "passOptionalSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9289
9290 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9291 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9292 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9293 if (objIsXray) {
9294 unwrappedObj.emplace(cx, obj);
9295 }
9296 Optional<Sequence<Nullable<int32_t>>> arg0;
9297 if (args.hasDefined(0)) {
9298 arg0.Construct();
9299 if (args[0].isObject()) {
9300 JS::ForOfIterator iter(cx);
9301 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9302 return false;
9303 }
9304 if (!iter.valueIsIterable()) {
9305 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9306 return false;
9307 }
9308 Sequence<Nullable<int32_t>> &arr = arg0.Value();
9309 JS::Rooted<JS::Value> temp(cx);
9310 while (true) {
9311 bool done;
9312 if (!iter.next(&temp, &done)) {
9313 return false;
9314 }
9315 if (done) {
9316 break;
9317 }
9318 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9319 if (!slotPtr) {
9320 JS_ReportOutOfMemory(cx);
9321 return false;
9322 }
9323 Nullable<int32_t>& slot = *slotPtr;
9324 if (temp.isNullOrUndefined()) {
9325 slot.SetNull();
9326 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9327 return false;
9328 }
9329 }
9330 } else {
9331 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9332 return false;
9333 }
9334 }
9335 if (objIsXray) {
9336 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9337 // we know Xrays have no dynamic unwrap behavior.
9338 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9339 if (!unwrappedObj.ref()) {
9340 return false;
9341 }
9342 }
9343 FastErrorResult rv;
9344 // NOTE: This assert does NOT call the function.
9345 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9346 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9347 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfNullableInts"
)), 0))
) {
9348 return false;
9349 }
9350 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9350); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9350; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9351 args.rval().setUndefined();
9352 return true;
9353}
9354
9355static const JSJitInfo passOptionalSequenceOfNullableInts_methodinfo = {
9356 { (JSJitGetterOp)passOptionalSequenceOfNullableInts },
9357 { prototypes::id::TestJSImplInterface },
9358 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9359 JSJitInfo::Method,
9360 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9361 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9362 false, /* isInfallible. False in setters. */
9363 false, /* isMovable. Not relevant for setters. */
9364 false, /* isEliminatable. Not relevant for setters. */
9365 false, /* isAlwaysInSlot. Only relevant for getters. */
9366 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9367 false, /* isTypedMethod. Only relevant for methods. */
9368 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9369};
9370
9371MOZ_CAN_RUN_SCRIPT static bool
9372passOptionalNullableSequenceOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9373{
9374 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts");
9375 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9378( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9376 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9378( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9377 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9378( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9378 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9378( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9379
9380 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9381 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9382 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9383 if (objIsXray) {
9384 unwrappedObj.emplace(cx, obj);
9385 }
9386 Optional<Nullable<Sequence<Nullable<int32_t>>>> arg0;
9387 if (args.hasDefined(0)) {
9388 arg0.Construct();
9389 if (args[0].isObject()) {
9390 JS::ForOfIterator iter(cx);
9391 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
9392 return false;
9393 }
9394 if (!iter.valueIsIterable()) {
9395 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9396 return false;
9397 }
9398 Sequence<Nullable<int32_t>> &arr = arg0.Value().SetValue();
9399 JS::Rooted<JS::Value> temp(cx);
9400 while (true) {
9401 bool done;
9402 if (!iter.next(&temp, &done)) {
9403 return false;
9404 }
9405 if (done) {
9406 break;
9407 }
9408 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
9409 if (!slotPtr) {
9410 JS_ReportOutOfMemory(cx);
9411 return false;
9412 }
9413 Nullable<int32_t>& slot = *slotPtr;
9414 if (temp.isNullOrUndefined()) {
9415 slot.SetNull();
9416 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot.SetValue())) {
9417 return false;
9418 }
9419 }
9420 } else if (args[0].isNullOrUndefined()) {
9421 arg0.Value().SetNull();
9422 } else {
9423 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
9424 return false;
9425 }
9426 }
9427 if (objIsXray) {
9428 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9429 // we know Xrays have no dynamic unwrap behavior.
9430 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9431 if (!unwrappedObj.ref()) {
9432 return false;
9433 }
9434 }
9435 FastErrorResult rv;
9436 // NOTE: This assert does NOT call the function.
9437 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9438 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9439 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts"
)), 0))
) {
9440 return false;
9441 }
9442 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9442); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9442; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9443 args.rval().setUndefined();
9444 return true;
9445}
9446
9447static const JSJitInfo passOptionalNullableSequenceOfNullableInts_methodinfo = {
9448 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableInts },
9449 { prototypes::id::TestJSImplInterface },
9450 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9451 JSJitInfo::Method,
9452 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9453 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
9454 false, /* isInfallible. False in setters. */
9455 false, /* isMovable. Not relevant for setters. */
9456 false, /* isEliminatable. Not relevant for setters. */
9457 false, /* isAlwaysInSlot. Only relevant for getters. */
9458 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9459 false, /* isTypedMethod. Only relevant for methods. */
9460 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9461};
9462
9463MOZ_CAN_RUN_SCRIPT static bool
9464receiveCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9465{
9466 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9469( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9467 "TestJSImplInterface", "receiveCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9469( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9468 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9469( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9469 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9469( cx, "TestJSImplInterface"
, "receiveCastableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9470
9471 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9472 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9473 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9474 if (objIsXray) {
9475 unwrappedObj.emplace(cx, obj);
9476 }
9477 if (objIsXray) {
9478 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9479 // we know Xrays have no dynamic unwrap behavior.
9480 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9481 if (!unwrappedObj.ref()) {
9482 return false;
9483 }
9484 }
9485 FastErrorResult rv;
9486 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9487 // NOTE: This assert does NOT call the function.
9488 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9489 MOZ_KnownLive(self)(self)->ReceiveCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9490 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectSequence"
)), 0))
) {
9491 return false;
9492 }
9493 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9493; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9494
9495 uint32_t length = result.Length();
9496 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9497 if (!returnArray) {
9498 return false;
9499 }
9500 // Scope for 'tmp'
9501 {
9502 JS::Rooted<JS::Value> tmp(cx);
9503 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9504 // Control block to let us common up the JS_DefineElement calls when there
9505 // are different ways to succeed at wrapping the object.
9506 do {
9507 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9508 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 9508; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
9509 return false;
9510 }
9511 break;
9512 } while (false);
9513 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9514 JSPROP_ENUMERATE)) {
9515 return false;
9516 }
9517 }
9518 }
9519 args.rval().setObject(*returnArray);
9520 return true;
9521}
9522
9523static const JSJitInfo receiveCastableObjectSequence_methodinfo = {
9524 { (JSJitGetterOp)receiveCastableObjectSequence },
9525 { prototypes::id::TestJSImplInterface },
9526 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9527 JSJitInfo::Method,
9528 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9529 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9530 false, /* isInfallible. False in setters. */
9531 false, /* isMovable. Not relevant for setters. */
9532 false, /* isEliminatable. Not relevant for setters. */
9533 false, /* isAlwaysInSlot. Only relevant for getters. */
9534 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9535 false, /* isTypedMethod. Only relevant for methods. */
9536 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9537};
9538
9539MOZ_CAN_RUN_SCRIPT static bool
9540receiveCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9541{
9542 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9545( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9543 "TestJSImplInterface", "receiveCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9545( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9544 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9545( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9545 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9545( cx, "TestJSImplInterface"
, "receiveCallbackObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9546
9547 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9548 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9549 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9550 if (objIsXray) {
9551 unwrappedObj.emplace(cx, obj);
9552 }
9553 if (objIsXray) {
9554 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9555 // we know Xrays have no dynamic unwrap behavior.
9556 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9557 if (!unwrappedObj.ref()) {
9558 return false;
9559 }
9560 }
9561 FastErrorResult rv;
9562 nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result;
9563 // NOTE: This assert does NOT call the function.
9564 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9565 MOZ_KnownLive(self)(self)->ReceiveCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9566 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallbackObjectSequence"
)), 0))
) {
9567 return false;
9568 }
9569 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9569; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9570
9571 uint32_t length = result.Length();
9572 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9573 if (!returnArray) {
9574 return false;
9575 }
9576 // Scope for 'tmp'
9577 {
9578 JS::Rooted<JS::Value> tmp(cx);
9579 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9580 // Control block to let us common up the JS_DefineElement calls when there
9581 // are different ways to succeed at wrapping the object.
9582 do {
9583 tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0]));
9584 if (!MaybeWrapObjectValue(cx, &tmp)) {
9585 return false;
9586 }
9587 break;
9588 } while (false);
9589 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9590 JSPROP_ENUMERATE)) {
9591 return false;
9592 }
9593 }
9594 }
9595 args.rval().setObject(*returnArray);
9596 return true;
9597}
9598
9599static const JSJitInfo receiveCallbackObjectSequence_methodinfo = {
9600 { (JSJitGetterOp)receiveCallbackObjectSequence },
9601 { prototypes::id::TestJSImplInterface },
9602 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9603 JSJitInfo::Method,
9604 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9605 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9606 false, /* isInfallible. False in setters. */
9607 false, /* isMovable. Not relevant for setters. */
9608 false, /* isEliminatable. Not relevant for setters. */
9609 false, /* isAlwaysInSlot. Only relevant for getters. */
9610 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9611 false, /* isTypedMethod. Only relevant for methods. */
9612 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9613};
9614
9615MOZ_CAN_RUN_SCRIPT static bool
9616receiveNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9617{
9618 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9621( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9619 "TestJSImplInterface", "receiveNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9621( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9620 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9621( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9621 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9621( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9622
9623 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9624 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9625 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9626 if (objIsXray) {
9627 unwrappedObj.emplace(cx, obj);
9628 }
9629 if (objIsXray) {
9630 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9631 // we know Xrays have no dynamic unwrap behavior.
9632 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9633 if (!unwrappedObj.ref()) {
9634 return false;
9635 }
9636 }
9637 FastErrorResult rv;
9638 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9639 // NOTE: This assert does NOT call the function.
9640 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9641 MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9642 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectSequence"
)), 0))
) {
9643 return false;
9644 }
9645 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9645); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9645; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9646
9647 uint32_t length = result.Length();
9648 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9649 if (!returnArray) {
9650 return false;
9651 }
9652 // Scope for 'tmp'
9653 {
9654 JS::Rooted<JS::Value> tmp(cx);
9655 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9656 // Control block to let us common up the JS_DefineElement calls when there
9657 // are different ways to succeed at wrapping the object.
9658 do {
9659 if (!result[sequenceIdx0]) {
9660 tmp.setNull();
9661 break;
9662 }
9663 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9664 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9664); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 9664; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
9665 return false;
9666 }
9667 break;
9668 } while (false);
9669 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9670 JSPROP_ENUMERATE)) {
9671 return false;
9672 }
9673 }
9674 }
9675 args.rval().setObject(*returnArray);
9676 return true;
9677}
9678
9679static const JSJitInfo receiveNullableCastableObjectSequence_methodinfo = {
9680 { (JSJitGetterOp)receiveNullableCastableObjectSequence },
9681 { prototypes::id::TestJSImplInterface },
9682 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9683 JSJitInfo::Method,
9684 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9685 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9686 false, /* isInfallible. False in setters. */
9687 false, /* isMovable. Not relevant for setters. */
9688 false, /* isEliminatable. Not relevant for setters. */
9689 false, /* isAlwaysInSlot. Only relevant for getters. */
9690 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9691 false, /* isTypedMethod. Only relevant for methods. */
9692 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9693};
9694
9695MOZ_CAN_RUN_SCRIPT static bool
9696receiveNullableCallbackObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9697{
9698 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9701( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9699 "TestJSImplInterface", "receiveNullableCallbackObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9701( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9700 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9701( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9701 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9701( cx, "TestJSImplInterface"
, "receiveNullableCallbackObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9702
9703 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9704 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9705 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9706 if (objIsXray) {
9707 unwrappedObj.emplace(cx, obj);
9708 }
9709 if (objIsXray) {
9710 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9711 // we know Xrays have no dynamic unwrap behavior.
9712 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9713 if (!unwrappedObj.ref()) {
9714 return false;
9715 }
9716 }
9717 FastErrorResult rv;
9718 nsTArray<StrongPtrForMember<mozilla::dom::TestCallbackInterface>> result;
9719 // NOTE: This assert does NOT call the function.
9720 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9721 MOZ_KnownLive(self)(self)->ReceiveNullableCallbackObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9722 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallbackObjectSequence"
)), 0))
) {
9723 return false;
9724 }
9725 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9725); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9725; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9726
9727 uint32_t length = result.Length();
9728 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9729 if (!returnArray) {
9730 return false;
9731 }
9732 // Scope for 'tmp'
9733 {
9734 JS::Rooted<JS::Value> tmp(cx);
9735 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9736 // Control block to let us common up the JS_DefineElement calls when there
9737 // are different ways to succeed at wrapping the object.
9738 do {
9739 if (result[sequenceIdx0]) {
9740 tmp.setObjectOrNull(GetCallbackFromCallbackObject(cx, result[sequenceIdx0]));
9741 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
9742 return false;
9743 }
9744 break;
9745 } else {
9746 tmp.setNull();
9747 break;
9748 }
9749 } while (false);
9750 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9751 JSPROP_ENUMERATE)) {
9752 return false;
9753 }
9754 }
9755 }
9756 args.rval().setObject(*returnArray);
9757 return true;
9758}
9759
9760static const JSJitInfo receiveNullableCallbackObjectSequence_methodinfo = {
9761 { (JSJitGetterOp)receiveNullableCallbackObjectSequence },
9762 { prototypes::id::TestJSImplInterface },
9763 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9764 JSJitInfo::Method,
9765 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9766 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
9767 false, /* isInfallible. False in setters. */
9768 false, /* isMovable. Not relevant for setters. */
9769 false, /* isEliminatable. Not relevant for setters. */
9770 false, /* isAlwaysInSlot. Only relevant for getters. */
9771 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9772 false, /* isTypedMethod. Only relevant for methods. */
9773 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9774};
9775
9776MOZ_CAN_RUN_SCRIPT static bool
9777receiveCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9778{
9779 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9782( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9780 "TestJSImplInterface", "receiveCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9782( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9781 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9782( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9782 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9782( cx, "TestJSImplInterface"
, "receiveCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9783
9784 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9785 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9786 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9787 if (objIsXray) {
9788 unwrappedObj.emplace(cx, obj);
9789 }
9790 if (objIsXray) {
9791 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9792 // we know Xrays have no dynamic unwrap behavior.
9793 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9794 if (!unwrappedObj.ref()) {
9795 return false;
9796 }
9797 }
9798 FastErrorResult rv;
9799 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
9800 // NOTE: This assert does NOT call the function.
9801 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9802 MOZ_KnownLive(self)(self)->ReceiveCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9803 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCastableObjectNullableSequence"
)), 0))
) {
9804 return false;
9805 }
9806 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9806); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9806; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9807
9808 if (result.IsNull()) {
9809 args.rval().setNull();
9810 return true;
9811 }
9812
9813 uint32_t length = result.Value().Length();
9814 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9815 if (!returnArray) {
9816 return false;
9817 }
9818 // Scope for 'tmp'
9819 {
9820 JS::Rooted<JS::Value> tmp(cx);
9821 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9822 // Control block to let us common up the JS_DefineElement calls when there
9823 // are different ways to succeed at wrapping the object.
9824 do {
9825 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
9826 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 9826; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
9827 return false;
9828 }
9829 break;
9830 } while (false);
9831 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9832 JSPROP_ENUMERATE)) {
9833 return false;
9834 }
9835 }
9836 }
9837 args.rval().setObject(*returnArray);
9838 return true;
9839}
9840
9841static const JSJitInfo receiveCastableObjectNullableSequence_methodinfo = {
9842 { (JSJitGetterOp)receiveCastableObjectNullableSequence },
9843 { prototypes::id::TestJSImplInterface },
9844 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9845 JSJitInfo::Method,
9846 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9847 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9848 false, /* isInfallible. False in setters. */
9849 false, /* isMovable. Not relevant for setters. */
9850 false, /* isEliminatable. Not relevant for setters. */
9851 false, /* isAlwaysInSlot. Only relevant for getters. */
9852 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9853 false, /* isTypedMethod. Only relevant for methods. */
9854 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9855};
9856
9857MOZ_CAN_RUN_SCRIPT static bool
9858receiveNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9859{
9860 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9863( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9861 "TestJSImplInterface", "receiveNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9863( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9862 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9863( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9863 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9863( cx, "TestJSImplInterface"
, "receiveNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9864
9865 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9866 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9867 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9868 if (objIsXray) {
9869 unwrappedObj.emplace(cx, obj);
9870 }
9871 if (objIsXray) {
9872 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9873 // we know Xrays have no dynamic unwrap behavior.
9874 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9875 if (!unwrappedObj.ref()) {
9876 return false;
9877 }
9878 }
9879 FastErrorResult rv;
9880 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
9881 // NOTE: This assert does NOT call the function.
9882 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9883 MOZ_KnownLive(self)(self)->ReceiveNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9884 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence"
)), 0))
) {
9885 return false;
9886 }
9887 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9887); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9887; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9888
9889 if (result.IsNull()) {
9890 args.rval().setNull();
9891 return true;
9892 }
9893
9894 uint32_t length = result.Value().Length();
9895 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9896 if (!returnArray) {
9897 return false;
9898 }
9899 // Scope for 'tmp'
9900 {
9901 JS::Rooted<JS::Value> tmp(cx);
9902 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9903 // Control block to let us common up the JS_DefineElement calls when there
9904 // are different ways to succeed at wrapping the object.
9905 do {
9906 if (!result.Value()[sequenceIdx0]) {
9907 tmp.setNull();
9908 break;
9909 }
9910 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
9911 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9911); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 9911; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
9912 return false;
9913 }
9914 break;
9915 } while (false);
9916 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9917 JSPROP_ENUMERATE)) {
9918 return false;
9919 }
9920 }
9921 }
9922 args.rval().setObject(*returnArray);
9923 return true;
9924}
9925
9926static const JSJitInfo receiveNullableCastableObjectNullableSequence_methodinfo = {
9927 { (JSJitGetterOp)receiveNullableCastableObjectNullableSequence },
9928 { prototypes::id::TestJSImplInterface },
9929 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
9930 JSJitInfo::Method,
9931 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
9932 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
9933 false, /* isInfallible. False in setters. */
9934 false, /* isMovable. Not relevant for setters. */
9935 false, /* isEliminatable. Not relevant for setters. */
9936 false, /* isAlwaysInSlot. Only relevant for getters. */
9937 false, /* isLazilyCachedInSlot. Only relevant for getters. */
9938 false, /* isTypedMethod. Only relevant for methods. */
9939 0 /* Reserved slot index, if we're stored in a slot, else 0. */
9940};
9941
9942MOZ_CAN_RUN_SCRIPT static bool
9943receiveWeakCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
9944{
9945 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject9948( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9946 "TestJSImplInterface", "receiveWeakCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject9948( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9947 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject9948( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
9948 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject9948( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
9949
9950 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
9951 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
9952 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
9953 if (objIsXray) {
9954 unwrappedObj.emplace(cx, obj);
9955 }
9956 if (objIsXray) {
9957 // Since our object is an Xray, we can just CheckedUnwrapStatic:
9958 // we know Xrays have no dynamic unwrap behavior.
9959 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
9960 if (!unwrappedObj.ref()) {
9961 return false;
9962 }
9963 }
9964 FastErrorResult rv;
9965 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
9966 // NOTE: This assert does NOT call the function.
9967 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
9968 MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
9969 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectSequence"
)), 0))
) {
9970 return false;
9971 }
9972 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 9972; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
9973
9974 uint32_t length = result.Length();
9975 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
9976 if (!returnArray) {
9977 return false;
9978 }
9979 // Scope for 'tmp'
9980 {
9981 JS::Rooted<JS::Value> tmp(cx);
9982 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
9983 // Control block to let us common up the JS_DefineElement calls when there
9984 // are different ways to succeed at wrapping the object.
9985 do {
9986 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
9987 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 9987); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 9987; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
9988 return false;
9989 }
9990 break;
9991 } while (false);
9992 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
9993 JSPROP_ENUMERATE)) {
9994 return false;
9995 }
9996 }
9997 }
9998 args.rval().setObject(*returnArray);
9999 return true;
10000}
10001
10002static const JSJitInfo receiveWeakCastableObjectSequence_methodinfo = {
10003 { (JSJitGetterOp)receiveWeakCastableObjectSequence },
10004 { prototypes::id::TestJSImplInterface },
10005 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10006 JSJitInfo::Method,
10007 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10008 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
10009 false, /* isInfallible. False in setters. */
10010 false, /* isMovable. Not relevant for setters. */
10011 false, /* isEliminatable. Not relevant for setters. */
10012 false, /* isAlwaysInSlot. Only relevant for getters. */
10013 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10014 false, /* isTypedMethod. Only relevant for methods. */
10015 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10016};
10017
10018MOZ_CAN_RUN_SCRIPT static bool
10019receiveWeakNullableCastableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10020{
10021 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10024( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10022 "TestJSImplInterface", "receiveWeakNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10024( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10023 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10024( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10024 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10024( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10025
10026 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10027 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10028 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10029 if (objIsXray) {
10030 unwrappedObj.emplace(cx, obj);
10031 }
10032 if (objIsXray) {
10033 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10034 // we know Xrays have no dynamic unwrap behavior.
10035 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10036 if (!unwrappedObj.ref()) {
10037 return false;
10038 }
10039 }
10040 FastErrorResult rv;
10041 nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>> result;
10042 // NOTE: This assert does NOT call the function.
10043 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10044 MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10045 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence"
)), 0))
) {
10046 return false;
10047 }
10048 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10048; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10049
10050 uint32_t length = result.Length();
10051 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10052 if (!returnArray) {
10053 return false;
10054 }
10055 // Scope for 'tmp'
10056 {
10057 JS::Rooted<JS::Value> tmp(cx);
10058 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10059 // Control block to let us common up the JS_DefineElement calls when there
10060 // are different ways to succeed at wrapping the object.
10061 do {
10062 if (!result[sequenceIdx0]) {
10063 tmp.setNull();
10064 break;
10065 }
10066 if (!GetOrCreateDOMReflector(cx, result[sequenceIdx0], &tmp)) {
10067 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10067); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 10067; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
10068 return false;
10069 }
10070 break;
10071 } while (false);
10072 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10073 JSPROP_ENUMERATE)) {
10074 return false;
10075 }
10076 }
10077 }
10078 args.rval().setObject(*returnArray);
10079 return true;
10080}
10081
10082static const JSJitInfo receiveWeakNullableCastableObjectSequence_methodinfo = {
10083 { (JSJitGetterOp)receiveWeakNullableCastableObjectSequence },
10084 { prototypes::id::TestJSImplInterface },
10085 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10086 JSJitInfo::Method,
10087 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10088 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
10089 false, /* isInfallible. False in setters. */
10090 false, /* isMovable. Not relevant for setters. */
10091 false, /* isEliminatable. Not relevant for setters. */
10092 false, /* isAlwaysInSlot. Only relevant for getters. */
10093 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10094 false, /* isTypedMethod. Only relevant for methods. */
10095 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10096};
10097
10098MOZ_CAN_RUN_SCRIPT static bool
10099receiveWeakCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10100{
10101 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10104( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10102 "TestJSImplInterface", "receiveWeakCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10104( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10103 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10104( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10104 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10104( cx, "TestJSImplInterface"
, "receiveWeakCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10105
10106 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10109 if (objIsXray) {
10110 unwrappedObj.emplace(cx, obj);
10111 }
10112 if (objIsXray) {
10113 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10114 // we know Xrays have no dynamic unwrap behavior.
10115 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10116 if (!unwrappedObj.ref()) {
10117 return false;
10118 }
10119 }
10120 FastErrorResult rv;
10121 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
10122 // NOTE: This assert does NOT call the function.
10123 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10124 MOZ_KnownLive(self)(self)->ReceiveWeakCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10125 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence"
)), 0))
) {
10126 return false;
10127 }
10128 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10128; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10129
10130 if (result.IsNull()) {
10131 args.rval().setNull();
10132 return true;
10133 }
10134
10135 uint32_t length = result.Value().Length();
10136 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10137 if (!returnArray) {
10138 return false;
10139 }
10140 // Scope for 'tmp'
10141 {
10142 JS::Rooted<JS::Value> tmp(cx);
10143 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10144 // Control block to let us common up the JS_DefineElement calls when there
10145 // are different ways to succeed at wrapping the object.
10146 do {
10147 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
10148 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10148); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 10148; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
10149 return false;
10150 }
10151 break;
10152 } while (false);
10153 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10154 JSPROP_ENUMERATE)) {
10155 return false;
10156 }
10157 }
10158 }
10159 args.rval().setObject(*returnArray);
10160 return true;
10161}
10162
10163static const JSJitInfo receiveWeakCastableObjectNullableSequence_methodinfo = {
10164 { (JSJitGetterOp)receiveWeakCastableObjectNullableSequence },
10165 { prototypes::id::TestJSImplInterface },
10166 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10167 JSJitInfo::Method,
10168 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10169 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
10170 false, /* isInfallible. False in setters. */
10171 false, /* isMovable. Not relevant for setters. */
10172 false, /* isEliminatable. Not relevant for setters. */
10173 false, /* isAlwaysInSlot. Only relevant for getters. */
10174 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10175 false, /* isTypedMethod. Only relevant for methods. */
10176 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10177};
10178
10179MOZ_CAN_RUN_SCRIPT static bool
10180receiveWeakNullableCastableObjectNullableSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10181{
10182 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10185( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10183 "TestJSImplInterface", "receiveWeakNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10185( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10184 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10185( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10185 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10185( cx, "TestJSImplInterface"
, "receiveWeakNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10186
10187 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10188 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10189 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10190 if (objIsXray) {
10191 unwrappedObj.emplace(cx, obj);
10192 }
10193 if (objIsXray) {
10194 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10195 // we know Xrays have no dynamic unwrap behavior.
10196 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10197 if (!unwrappedObj.ref()) {
10198 return false;
10199 }
10200 }
10201 FastErrorResult rv;
10202 Nullable<nsTArray<StrongPtrForMember<mozilla::dom::TestJSImplInterface>>> result;
10203 // NOTE: This assert does NOT call the function.
10204 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10205 MOZ_KnownLive(self)(self)->ReceiveWeakNullableCastableObjectNullableSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10206 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence"
)), 0))
) {
10207 return false;
10208 }
10209 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10209); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10209; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10210
10211 if (result.IsNull()) {
10212 args.rval().setNull();
10213 return true;
10214 }
10215
10216 uint32_t length = result.Value().Length();
10217 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
10218 if (!returnArray) {
10219 return false;
10220 }
10221 // Scope for 'tmp'
10222 {
10223 JS::Rooted<JS::Value> tmp(cx);
10224 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
10225 // Control block to let us common up the JS_DefineElement calls when there
10226 // are different ways to succeed at wrapping the object.
10227 do {
10228 if (!result.Value()[sequenceIdx0]) {
10229 tmp.setNull();
10230 break;
10231 }
10232 if (!GetOrCreateDOMReflector(cx, result.Value()[sequenceIdx0], &tmp)) {
10233 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10233); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 10233; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
10234 return false;
10235 }
10236 break;
10237 } while (false);
10238 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
10239 JSPROP_ENUMERATE)) {
10240 return false;
10241 }
10242 }
10243 }
10244 args.rval().setObject(*returnArray);
10245 return true;
10246}
10247
10248static const JSJitInfo receiveWeakNullableCastableObjectNullableSequence_methodinfo = {
10249 { (JSJitGetterOp)receiveWeakNullableCastableObjectNullableSequence },
10250 { prototypes::id::TestJSImplInterface },
10251 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10252 JSJitInfo::Method,
10253 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10254 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
10255 false, /* isInfallible. False in setters. */
10256 false, /* isMovable. Not relevant for setters. */
10257 false, /* isEliminatable. Not relevant for setters. */
10258 false, /* isAlwaysInSlot. Only relevant for getters. */
10259 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10260 false, /* isTypedMethod. Only relevant for methods. */
10261 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10262};
10263
10264MOZ_CAN_RUN_SCRIPT static bool
10265passCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10266{
10267 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectSequence");
10268 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10271( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10269 "TestJSImplInterface", "passCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10271( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10270 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10271( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10271 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10271( cx, "TestJSImplInterface"
, "passCastableObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10272
10273 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10274 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectSequence", 1)) {
10275 return false;
10276 }
10277 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10278 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10279 if (objIsXray) {
10280 unwrappedObj.emplace(cx, obj);
10281 }
10282 binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> arg0;
10283 if (args[0].isObject()) {
10284 JS::ForOfIterator iter(cx);
10285 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10286 return false;
10287 }
10288 if (!iter.valueIsIterable()) {
10289 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10290 return false;
10291 }
10292 binding_detail::AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0;
10293 JS::Rooted<JS::Value> temp(cx);
10294 while (true) {
10295 bool done;
10296 if (!iter.next(&temp, &done)) {
10297 return false;
10298 }
10299 if (done) {
10300 break;
10301 }
10302 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10303 if (!slotPtr) {
10304 JS_ReportOutOfMemory(cx);
10305 return false;
10306 }
10307 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10308 if (temp.isObject()) {
10309 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10310 {
10311 // Our JSContext should be in the right global to do unwrapping in.
10312 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10313 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10314 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10315 return false;
10316 }
10317 }
10318 } else {
10319 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10320 return false;
10321 }
10322 }
10323 } else {
10324 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10325 return false;
10326 }
10327 if (objIsXray) {
10328 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10329 // we know Xrays have no dynamic unwrap behavior.
10330 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10331 if (!unwrappedObj.ref()) {
10332 return false;
10333 }
10334 }
10335 FastErrorResult rv;
10336 // NOTE: This assert does NOT call the function.
10337 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10338 MOZ_KnownLive(self)(self)->PassCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10339 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectSequence"
)), 0))
) {
10340 return false;
10341 }
10342 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10342; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10343 args.rval().setUndefined();
10344 return true;
10345}
10346
10347static const JSJitInfo passCastableObjectSequence_methodinfo = {
10348 { (JSJitGetterOp)passCastableObjectSequence },
10349 { prototypes::id::TestJSImplInterface },
10350 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10351 JSJitInfo::Method,
10352 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10353 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10354 false, /* isInfallible. False in setters. */
10355 false, /* isMovable. Not relevant for setters. */
10356 false, /* isEliminatable. Not relevant for setters. */
10357 false, /* isAlwaysInSlot. Only relevant for getters. */
10358 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10359 false, /* isTypedMethod. Only relevant for methods. */
10360 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10361};
10362
10363MOZ_CAN_RUN_SCRIPT static bool
10364passNullableCastableObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10365{
10366 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectSequence");
10367 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10368 "TestJSImplInterface", "passNullableCastableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10369 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10370 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10370( cx, "TestJSImplInterface"
, "passNullableCastableObjectSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10371
10372 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10373 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectSequence", 1)) {
10374 return false;
10375 }
10376 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10377 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10378 if (objIsXray) {
10379 unwrappedObj.emplace(cx, obj);
10380 }
10381 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestJSImplInterface>> arg0;
10382 if (args[0].isObject()) {
10383 JS::ForOfIterator iter(cx);
10384 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10385 return false;
10386 }
10387 if (!iter.valueIsIterable()) {
10388 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10389 return false;
10390 }
10391 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = arg0;
10392 JS::Rooted<JS::Value> temp(cx);
10393 while (true) {
10394 bool done;
10395 if (!iter.next(&temp, &done)) {
10396 return false;
10397 }
10398 if (done) {
10399 break;
10400 }
10401 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10402 if (!slotPtr) {
10403 JS_ReportOutOfMemory(cx);
10404 return false;
10405 }
10406 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10407 if (temp.isObject()) {
10408 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10409 {
10410 // Our JSContext should be in the right global to do unwrapping in.
10411 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10412 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10413 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10414 return false;
10415 }
10416 }
10417 } else if (temp.isNullOrUndefined()) {
10418 slot = nullptr;
10419 } else {
10420 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10421 return false;
10422 }
10423 }
10424 } else {
10425 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10426 return false;
10427 }
10428 if (objIsXray) {
10429 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10430 // we know Xrays have no dynamic unwrap behavior.
10431 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10432 if (!unwrappedObj.ref()) {
10433 return false;
10434 }
10435 }
10436 FastErrorResult rv;
10437 // NOTE: This assert does NOT call the function.
10438 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10439 MOZ_KnownLive(self)(self)->PassNullableCastableObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10440 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectSequence"
)), 0))
) {
10441 return false;
10442 }
10443 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10443); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10443; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10444 args.rval().setUndefined();
10445 return true;
10446}
10447
10448static const JSJitInfo passNullableCastableObjectSequence_methodinfo = {
10449 { (JSJitGetterOp)passNullableCastableObjectSequence },
10450 { prototypes::id::TestJSImplInterface },
10451 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10452 JSJitInfo::Method,
10453 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10454 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10455 false, /* isInfallible. False in setters. */
10456 false, /* isMovable. Not relevant for setters. */
10457 false, /* isEliminatable. Not relevant for setters. */
10458 false, /* isAlwaysInSlot. Only relevant for getters. */
10459 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10460 false, /* isTypedMethod. Only relevant for methods. */
10461 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10462};
10463
10464MOZ_CAN_RUN_SCRIPT static bool
10465passCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10466{
10467 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectNullableSequence");
10468 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10471( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10469 "TestJSImplInterface", "passCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10471( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10470 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10471( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10471 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10471( cx, "TestJSImplInterface"
, "passCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10472
10473 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10474 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectNullableSequence", 1)) {
10475 return false;
10476 }
10477 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10478 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10479 if (objIsXray) {
10480 unwrappedObj.emplace(cx, obj);
10481 }
10482 Nullable<Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>>> arg0;
10483 if (args[0].isObject()) {
10484 JS::ForOfIterator iter(cx);
10485 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10486 return false;
10487 }
10488 if (!iter.valueIsIterable()) {
10489 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10490 return false;
10491 }
10492 Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0.SetValue();
10493 JS::Rooted<JS::Value> temp(cx);
10494 while (true) {
10495 bool done;
10496 if (!iter.next(&temp, &done)) {
10497 return false;
10498 }
10499 if (done) {
10500 break;
10501 }
10502 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10503 if (!slotPtr) {
10504 JS_ReportOutOfMemory(cx);
10505 return false;
10506 }
10507 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10508 if (temp.isObject()) {
10509 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10510 {
10511 // Our JSContext should be in the right global to do unwrapping in.
10512 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10513 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10514 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10515 return false;
10516 }
10517 }
10518 } else {
10519 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10520 return false;
10521 }
10522 }
10523 } else if (args[0].isNullOrUndefined()) {
10524 arg0.SetNull();
10525 } else {
10526 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10527 return false;
10528 }
10529 if (objIsXray) {
10530 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10531 // we know Xrays have no dynamic unwrap behavior.
10532 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10533 if (!unwrappedObj.ref()) {
10534 return false;
10535 }
10536 }
10537 FastErrorResult rv;
10538 // NOTE: This assert does NOT call the function.
10539 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10540 MOZ_KnownLive(self)(self)->PassCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10541 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableSequence"
)), 0))
) {
10542 return false;
10543 }
10544 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10544; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10545 args.rval().setUndefined();
10546 return true;
10547}
10548
10549static const JSJitInfo passCastableObjectNullableSequence_methodinfo = {
10550 { (JSJitGetterOp)passCastableObjectNullableSequence },
10551 { prototypes::id::TestJSImplInterface },
10552 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10553 JSJitInfo::Method,
10554 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10555 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10556 false, /* isInfallible. False in setters. */
10557 false, /* isMovable. Not relevant for setters. */
10558 false, /* isEliminatable. Not relevant for setters. */
10559 false, /* isAlwaysInSlot. Only relevant for getters. */
10560 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10561 false, /* isTypedMethod. Only relevant for methods. */
10562 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10563};
10564
10565MOZ_CAN_RUN_SCRIPT static bool
10566passNullableCastableObjectNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10567{
10568 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectNullableSequence");
10569 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10572( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10570 "TestJSImplInterface", "passNullableCastableObjectNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10572( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10571 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10572( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10572 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10572( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10573
10574 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10575 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence", 1)) {
10576 return false;
10577 }
10578 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10579 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10580 if (objIsXray) {
10581 unwrappedObj.emplace(cx, obj);
10582 }
10583 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> arg0;
10584 if (args[0].isObject()) {
10585 JS::ForOfIterator iter(cx);
10586 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10587 return false;
10588 }
10589 if (!iter.valueIsIterable()) {
10590 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10591 return false;
10592 }
10593 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = arg0.SetValue();
10594 JS::Rooted<JS::Value> temp(cx);
10595 while (true) {
10596 bool done;
10597 if (!iter.next(&temp, &done)) {
10598 return false;
10599 }
10600 if (done) {
10601 break;
10602 }
10603 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
10604 if (!slotPtr) {
10605 JS_ReportOutOfMemory(cx);
10606 return false;
10607 }
10608 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
10609 if (temp.isObject()) {
10610 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
10611 {
10612 // Our JSContext should be in the right global to do unwrapping in.
10613 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
10614 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
10615 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
10616 return false;
10617 }
10618 }
10619 } else if (temp.isNullOrUndefined()) {
10620 slot = nullptr;
10621 } else {
10622 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
10623 return false;
10624 }
10625 }
10626 } else if (args[0].isNullOrUndefined()) {
10627 arg0.SetNull();
10628 } else {
10629 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10630 return false;
10631 }
10632 if (objIsXray) {
10633 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10634 // we know Xrays have no dynamic unwrap behavior.
10635 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10636 if (!unwrappedObj.ref()) {
10637 return false;
10638 }
10639 }
10640 FastErrorResult rv;
10641 // NOTE: This assert does NOT call the function.
10642 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10643 MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10644 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableSequence"
)), 0))
) {
10645 return false;
10646 }
10647 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10647); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10647; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10648 args.rval().setUndefined();
10649 return true;
10650}
10651
10652static const JSJitInfo passNullableCastableObjectNullableSequence_methodinfo = {
10653 { (JSJitGetterOp)passNullableCastableObjectNullableSequence },
10654 { prototypes::id::TestJSImplInterface },
10655 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10656 JSJitInfo::Method,
10657 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10658 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10659 false, /* isInfallible. False in setters. */
10660 false, /* isMovable. Not relevant for setters. */
10661 false, /* isEliminatable. Not relevant for setters. */
10662 false, /* isAlwaysInSlot. Only relevant for getters. */
10663 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10664 false, /* isTypedMethod. Only relevant for methods. */
10665 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10666};
10667
10668MOZ_CAN_RUN_SCRIPT static bool
10669passOptionalSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10670{
10671 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequence");
10672 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10675( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10673 "TestJSImplInterface", "passOptionalSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10675( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10674 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10675( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
10675 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10675( cx, "TestJSImplInterface"
, "passOptionalSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
10676
10677 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10678 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10679 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10680 if (objIsXray) {
10681 unwrappedObj.emplace(cx, obj);
10682 }
10683 Optional<Sequence<int32_t>> arg0;
10684 if (args.hasDefined(0)) {
10685 arg0.Construct();
10686 if (args[0].isObject()) {
10687 JS::ForOfIterator iter(cx);
10688 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10689 return false;
10690 }
10691 if (!iter.valueIsIterable()) {
10692 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10693 return false;
10694 }
10695 Sequence<int32_t> &arr = arg0.Value();
10696 JS::Rooted<JS::Value> temp(cx);
10697 while (true) {
10698 bool done;
10699 if (!iter.next(&temp, &done)) {
10700 return false;
10701 }
10702 if (done) {
10703 break;
10704 }
10705 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10706 if (!slotPtr) {
10707 JS_ReportOutOfMemory(cx);
10708 return false;
10709 }
10710 int32_t& slot = *slotPtr;
10711 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10712 return false;
10713 }
10714 }
10715 } else {
10716 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10717 return false;
10718 }
10719 }
10720 if (objIsXray) {
10721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10722 // we know Xrays have no dynamic unwrap behavior.
10723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10724 if (!unwrappedObj.ref()) {
10725 return false;
10726 }
10727 }
10728 FastErrorResult rv;
10729 // NOTE: This assert does NOT call the function.
10730 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10731 MOZ_KnownLive(self)(self)->PassOptionalSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10732 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequence"
)), 0))
) {
10733 return false;
10734 }
10735 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10735; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10736 args.rval().setUndefined();
10737 return true;
10738}
10739
10740static const JSJitInfo passOptionalSequence_methodinfo = {
10741 { (JSJitGetterOp)passOptionalSequence },
10742 { prototypes::id::TestJSImplInterface },
10743 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10744 JSJitInfo::Method,
10745 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10746 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10747 false, /* isInfallible. False in setters. */
10748 false, /* isMovable. Not relevant for setters. */
10749 false, /* isEliminatable. Not relevant for setters. */
10750 false, /* isAlwaysInSlot. Only relevant for getters. */
10751 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10752 false, /* isTypedMethod. Only relevant for methods. */
10753 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10754};
10755
10756MOZ_CAN_RUN_SCRIPT static bool
10757passOptionalSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10758{
10759 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceWithDefaultValue");
10760 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10763( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10761 "TestJSImplInterface", "passOptionalSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10763( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10762 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10763( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10763 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10763( cx, "TestJSImplInterface"
, "passOptionalSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10764
10765 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10766 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10767 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10768 if (objIsXray) {
10769 unwrappedObj.emplace(cx, obj);
10770 }
10771 binding_detail::AutoSequence<int32_t> arg0;
10772 if (args.hasDefined(0)) {
10773 if (args[0].isObject()) {
10774 JS::ForOfIterator iter(cx);
10775 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10776 return false;
10777 }
10778 if (!iter.valueIsIterable()) {
10779 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10780 return false;
10781 }
10782 binding_detail::AutoSequence<int32_t> &arr = arg0;
10783 JS::Rooted<JS::Value> temp(cx);
10784 while (true) {
10785 bool done;
10786 if (!iter.next(&temp, &done)) {
10787 return false;
10788 }
10789 if (done) {
10790 break;
10791 }
10792 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10793 if (!slotPtr) {
10794 JS_ReportOutOfMemory(cx);
10795 return false;
10796 }
10797 int32_t& slot = *slotPtr;
10798 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10799 return false;
10800 }
10801 }
10802 } else {
10803 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10804 return false;
10805 }
10806 } else {
10807 /* arg0 array is already empty; nothing to do */
10808 }
10809 if (objIsXray) {
10810 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10811 // we know Xrays have no dynamic unwrap behavior.
10812 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10813 if (!unwrappedObj.ref()) {
10814 return false;
10815 }
10816 }
10817 FastErrorResult rv;
10818 // NOTE: This assert does NOT call the function.
10819 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10820 MOZ_KnownLive(self)(self)->PassOptionalSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10821 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceWithDefaultValue"
)), 0))
) {
10822 return false;
10823 }
10824 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10824); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10824; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10825 args.rval().setUndefined();
10826 return true;
10827}
10828
10829static const JSJitInfo passOptionalSequenceWithDefaultValue_methodinfo = {
10830 { (JSJitGetterOp)passOptionalSequenceWithDefaultValue },
10831 { prototypes::id::TestJSImplInterface },
10832 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10833 JSJitInfo::Method,
10834 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10835 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10836 false, /* isInfallible. False in setters. */
10837 false, /* isMovable. Not relevant for setters. */
10838 false, /* isEliminatable. Not relevant for setters. */
10839 false, /* isAlwaysInSlot. Only relevant for getters. */
10840 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10841 false, /* isTypedMethod. Only relevant for methods. */
10842 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10843};
10844
10845MOZ_CAN_RUN_SCRIPT static bool
10846passOptionalNullableSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10847{
10848 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequence");
10849 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10850 "TestJSImplInterface", "passOptionalNullableSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10851 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10852 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10852( cx, "TestJSImplInterface"
, "passOptionalNullableSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10853
10854 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10855 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10856 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10857 if (objIsXray) {
10858 unwrappedObj.emplace(cx, obj);
10859 }
10860 Optional<Nullable<Sequence<int32_t>>> arg0;
10861 if (args.hasDefined(0)) {
10862 arg0.Construct();
10863 if (args[0].isObject()) {
10864 JS::ForOfIterator iter(cx);
10865 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10866 return false;
10867 }
10868 if (!iter.valueIsIterable()) {
10869 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10870 return false;
10871 }
10872 Sequence<int32_t> &arr = arg0.Value().SetValue();
10873 JS::Rooted<JS::Value> temp(cx);
10874 while (true) {
10875 bool done;
10876 if (!iter.next(&temp, &done)) {
10877 return false;
10878 }
10879 if (done) {
10880 break;
10881 }
10882 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10883 if (!slotPtr) {
10884 JS_ReportOutOfMemory(cx);
10885 return false;
10886 }
10887 int32_t& slot = *slotPtr;
10888 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10889 return false;
10890 }
10891 }
10892 } else if (args[0].isNullOrUndefined()) {
10893 arg0.Value().SetNull();
10894 } else {
10895 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10896 return false;
10897 }
10898 }
10899 if (objIsXray) {
10900 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10901 // we know Xrays have no dynamic unwrap behavior.
10902 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10903 if (!unwrappedObj.ref()) {
10904 return false;
10905 }
10906 }
10907 FastErrorResult rv;
10908 // NOTE: This assert does NOT call the function.
10909 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
10910 MOZ_KnownLive(self)(self)->PassOptionalNullableSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
10911 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequence"
)), 0))
) {
10912 return false;
10913 }
10914 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 10914); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 10914; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
10915 args.rval().setUndefined();
10916 return true;
10917}
10918
10919static const JSJitInfo passOptionalNullableSequence_methodinfo = {
10920 { (JSJitGetterOp)passOptionalNullableSequence },
10921 { prototypes::id::TestJSImplInterface },
10922 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
10923 JSJitInfo::Method,
10924 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
10925 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
10926 false, /* isInfallible. False in setters. */
10927 false, /* isMovable. Not relevant for setters. */
10928 false, /* isEliminatable. Not relevant for setters. */
10929 false, /* isAlwaysInSlot. Only relevant for getters. */
10930 false, /* isLazilyCachedInSlot. Only relevant for getters. */
10931 false, /* isTypedMethod. Only relevant for methods. */
10932 0 /* Reserved slot index, if we're stored in a slot, else 0. */
10933};
10934
10935MOZ_CAN_RUN_SCRIPT static bool
10936passOptionalNullableSequenceWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
10937{
10938 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue");
10939 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject10942( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10940 "TestJSImplInterface", "passOptionalNullableSequenceWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject10942( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10941 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject10942( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
10942 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject10942( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
10943
10944 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
10945 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
10946 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
10947 if (objIsXray) {
10948 unwrappedObj.emplace(cx, obj);
10949 }
10950 Nullable<Sequence<int32_t>> arg0;
10951 if (args.hasDefined(0)) {
10952 if (args[0].isObject()) {
10953 JS::ForOfIterator iter(cx);
10954 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
10955 return false;
10956 }
10957 if (!iter.valueIsIterable()) {
10958 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10959 return false;
10960 }
10961 Sequence<int32_t> &arr = arg0.SetValue();
10962 JS::Rooted<JS::Value> temp(cx);
10963 while (true) {
10964 bool done;
10965 if (!iter.next(&temp, &done)) {
10966 return false;
10967 }
10968 if (done) {
10969 break;
10970 }
10971 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
10972 if (!slotPtr) {
10973 JS_ReportOutOfMemory(cx);
10974 return false;
10975 }
10976 int32_t& slot = *slotPtr;
10977 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
10978 return false;
10979 }
10980 }
10981 } else if (args[0].isNullOrUndefined()) {
10982 arg0.SetNull();
10983 } else {
10984 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
10985 return false;
10986 }
10987 } else {
10988 arg0.SetNull();
10989 }
10990 if (objIsXray) {
10991 // Since our object is an Xray, we can just CheckedUnwrapStatic:
10992 // we know Xrays have no dynamic unwrap behavior.
10993 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
10994 if (!unwrappedObj.ref()) {
10995 return false;
10996 }
10997 }
10998 FastErrorResult rv;
10999 // NOTE: This assert does NOT call the function.
11000 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11001 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11002 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue"
)), 0))
) {
11003 return false;
11004 }
11005 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11005; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11006 args.rval().setUndefined();
11007 return true;
11008}
11009
11010static const JSJitInfo passOptionalNullableSequenceWithDefaultValue_methodinfo = {
11011 { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue },
11012 { prototypes::id::TestJSImplInterface },
11013 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11014 JSJitInfo::Method,
11015 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11016 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11017 false, /* isInfallible. False in setters. */
11018 false, /* isMovable. Not relevant for setters. */
11019 false, /* isEliminatable. Not relevant for setters. */
11020 false, /* isAlwaysInSlot. Only relevant for getters. */
11021 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11022 false, /* isTypedMethod. Only relevant for methods. */
11023 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11024};
11025
11026MOZ_CAN_RUN_SCRIPT static bool
11027passOptionalNullableSequenceWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11028{
11029 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2");
11030 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11033( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11031 "TestJSImplInterface", "passOptionalNullableSequenceWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11033( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11032 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11033( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11033 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11033( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11034
11035 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11036 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11037 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11038 if (objIsXray) {
11039 unwrappedObj.emplace(cx, obj);
11040 }
11041 Nullable<Sequence<int32_t>> arg0;
11042 if (args.hasDefined(0)) {
11043 if (args[0].isObject()) {
11044 JS::ForOfIterator iter(cx);
11045 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11046 return false;
11047 }
11048 if (!iter.valueIsIterable()) {
11049 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11050 return false;
11051 }
11052 Sequence<int32_t> &arr = arg0.SetValue();
11053 JS::Rooted<JS::Value> temp(cx);
11054 while (true) {
11055 bool done;
11056 if (!iter.next(&temp, &done)) {
11057 return false;
11058 }
11059 if (done) {
11060 break;
11061 }
11062 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
11063 if (!slotPtr) {
11064 JS_ReportOutOfMemory(cx);
11065 return false;
11066 }
11067 int32_t& slot = *slotPtr;
11068 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
11069 return false;
11070 }
11071 }
11072 } else if (args[0].isNullOrUndefined()) {
11073 arg0.SetNull();
11074 } else {
11075 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11076 return false;
11077 }
11078 } else {
11079 arg0.SetValue();
11080 }
11081 if (objIsXray) {
11082 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11083 // we know Xrays have no dynamic unwrap behavior.
11084 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11085 if (!unwrappedObj.ref()) {
11086 return false;
11087 }
11088 }
11089 FastErrorResult rv;
11090 // NOTE: This assert does NOT call the function.
11091 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11092 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11093 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2"
)), 0))
) {
11094 return false;
11095 }
11096 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11096); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11096; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11097 args.rval().setUndefined();
11098 return true;
11099}
11100
11101static const JSJitInfo passOptionalNullableSequenceWithDefaultValue2_methodinfo = {
11102 { (JSJitGetterOp)passOptionalNullableSequenceWithDefaultValue2 },
11103 { prototypes::id::TestJSImplInterface },
11104 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11105 JSJitInfo::Method,
11106 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11107 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11108 false, /* isInfallible. False in setters. */
11109 false, /* isMovable. Not relevant for setters. */
11110 false, /* isEliminatable. Not relevant for setters. */
11111 false, /* isAlwaysInSlot. Only relevant for getters. */
11112 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11113 false, /* isTypedMethod. Only relevant for methods. */
11114 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11115};
11116
11117MOZ_CAN_RUN_SCRIPT static bool
11118passOptionalObjectSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11119{
11120 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObjectSequence");
11121 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11124( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11122 "TestJSImplInterface", "passOptionalObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11124( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11123 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11124( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11124 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11124( cx, "TestJSImplInterface"
, "passOptionalObjectSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11125
11126 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11127 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11128 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11129 if (objIsXray) {
11130 unwrappedObj.emplace(cx, obj);
11131 }
11132 Optional<Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>>> arg0;
11133 if (args.hasDefined(0)) {
11134 arg0.Construct();
11135 if (args[0].isObject()) {
11136 JS::ForOfIterator iter(cx);
11137 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11138 return false;
11139 }
11140 if (!iter.valueIsIterable()) {
11141 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11142 return false;
11143 }
11144 Sequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> &arr = arg0.Value();
11145 JS::Rooted<JS::Value> temp(cx);
11146 while (true) {
11147 bool done;
11148 if (!iter.next(&temp, &done)) {
11149 return false;
11150 }
11151 if (done) {
11152 break;
11153 }
11154 OwningNonNull<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11155 if (!slotPtr) {
11156 JS_ReportOutOfMemory(cx);
11157 return false;
11158 }
11159 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
11160 if (temp.isObject()) {
11161 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
11162 {
11163 // Our JSContext should be in the right global to do unwrapping in.
11164 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
11165 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
11166 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestJSImplInterface");
11167 return false;
11168 }
11169 }
11170 } else {
11171 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11172 return false;
11173 }
11174 }
11175 } else {
11176 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11177 return false;
11178 }
11179 }
11180 if (objIsXray) {
11181 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11182 // we know Xrays have no dynamic unwrap behavior.
11183 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11184 if (!unwrappedObj.ref()) {
11185 return false;
11186 }
11187 }
11188 FastErrorResult rv;
11189 // NOTE: This assert does NOT call the function.
11190 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11191 MOZ_KnownLive(self)(self)->PassOptionalObjectSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11192 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectSequence"
)), 0))
) {
11193 return false;
11194 }
11195 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11195; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11196 args.rval().setUndefined();
11197 return true;
11198}
11199
11200static const JSJitInfo passOptionalObjectSequence_methodinfo = {
11201 { (JSJitGetterOp)passOptionalObjectSequence },
11202 { prototypes::id::TestJSImplInterface },
11203 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11204 JSJitInfo::Method,
11205 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11206 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11207 false, /* isInfallible. False in setters. */
11208 false, /* isMovable. Not relevant for setters. */
11209 false, /* isEliminatable. Not relevant for setters. */
11210 false, /* isAlwaysInSlot. Only relevant for getters. */
11211 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11212 false, /* isTypedMethod. Only relevant for methods. */
11213 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11214};
11215
11216MOZ_CAN_RUN_SCRIPT static bool
11217passExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11218{
11219 BindingCallContext cx(cx_, "TestJSImplInterface.passExternalInterfaceSequence");
11220 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11223( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11221 "TestJSImplInterface", "passExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11223( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11222 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11223( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11223 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11223( cx, "TestJSImplInterface"
, "passExternalInterfaceSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11224
11225 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11226 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternalInterfaceSequence", 1)) {
11227 return false;
11228 }
11229 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11230 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11231 if (objIsXray) {
11232 unwrappedObj.emplace(cx, obj);
11233 }
11234 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0;
11235 if (args[0].isObject()) {
11236 JS::ForOfIterator iter(cx);
11237 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11238 return false;
11239 }
11240 if (!iter.valueIsIterable()) {
11241 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11242 return false;
11243 }
11244 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0;
11245 JS::Rooted<JS::Value> temp(cx);
11246 while (true) {
11247 bool done;
11248 if (!iter.next(&temp, &done)) {
11249 return false;
11250 }
11251 if (done) {
11252 break;
11253 }
11254 RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11255 if (!slotPtr) {
11256 JS_ReportOutOfMemory(cx);
11257 return false;
11258 }
11259 RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr;
11260 if (temp.isObject()) {
11261 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
11262 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
11263 JS::Rooted<JSObject*> source(cx, &temp.toObject());
11264 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder
)))), 0)))
) {
11265 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface");
11266 return false;
11267 }
11268 MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tempHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestJSImplGenBinding.cpp"
, 11268); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { *((volatile int*)__null) = 11268; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
11269 slot = tempHolder;
11270 } else {
11271 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11272 return false;
11273 }
11274 }
11275 } else {
11276 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11277 return false;
11278 }
11279 if (objIsXray) {
11280 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11281 // we know Xrays have no dynamic unwrap behavior.
11282 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11283 if (!unwrappedObj.ref()) {
11284 return false;
11285 }
11286 }
11287 FastErrorResult rv;
11288 // NOTE: This assert does NOT call the function.
11289 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11290 MOZ_KnownLive(self)(self)->PassExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11291 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceSequence"
)), 0))
) {
11292 return false;
11293 }
11294 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11294); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11294; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11295 args.rval().setUndefined();
11296 return true;
11297}
11298
11299static const JSJitInfo passExternalInterfaceSequence_methodinfo = {
11300 { (JSJitGetterOp)passExternalInterfaceSequence },
11301 { prototypes::id::TestJSImplInterface },
11302 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11303 JSJitInfo::Method,
11304 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11305 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11306 false, /* isInfallible. False in setters. */
11307 false, /* isMovable. Not relevant for setters. */
11308 false, /* isEliminatable. Not relevant for setters. */
11309 false, /* isAlwaysInSlot. Only relevant for getters. */
11310 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11311 false, /* isTypedMethod. Only relevant for methods. */
11312 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11313};
11314
11315MOZ_CAN_RUN_SCRIPT static bool
11316passNullableExternalInterfaceSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11317{
11318 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternalInterfaceSequence");
11319 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11322( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11320 "TestJSImplInterface", "passNullableExternalInterfaceSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11322( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11321 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11322( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11322 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11322( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11323
11324 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11325 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence", 1)) {
11326 return false;
11327 }
11328 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11329 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11330 if (objIsXray) {
11331 unwrappedObj.emplace(cx, obj);
11332 }
11333 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> arg0;
11334 if (args[0].isObject()) {
11335 JS::ForOfIterator iter(cx);
11336 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11337 return false;
11338 }
11339 if (!iter.valueIsIterable()) {
11340 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11341 return false;
11342 }
11343 binding_detail::AutoSequence<RefPtr<mozilla::dom::TestExternalInterface>> &arr = arg0;
11344 JS::Rooted<JS::Value> temp(cx);
11345 while (true) {
11346 bool done;
11347 if (!iter.next(&temp, &done)) {
11348 return false;
11349 }
11350 if (done) {
11351 break;
11352 }
11353 RefPtr<mozilla::dom::TestExternalInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
11354 if (!slotPtr) {
11355 JS_ReportOutOfMemory(cx);
11356 return false;
11357 }
11358 RefPtr<mozilla::dom::TestExternalInterface>& slot = *slotPtr;
11359 if (temp.isObject()) {
11360 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
11361 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
11362 JS::Rooted<JSObject*> source(cx, &temp.toObject());
11363 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder
)))), 0)))
) {
11364 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "TestExternalInterface");
11365 return false;
11366 }
11367 MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tempHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestJSImplGenBinding.cpp"
, 11367); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { *((volatile int*)__null) = 11367; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
11368 slot = tempHolder;
11369 } else if (temp.isNullOrUndefined()) {
11370 slot = nullptr;
11371 } else {
11372 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
11373 return false;
11374 }
11375 }
11376 } else {
11377 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11378 return false;
11379 }
11380 if (objIsXray) {
11381 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11382 // we know Xrays have no dynamic unwrap behavior.
11383 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11384 if (!unwrappedObj.ref()) {
11385 return false;
11386 }
11387 }
11388 FastErrorResult rv;
11389 // NOTE: This assert does NOT call the function.
11390 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11391 MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11392 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceSequence"
)), 0))
) {
11393 return false;
11394 }
11395 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11395); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11395; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11396 args.rval().setUndefined();
11397 return true;
11398}
11399
11400static const JSJitInfo passNullableExternalInterfaceSequence_methodinfo = {
11401 { (JSJitGetterOp)passNullableExternalInterfaceSequence },
11402 { prototypes::id::TestJSImplInterface },
11403 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11404 JSJitInfo::Method,
11405 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11406 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
11407 false, /* isInfallible. False in setters. */
11408 false, /* isMovable. Not relevant for setters. */
11409 false, /* isEliminatable. Not relevant for setters. */
11410 false, /* isAlwaysInSlot. Only relevant for getters. */
11411 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11412 false, /* isTypedMethod. Only relevant for methods. */
11413 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11414};
11415
11416MOZ_CAN_RUN_SCRIPT static bool
11417receiveStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11418{
11419 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11422( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11420 "TestJSImplInterface", "receiveStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11422( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11421 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11422( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11422 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11422( cx, "TestJSImplInterface"
, "receiveStringSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11423
11424 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11425 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11426 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11427 if (objIsXray) {
11428 unwrappedObj.emplace(cx, obj);
11429 }
11430 if (objIsXray) {
11431 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11432 // we know Xrays have no dynamic unwrap behavior.
11433 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11434 if (!unwrappedObj.ref()) {
11435 return false;
11436 }
11437 }
11438 FastErrorResult rv;
11439 nsTArray<nsString> result;
11440 // NOTE: This assert does NOT call the function.
11441 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11442 MOZ_KnownLive(self)(self)->ReceiveStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11443 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveStringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveStringSequence"
)), 0))
) {
11444 return false;
11445 }
11446 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11446; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11447
11448 uint32_t length = result.Length();
11449 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11450 if (!returnArray) {
11451 return false;
11452 }
11453 // Scope for 'tmp'
11454 {
11455 JS::Rooted<JS::Value> tmp(cx);
11456 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11457 // Control block to let us common up the JS_DefineElement calls when there
11458 // are different ways to succeed at wrapping the object.
11459 do {
11460 if (!xpc::NonVoidStringToJsval(cx, result[sequenceIdx0], &tmp)) {
11461 return false;
11462 }
11463 break;
11464 } while (false);
11465 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11466 JSPROP_ENUMERATE)) {
11467 return false;
11468 }
11469 }
11470 }
11471 args.rval().setObject(*returnArray);
11472 return true;
11473}
11474
11475static const JSJitInfo receiveStringSequence_methodinfo = {
11476 { (JSJitGetterOp)receiveStringSequence },
11477 { prototypes::id::TestJSImplInterface },
11478 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11479 JSJitInfo::Method,
11480 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11481 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11482 false, /* isInfallible. False in setters. */
11483 false, /* isMovable. Not relevant for setters. */
11484 false, /* isEliminatable. Not relevant for setters. */
11485 false, /* isAlwaysInSlot. Only relevant for getters. */
11486 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11487 false, /* isTypedMethod. Only relevant for methods. */
11488 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11489};
11490
11491MOZ_CAN_RUN_SCRIPT static bool
11492receiveByteStringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11493{
11494 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11497( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11495 "TestJSImplInterface", "receiveByteStringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11497( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11496 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11497( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11497 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11497( cx, "TestJSImplInterface"
, "receiveByteStringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11498
11499 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11500 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11501 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11502 if (objIsXray) {
11503 unwrappedObj.emplace(cx, obj);
11504 }
11505 if (objIsXray) {
11506 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11507 // we know Xrays have no dynamic unwrap behavior.
11508 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11509 if (!unwrappedObj.ref()) {
11510 return false;
11511 }
11512 }
11513 FastErrorResult rv;
11514 nsTArray<nsCString> result;
11515 // NOTE: This assert does NOT call the function.
11516 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveByteStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11517 MOZ_KnownLive(self)(self)->ReceiveByteStringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11518 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByteStringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveByteStringSequence"
)), 0))
) {
11519 return false;
11520 }
11521 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11521); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11521; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11522
11523 uint32_t length = result.Length();
11524 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11525 if (!returnArray) {
11526 return false;
11527 }
11528 // Scope for 'tmp'
11529 {
11530 JS::Rooted<JS::Value> tmp(cx);
11531 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11532 // Control block to let us common up the JS_DefineElement calls when there
11533 // are different ways to succeed at wrapping the object.
11534 do {
11535 if (!NonVoidByteStringToJsval(cx, result[sequenceIdx0], &tmp)) {
11536 return false;
11537 }
11538 break;
11539 } while (false);
11540 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11541 JSPROP_ENUMERATE)) {
11542 return false;
11543 }
11544 }
11545 }
11546 args.rval().setObject(*returnArray);
11547 return true;
11548}
11549
11550static const JSJitInfo receiveByteStringSequence_methodinfo = {
11551 { (JSJitGetterOp)receiveByteStringSequence },
11552 { prototypes::id::TestJSImplInterface },
11553 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11554 JSJitInfo::Method,
11555 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11556 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11557 false, /* isInfallible. False in setters. */
11558 false, /* isMovable. Not relevant for setters. */
11559 false, /* isEliminatable. Not relevant for setters. */
11560 false, /* isAlwaysInSlot. Only relevant for getters. */
11561 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11562 false, /* isTypedMethod. Only relevant for methods. */
11563 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11564};
11565
11566MOZ_CAN_RUN_SCRIPT static bool
11567receiveUTF8StringSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11568{
11569 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11572( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11570 "TestJSImplInterface", "receiveUTF8StringSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11572( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11571 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11572( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11572 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11572( cx, "TestJSImplInterface"
, "receiveUTF8StringSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11573
11574 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11575 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11576 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11577 if (objIsXray) {
11578 unwrappedObj.emplace(cx, obj);
11579 }
11580 if (objIsXray) {
11581 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11582 // we know Xrays have no dynamic unwrap behavior.
11583 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11584 if (!unwrappedObj.ref()) {
11585 return false;
11586 }
11587 }
11588 FastErrorResult rv;
11589 nsTArray<nsCString> result;
11590 // NOTE: This assert does NOT call the function.
11591 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUTF8StringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11592 MOZ_KnownLive(self)(self)->ReceiveUTF8StringSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11593 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUTF8StringSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUTF8StringSequence"
)), 0))
) {
11594 return false;
11595 }
11596 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11596); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11596; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11597
11598 uint32_t length = result.Length();
11599 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11600 if (!returnArray) {
11601 return false;
11602 }
11603 // Scope for 'tmp'
11604 {
11605 JS::Rooted<JS::Value> tmp(cx);
11606 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11607 // Control block to let us common up the JS_DefineElement calls when there
11608 // are different ways to succeed at wrapping the object.
11609 do {
11610 if (!NonVoidUTF8StringToJsval(cx, result[sequenceIdx0], &tmp)) {
11611 return false;
11612 }
11613 break;
11614 } while (false);
11615 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11616 JSPROP_ENUMERATE)) {
11617 return false;
11618 }
11619 }
11620 }
11621 args.rval().setObject(*returnArray);
11622 return true;
11623}
11624
11625static const JSJitInfo receiveUTF8StringSequence_methodinfo = {
11626 { (JSJitGetterOp)receiveUTF8StringSequence },
11627 { prototypes::id::TestJSImplInterface },
11628 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11629 JSJitInfo::Method,
11630 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11631 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11632 false, /* isInfallible. False in setters. */
11633 false, /* isMovable. Not relevant for setters. */
11634 false, /* isEliminatable. Not relevant for setters. */
11635 false, /* isAlwaysInSlot. Only relevant for getters. */
11636 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11637 false, /* isTypedMethod. Only relevant for methods. */
11638 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11639};
11640
11641MOZ_CAN_RUN_SCRIPT static bool
11642receiveAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11643{
11644 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11647( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11645 "TestJSImplInterface", "receiveAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11647( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11646 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11647( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11647 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11647( cx, "TestJSImplInterface"
, "receiveAnySequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11648
11649 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11650 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11651 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11652 if (objIsXray) {
11653 unwrappedObj.emplace(cx, obj);
11654 }
11655 if (objIsXray) {
11656 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11657 // we know Xrays have no dynamic unwrap behavior.
11658 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11659 if (!unwrappedObj.ref()) {
11660 return false;
11661 }
11662 }
11663 FastErrorResult rv;
11664 nsTArray<JS::Value> result;
11665 SequenceRooter<JS::Value > resultRooter(cx, &result);
11666 // NOTE: This assert does NOT call the function.
11667 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11668 MOZ_KnownLive(self)(self)->ReceiveAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11669 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnySequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnySequence"
)), 0))
) {
11670 return false;
11671 }
11672 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11672; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11673
11674 uint32_t length = result.Length();
11675 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11676 if (!returnArray) {
11677 return false;
11678 }
11679 // Scope for 'tmp'
11680 {
11681 JS::Rooted<JS::Value> tmp(cx);
11682 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11683 // Control block to let us common up the JS_DefineElement calls when there
11684 // are different ways to succeed at wrapping the object.
11685 do {
11686 JS::ExposeValueToActiveJS(result[sequenceIdx0]);
11687 tmp.set(result[sequenceIdx0]);
11688 if (!MaybeWrapValue(cx, &tmp)) {
11689 return false;
11690 }
11691 break;
11692 } while (false);
11693 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11694 JSPROP_ENUMERATE)) {
11695 return false;
11696 }
11697 }
11698 }
11699 args.rval().setObject(*returnArray);
11700 return true;
11701}
11702
11703static const JSJitInfo receiveAnySequence_methodinfo = {
11704 { (JSJitGetterOp)receiveAnySequence },
11705 { prototypes::id::TestJSImplInterface },
11706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11707 JSJitInfo::Method,
11708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11709 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11710 false, /* isInfallible. False in setters. */
11711 false, /* isMovable. Not relevant for setters. */
11712 false, /* isEliminatable. Not relevant for setters. */
11713 false, /* isAlwaysInSlot. Only relevant for getters. */
11714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11715 false, /* isTypedMethod. Only relevant for methods. */
11716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11717};
11718
11719MOZ_CAN_RUN_SCRIPT static bool
11720receiveNullableAnySequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11721{
11722 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11725( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11723 "TestJSImplInterface", "receiveNullableAnySequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11725( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11724 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11725( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11725 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11725( cx, "TestJSImplInterface"
, "receiveNullableAnySequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11726
11727 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11728 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11729 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11730 if (objIsXray) {
11731 unwrappedObj.emplace(cx, obj);
11732 }
11733 if (objIsXray) {
11734 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11735 // we know Xrays have no dynamic unwrap behavior.
11736 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11737 if (!unwrappedObj.ref()) {
11738 return false;
11739 }
11740 }
11741 FastErrorResult rv;
11742 Nullable<nsTArray<JS::Value>> result;
11743 SequenceRooter<JS::Value > resultRooter(cx, &result);
11744 // NOTE: This assert does NOT call the function.
11745 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11746 MOZ_KnownLive(self)(self)->ReceiveNullableAnySequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11747 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableAnySequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableAnySequence"
)), 0))
) {
11748 return false;
11749 }
11750 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11750); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11750; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11751
11752 if (result.IsNull()) {
11753 args.rval().setNull();
11754 return true;
11755 }
11756
11757 uint32_t length = result.Value().Length();
11758 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11759 if (!returnArray) {
11760 return false;
11761 }
11762 // Scope for 'tmp'
11763 {
11764 JS::Rooted<JS::Value> tmp(cx);
11765 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11766 // Control block to let us common up the JS_DefineElement calls when there
11767 // are different ways to succeed at wrapping the object.
11768 do {
11769 JS::ExposeValueToActiveJS(result.Value()[sequenceIdx0]);
11770 tmp.set(result.Value()[sequenceIdx0]);
11771 if (!MaybeWrapValue(cx, &tmp)) {
11772 return false;
11773 }
11774 break;
11775 } while (false);
11776 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11777 JSPROP_ENUMERATE)) {
11778 return false;
11779 }
11780 }
11781 }
11782 args.rval().setObject(*returnArray);
11783 return true;
11784}
11785
11786static const JSJitInfo receiveNullableAnySequence_methodinfo = {
11787 { (JSJitGetterOp)receiveNullableAnySequence },
11788 { prototypes::id::TestJSImplInterface },
11789 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11790 JSJitInfo::Method,
11791 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11792 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
11793 false, /* isInfallible. False in setters. */
11794 false, /* isMovable. Not relevant for setters. */
11795 false, /* isEliminatable. Not relevant for setters. */
11796 false, /* isAlwaysInSlot. Only relevant for getters. */
11797 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11798 false, /* isTypedMethod. Only relevant for methods. */
11799 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11800};
11801
11802MOZ_CAN_RUN_SCRIPT static bool
11803receiveObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11804{
11805 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11808( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11806 "TestJSImplInterface", "receiveObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11808( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11807 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11808( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11808 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11808( cx, "TestJSImplInterface"
, "receiveObjectSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11809
11810 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11811 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11812 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11813 if (objIsXray) {
11814 unwrappedObj.emplace(cx, obj);
11815 }
11816 if (objIsXray) {
11817 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11818 // we know Xrays have no dynamic unwrap behavior.
11819 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11820 if (!unwrappedObj.ref()) {
11821 return false;
11822 }
11823 }
11824 FastErrorResult rv;
11825 nsTArray<JSObject*> result;
11826 SequenceRooter<JSObject* > resultRooter(cx, &result);
11827 // NOTE: This assert does NOT call the function.
11828 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11829 MOZ_KnownLive(self)(self)->ReceiveObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11830 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObjectSequence"
)), 0))
) {
11831 return false;
11832 }
11833 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11833); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11833; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11834
11835 uint32_t length = result.Length();
11836 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11837 if (!returnArray) {
11838 return false;
11839 }
11840 // Scope for 'tmp'
11841 {
11842 JS::Rooted<JS::Value> tmp(cx);
11843 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11844 // Control block to let us common up the JS_DefineElement calls when there
11845 // are different ways to succeed at wrapping the object.
11846 do {
11847 JS::ExposeObjectToActiveJS(result[sequenceIdx0]);
11848 tmp.setObject(*result[sequenceIdx0]);
11849 if (!MaybeWrapObjectValue(cx, &tmp)) {
11850 return false;
11851 }
11852 break;
11853 } while (false);
11854 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11855 JSPROP_ENUMERATE)) {
11856 return false;
11857 }
11858 }
11859 }
11860 args.rval().setObject(*returnArray);
11861 return true;
11862}
11863
11864static const JSJitInfo receiveObjectSequence_methodinfo = {
11865 { (JSJitGetterOp)receiveObjectSequence },
11866 { prototypes::id::TestJSImplInterface },
11867 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11868 JSJitInfo::Method,
11869 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11870 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11871 false, /* isInfallible. False in setters. */
11872 false, /* isMovable. Not relevant for setters. */
11873 false, /* isEliminatable. Not relevant for setters. */
11874 false, /* isAlwaysInSlot. Only relevant for getters. */
11875 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11876 false, /* isTypedMethod. Only relevant for methods. */
11877 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11878};
11879
11880MOZ_CAN_RUN_SCRIPT static bool
11881receiveNullableObjectSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11882{
11883 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11886( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11884 "TestJSImplInterface", "receiveNullableObjectSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11886( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11885 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11886( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
11886 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11886( cx, "TestJSImplInterface"
, "receiveNullableObjectSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
11887
11888 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11889 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11890 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11891 if (objIsXray) {
11892 unwrappedObj.emplace(cx, obj);
11893 }
11894 if (objIsXray) {
11895 // Since our object is an Xray, we can just CheckedUnwrapStatic:
11896 // we know Xrays have no dynamic unwrap behavior.
11897 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
11898 if (!unwrappedObj.ref()) {
11899 return false;
11900 }
11901 }
11902 FastErrorResult rv;
11903 nsTArray<JSObject*> result;
11904 SequenceRooter<JSObject* > resultRooter(cx, &result);
11905 // NOTE: This assert does NOT call the function.
11906 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
11907 MOZ_KnownLive(self)(self)->ReceiveNullableObjectSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
11908 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObjectSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObjectSequence"
)), 0))
) {
11909 return false;
11910 }
11911 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 11911); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 11911; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
11912
11913 uint32_t length = result.Length();
11914 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
11915 if (!returnArray) {
11916 return false;
11917 }
11918 // Scope for 'tmp'
11919 {
11920 JS::Rooted<JS::Value> tmp(cx);
11921 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
11922 // Control block to let us common up the JS_DefineElement calls when there
11923 // are different ways to succeed at wrapping the object.
11924 do {
11925 if (result[sequenceIdx0]) {
11926 JS::ExposeObjectToActiveJS(result[sequenceIdx0]);
11927 }
11928 tmp.setObjectOrNull(result[sequenceIdx0]);
11929 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
11930 return false;
11931 }
11932 break;
11933 } while (false);
11934 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
11935 JSPROP_ENUMERATE)) {
11936 return false;
11937 }
11938 }
11939 }
11940 args.rval().setObject(*returnArray);
11941 return true;
11942}
11943
11944static const JSJitInfo receiveNullableObjectSequence_methodinfo = {
11945 { (JSJitGetterOp)receiveNullableObjectSequence },
11946 { prototypes::id::TestJSImplInterface },
11947 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
11948 JSJitInfo::Method,
11949 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
11950 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
11951 false, /* isInfallible. False in setters. */
11952 false, /* isMovable. Not relevant for setters. */
11953 false, /* isEliminatable. Not relevant for setters. */
11954 false, /* isAlwaysInSlot. Only relevant for getters. */
11955 false, /* isLazilyCachedInSlot. Only relevant for getters. */
11956 false, /* isTypedMethod. Only relevant for methods. */
11957 0 /* Reserved slot index, if we're stored in a slot, else 0. */
11958};
11959
11960MOZ_CAN_RUN_SCRIPT static bool
11961passSequenceOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
11962{
11963 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequences");
11964 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject11967( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11965 "TestJSImplInterface", "passSequenceOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject11967( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11966 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject11967( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
11967 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject11967( cx, "TestJSImplInterface"
, "passSequenceOfSequences", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
11968
11969 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
11970 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequences", 1)) {
11971 return false;
11972 }
11973 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
11974 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
11975 if (objIsXray) {
11976 unwrappedObj.emplace(cx, obj);
11977 }
11978 binding_detail::AutoSequence<Sequence<int32_t>> arg0;
11979 if (args[0].isObject()) {
11980 JS::ForOfIterator iter(cx);
11981 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
11982 return false;
11983 }
11984 if (!iter.valueIsIterable()) {
11985 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
11986 return false;
11987 }
11988 binding_detail::AutoSequence<Sequence<int32_t>> &arr = arg0;
11989 JS::Rooted<JS::Value> temp(cx);
11990 while (true) {
11991 bool done;
11992 if (!iter.next(&temp, &done)) {
11993 return false;
11994 }
11995 if (done) {
11996 break;
11997 }
11998 Sequence<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
11999 if (!slotPtr) {
12000 JS_ReportOutOfMemory(cx);
12001 return false;
12002 }
12003 Sequence<int32_t>& slot = *slotPtr;
12004 if (temp.isObject()) {
12005 JS::ForOfIterator iter1(cx);
12006 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
12007 return false;
12008 }
12009 if (!iter1.valueIsIterable()) {
12010 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12011 return false;
12012 }
12013 Sequence<int32_t> &arr1 = slot;
12014 JS::Rooted<JS::Value> temp1(cx);
12015 while (true) {
12016 bool done1;
12017 if (!iter1.next(&temp1, &done1)) {
12018 return false;
12019 }
12020 if (done1) {
12021 break;
12022 }
12023 int32_t* slotPtr1 = arr1.AppendElement(mozilla::fallible);
12024 if (!slotPtr1) {
12025 JS_ReportOutOfMemory(cx);
12026 return false;
12027 }
12028 int32_t& slot1 = *slotPtr1;
12029 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp1, "Element of element of argument 1", &slot1)) {
12030 return false;
12031 }
12032 }
12033 } else {
12034 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12035 return false;
12036 }
12037 }
12038 } else {
12039 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12040 return false;
12041 }
12042 if (objIsXray) {
12043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12044 // we know Xrays have no dynamic unwrap behavior.
12045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12046 if (!unwrappedObj.ref()) {
12047 return false;
12048 }
12049 }
12050 FastErrorResult rv;
12051 // NOTE: This assert does NOT call the function.
12052 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12053 MOZ_KnownLive(self)(self)->PassSequenceOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequences"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequences"
)), 0))
) {
12055 return false;
12056 }
12057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12057; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12058 args.rval().setUndefined();
12059 return true;
12060}
12061
12062static const JSJitInfo passSequenceOfSequences_methodinfo = {
12063 { (JSJitGetterOp)passSequenceOfSequences },
12064 { prototypes::id::TestJSImplInterface },
12065 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12066 JSJitInfo::Method,
12067 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12068 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12069 false, /* isInfallible. False in setters. */
12070 false, /* isMovable. Not relevant for setters. */
12071 false, /* isEliminatable. Not relevant for setters. */
12072 false, /* isAlwaysInSlot. Only relevant for getters. */
12073 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12074 false, /* isTypedMethod. Only relevant for methods. */
12075 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12076};
12077
12078MOZ_CAN_RUN_SCRIPT static bool
12079passSequenceOfSequencesOfSequences(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12080{
12081 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequencesOfSequences");
12082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12085( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12083 "TestJSImplInterface", "passSequenceOfSequencesOfSequences", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12085( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12085( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12085( cx, "TestJSImplInterface"
, "passSequenceOfSequencesOfSequences", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12086
12087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12088 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences", 1)) {
12089 return false;
12090 }
12091 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12092 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12093 if (objIsXray) {
12094 unwrappedObj.emplace(cx, obj);
12095 }
12096 binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> arg0;
12097 if (args[0].isObject()) {
12098 JS::ForOfIterator iter(cx);
12099 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
12100 return false;
12101 }
12102 if (!iter.valueIsIterable()) {
12103 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12104 return false;
12105 }
12106 binding_detail::AutoSequence<Sequence<Sequence<int32_t>>> &arr = arg0;
12107 JS::Rooted<JS::Value> temp(cx);
12108 while (true) {
12109 bool done;
12110 if (!iter.next(&temp, &done)) {
12111 return false;
12112 }
12113 if (done) {
12114 break;
12115 }
12116 Sequence<Sequence<int32_t>>* slotPtr = arr.AppendElement(mozilla::fallible);
12117 if (!slotPtr) {
12118 JS_ReportOutOfMemory(cx);
12119 return false;
12120 }
12121 Sequence<Sequence<int32_t>>& slot = *slotPtr;
12122 if (temp.isObject()) {
12123 JS::ForOfIterator iter1(cx);
12124 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
12125 return false;
12126 }
12127 if (!iter1.valueIsIterable()) {
12128 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12129 return false;
12130 }
12131 Sequence<Sequence<int32_t>> &arr1 = slot;
12132 JS::Rooted<JS::Value> temp1(cx);
12133 while (true) {
12134 bool done1;
12135 if (!iter1.next(&temp1, &done1)) {
12136 return false;
12137 }
12138 if (done1) {
12139 break;
12140 }
12141 Sequence<int32_t>* slotPtr1 = arr1.AppendElement(mozilla::fallible);
12142 if (!slotPtr1) {
12143 JS_ReportOutOfMemory(cx);
12144 return false;
12145 }
12146 Sequence<int32_t>& slot1 = *slotPtr1;
12147 if (temp1.isObject()) {
12148 JS::ForOfIterator iter2(cx);
12149 if (!iter2.init(temp1, JS::ForOfIterator::AllowNonIterable)) {
12150 return false;
12151 }
12152 if (!iter2.valueIsIterable()) {
12153 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence");
12154 return false;
12155 }
12156 Sequence<int32_t> &arr2 = slot1;
12157 JS::Rooted<JS::Value> temp2(cx);
12158 while (true) {
12159 bool done2;
12160 if (!iter2.next(&temp2, &done2)) {
12161 return false;
12162 }
12163 if (done2) {
12164 break;
12165 }
12166 int32_t* slotPtr2 = arr2.AppendElement(mozilla::fallible);
12167 if (!slotPtr2) {
12168 JS_ReportOutOfMemory(cx);
12169 return false;
12170 }
12171 int32_t& slot2 = *slotPtr2;
12172 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp2, "Element of element of element of argument 1", &slot2)) {
12173 return false;
12174 }
12175 }
12176 } else {
12177 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of element of argument 1", "sequence");
12178 return false;
12179 }
12180 }
12181 } else {
12182 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
12183 return false;
12184 }
12185 }
12186 } else {
12187 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
12188 return false;
12189 }
12190 if (objIsXray) {
12191 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12192 // we know Xrays have no dynamic unwrap behavior.
12193 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12194 if (!unwrappedObj.ref()) {
12195 return false;
12196 }
12197 }
12198 FastErrorResult rv;
12199 // NOTE: This assert does NOT call the function.
12200 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequencesOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12201 MOZ_KnownLive(self)(self)->PassSequenceOfSequencesOfSequences(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12202 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequencesOfSequences"
)), 0))
) {
12203 return false;
12204 }
12205 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12205); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12205; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12206 args.rval().setUndefined();
12207 return true;
12208}
12209
12210static const JSJitInfo passSequenceOfSequencesOfSequences_methodinfo = {
12211 { (JSJitGetterOp)passSequenceOfSequencesOfSequences },
12212 { prototypes::id::TestJSImplInterface },
12213 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12214 JSJitInfo::Method,
12215 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12216 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12217 false, /* isInfallible. False in setters. */
12218 false, /* isMovable. Not relevant for setters. */
12219 false, /* isEliminatable. Not relevant for setters. */
12220 false, /* isAlwaysInSlot. Only relevant for getters. */
12221 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12222 false, /* isTypedMethod. Only relevant for methods. */
12223 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12224};
12225
12226MOZ_CAN_RUN_SCRIPT static bool
12227passRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12228{
12229 BindingCallContext cx(cx_, "TestJSImplInterface.passRecord");
12230 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12233( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12231 "TestJSImplInterface", "passRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12233( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12232 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12233( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12233 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12233( cx, "TestJSImplInterface"
, "passRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
12234
12235 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12236 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecord", 1)) {
12237 return false;
12238 }
12239 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12240 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12241 if (objIsXray) {
12242 unwrappedObj.emplace(cx, obj);
12243 }
12244 Record<nsString, int32_t> arg0;
12245 if (args[0].isObject()) {
12246 auto& recordEntries = arg0.Entries();
12247
12248 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12249 JS::RootedVector<jsid> ids(cx);
12250 if (!js::GetPropertyKeys(cx, recordObj,
12251 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12252 return false;
12253 }
12254 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12255 JS_ReportOutOfMemory(cx);
12256 return false;
12257 }
12258 JS::Rooted<JS::Value> propNameValue(cx);
12259 JS::Rooted<JS::Value> temp(cx);
12260 JS::Rooted<jsid> curId(cx);
12261 JS::Rooted<JS::Value> idVal(cx);
12262 // Use a hashset to keep track of ids seen, to avoid
12263 // introducing nasty O(N^2) behavior scanning for them all the
12264 // time. Ideally we'd use a data structure with O(1) lookup
12265 // _and_ ordering for the MozMap, but we don't have one lying
12266 // around.
12267 nsTHashtable<nsStringHashKey> idsSeen;
12268 for (size_t i = 0; i < ids.length(); ++i) {
12269 curId = ids[i];
12270
12271 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12272 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12273 &desc)) {
12274 return false;
12275 }
12276
12277 if (desc.isNothing() || !desc->enumerable()) {
12278 continue;
12279 }
12280
12281 idVal = js::IdToValue(curId);
12282 nsString propName;
12283 // This will just throw if idVal is a Symbol, like the spec says
12284 // to do.
12285 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12286 return false;
12287 }
12288
12289 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12290 return false;
12291 }
12292
12293 Record<nsString, int32_t>::EntryType* entry;
12294 if (!idsSeen.EnsureInserted(propName)) {
12295 // Find the existing entry.
12296 auto idx = recordEntries.IndexOf(propName);
12297 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12298; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12298 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12298); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12298; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12299 // Now blow it away to make it look like it was just added
12300 // to the array, because it's not obvious that it's
12301 // safe to write to its already-initialized mValue via our
12302 // normal codegen conversions. For example, the value
12303 // could be a union and this would change its type, but
12304 // codegen assumes we won't do that.
12305 entry = recordEntries.ReconstructElementAt(idx);
12306 } else {
12307 // Safe to do an infallible append here, because we did a
12308 // SetCapacity above to the right capacity.
12309 entry = recordEntries.AppendElement();
12310 }
12311 entry->mKey = propName;
12312 int32_t& slot = entry->mValue;
12313 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
12314 return false;
12315 }
12316 }
12317 } else {
12318 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12319 return false;
12320 }
12321 if (objIsXray) {
12322 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12323 // we know Xrays have no dynamic unwrap behavior.
12324 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12325 if (!unwrappedObj.ref()) {
12326 return false;
12327 }
12328 }
12329 FastErrorResult rv;
12330 // NOTE: This assert does NOT call the function.
12331 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12332 MOZ_KnownLive(self)(self)->PassRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12333 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecord"
)), 0))
) {
12334 return false;
12335 }
12336 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12336); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12336; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12337 args.rval().setUndefined();
12338 return true;
12339}
12340
12341static const JSJitInfo passRecord_methodinfo = {
12342 { (JSJitGetterOp)passRecord },
12343 { prototypes::id::TestJSImplInterface },
12344 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12345 JSJitInfo::Method,
12346 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12347 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12348 false, /* isInfallible. False in setters. */
12349 false, /* isMovable. Not relevant for setters. */
12350 false, /* isEliminatable. Not relevant for setters. */
12351 false, /* isAlwaysInSlot. Only relevant for getters. */
12352 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12353 false, /* isTypedMethod. Only relevant for methods. */
12354 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12355};
12356
12357MOZ_CAN_RUN_SCRIPT static bool
12358passNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12359{
12360 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecord");
12361 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12364( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12362 "TestJSImplInterface", "passNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12364( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12363 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12364( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
12364 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12364( cx, "TestJSImplInterface"
, "passNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
12365
12366 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12367 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecord", 1)) {
12368 return false;
12369 }
12370 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12371 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12372 if (objIsXray) {
12373 unwrappedObj.emplace(cx, obj);
12374 }
12375 Nullable<Record<nsString, int32_t>> arg0;
12376 if (args[0].isObject()) {
12377 auto& recordEntries = arg0.SetValue().Entries();
12378
12379 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12380 JS::RootedVector<jsid> ids(cx);
12381 if (!js::GetPropertyKeys(cx, recordObj,
12382 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12383 return false;
12384 }
12385 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12386 JS_ReportOutOfMemory(cx);
12387 return false;
12388 }
12389 JS::Rooted<JS::Value> propNameValue(cx);
12390 JS::Rooted<JS::Value> temp(cx);
12391 JS::Rooted<jsid> curId(cx);
12392 JS::Rooted<JS::Value> idVal(cx);
12393 // Use a hashset to keep track of ids seen, to avoid
12394 // introducing nasty O(N^2) behavior scanning for them all the
12395 // time. Ideally we'd use a data structure with O(1) lookup
12396 // _and_ ordering for the MozMap, but we don't have one lying
12397 // around.
12398 nsTHashtable<nsStringHashKey> idsSeen;
12399 for (size_t i = 0; i < ids.length(); ++i) {
12400 curId = ids[i];
12401
12402 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12403 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12404 &desc)) {
12405 return false;
12406 }
12407
12408 if (desc.isNothing() || !desc->enumerable()) {
12409 continue;
12410 }
12411
12412 idVal = js::IdToValue(curId);
12413 nsString propName;
12414 // This will just throw if idVal is a Symbol, like the spec says
12415 // to do.
12416 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12417 return false;
12418 }
12419
12420 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12421 return false;
12422 }
12423
12424 Record<nsString, int32_t>::EntryType* entry;
12425 if (!idsSeen.EnsureInserted(propName)) {
12426 // Find the existing entry.
12427 auto idx = recordEntries.IndexOf(propName);
12428 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12429); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12429; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12429 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12429); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12429; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12430 // Now blow it away to make it look like it was just added
12431 // to the array, because it's not obvious that it's
12432 // safe to write to its already-initialized mValue via our
12433 // normal codegen conversions. For example, the value
12434 // could be a union and this would change its type, but
12435 // codegen assumes we won't do that.
12436 entry = recordEntries.ReconstructElementAt(idx);
12437 } else {
12438 // Safe to do an infallible append here, because we did a
12439 // SetCapacity above to the right capacity.
12440 entry = recordEntries.AppendElement();
12441 }
12442 entry->mKey = propName;
12443 int32_t& slot = entry->mValue;
12444 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
12445 return false;
12446 }
12447 }
12448 } else if (args[0].isNullOrUndefined()) {
12449 arg0.SetNull();
12450 } else {
12451 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12452 return false;
12453 }
12454 if (objIsXray) {
12455 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12456 // we know Xrays have no dynamic unwrap behavior.
12457 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12458 if (!unwrappedObj.ref()) {
12459 return false;
12460 }
12461 }
12462 FastErrorResult rv;
12463 // NOTE: This assert does NOT call the function.
12464 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12465 MOZ_KnownLive(self)(self)->PassNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12466 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecord"
)), 0))
) {
12467 return false;
12468 }
12469 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12469; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12470 args.rval().setUndefined();
12471 return true;
12472}
12473
12474static const JSJitInfo passNullableRecord_methodinfo = {
12475 { (JSJitGetterOp)passNullableRecord },
12476 { prototypes::id::TestJSImplInterface },
12477 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12478 JSJitInfo::Method,
12479 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12480 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12481 false, /* isInfallible. False in setters. */
12482 false, /* isMovable. Not relevant for setters. */
12483 false, /* isEliminatable. Not relevant for setters. */
12484 false, /* isAlwaysInSlot. Only relevant for getters. */
12485 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12486 false, /* isTypedMethod. Only relevant for methods. */
12487 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12488};
12489
12490MOZ_CAN_RUN_SCRIPT static bool
12491passRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12492{
12493 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableInts");
12494 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12497( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12495 "TestJSImplInterface", "passRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12497( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12496 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12497( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12497 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12497( cx, "TestJSImplInterface"
, "passRecordOfNullableInts", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12498
12499 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12500 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableInts", 1)) {
12501 return false;
12502 }
12503 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12504 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12505 if (objIsXray) {
12506 unwrappedObj.emplace(cx, obj);
12507 }
12508 Record<nsString, Nullable<int32_t>> arg0;
12509 if (args[0].isObject()) {
12510 auto& recordEntries = arg0.Entries();
12511
12512 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12513 JS::RootedVector<jsid> ids(cx);
12514 if (!js::GetPropertyKeys(cx, recordObj,
12515 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12516 return false;
12517 }
12518 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12519 JS_ReportOutOfMemory(cx);
12520 return false;
12521 }
12522 JS::Rooted<JS::Value> propNameValue(cx);
12523 JS::Rooted<JS::Value> temp(cx);
12524 JS::Rooted<jsid> curId(cx);
12525 JS::Rooted<JS::Value> idVal(cx);
12526 // Use a hashset to keep track of ids seen, to avoid
12527 // introducing nasty O(N^2) behavior scanning for them all the
12528 // time. Ideally we'd use a data structure with O(1) lookup
12529 // _and_ ordering for the MozMap, but we don't have one lying
12530 // around.
12531 nsTHashtable<nsStringHashKey> idsSeen;
12532 for (size_t i = 0; i < ids.length(); ++i) {
12533 curId = ids[i];
12534
12535 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12536 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12537 &desc)) {
12538 return false;
12539 }
12540
12541 if (desc.isNothing() || !desc->enumerable()) {
12542 continue;
12543 }
12544
12545 idVal = js::IdToValue(curId);
12546 nsString propName;
12547 // This will just throw if idVal is a Symbol, like the spec says
12548 // to do.
12549 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12550 return false;
12551 }
12552
12553 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12554 return false;
12555 }
12556
12557 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12558 if (!idsSeen.EnsureInserted(propName)) {
12559 // Find the existing entry.
12560 auto idx = recordEntries.IndexOf(propName);
12561 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12562); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12562; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12562 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12562); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12562; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12563 // Now blow it away to make it look like it was just added
12564 // to the array, because it's not obvious that it's
12565 // safe to write to its already-initialized mValue via our
12566 // normal codegen conversions. For example, the value
12567 // could be a union and this would change its type, but
12568 // codegen assumes we won't do that.
12569 entry = recordEntries.ReconstructElementAt(idx);
12570 } else {
12571 // Safe to do an infallible append here, because we did a
12572 // SetCapacity above to the right capacity.
12573 entry = recordEntries.AppendElement();
12574 }
12575 entry->mKey = propName;
12576 Nullable<int32_t>& slot = entry->mValue;
12577 if (temp.isNullOrUndefined()) {
12578 slot.SetNull();
12579 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12580 return false;
12581 }
12582 }
12583 } else {
12584 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12585 return false;
12586 }
12587 if (objIsXray) {
12588 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12589 // we know Xrays have no dynamic unwrap behavior.
12590 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12591 if (!unwrappedObj.ref()) {
12592 return false;
12593 }
12594 }
12595 FastErrorResult rv;
12596 // NOTE: This assert does NOT call the function.
12597 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12598 MOZ_KnownLive(self)(self)->PassRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12599 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableInts"
)), 0))
) {
12600 return false;
12601 }
12602 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12602); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12602; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12603 args.rval().setUndefined();
12604 return true;
12605}
12606
12607static const JSJitInfo passRecordOfNullableInts_methodinfo = {
12608 { (JSJitGetterOp)passRecordOfNullableInts },
12609 { prototypes::id::TestJSImplInterface },
12610 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12611 JSJitInfo::Method,
12612 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12613 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12614 false, /* isInfallible. False in setters. */
12615 false, /* isMovable. Not relevant for setters. */
12616 false, /* isEliminatable. Not relevant for setters. */
12617 false, /* isAlwaysInSlot. Only relevant for getters. */
12618 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12619 false, /* isTypedMethod. Only relevant for methods. */
12620 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12621};
12622
12623MOZ_CAN_RUN_SCRIPT static bool
12624passOptionalRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12625{
12626 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfNullableInts");
12627 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12630( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12628 "TestJSImplInterface", "passOptionalRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12630( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12629 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12630( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12630 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12630( cx, "TestJSImplInterface"
, "passOptionalRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12631
12632 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12633 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12634 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12635 if (objIsXray) {
12636 unwrappedObj.emplace(cx, obj);
12637 }
12638 Optional<Record<nsString, Nullable<int32_t>>> arg0;
12639 if (args.hasDefined(0)) {
12640 arg0.Construct();
12641 if (args[0].isObject()) {
12642 auto& recordEntries = arg0.Value().Entries();
12643
12644 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12645 JS::RootedVector<jsid> ids(cx);
12646 if (!js::GetPropertyKeys(cx, recordObj,
12647 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12648 return false;
12649 }
12650 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12651 JS_ReportOutOfMemory(cx);
12652 return false;
12653 }
12654 JS::Rooted<JS::Value> propNameValue(cx);
12655 JS::Rooted<JS::Value> temp(cx);
12656 JS::Rooted<jsid> curId(cx);
12657 JS::Rooted<JS::Value> idVal(cx);
12658 // Use a hashset to keep track of ids seen, to avoid
12659 // introducing nasty O(N^2) behavior scanning for them all the
12660 // time. Ideally we'd use a data structure with O(1) lookup
12661 // _and_ ordering for the MozMap, but we don't have one lying
12662 // around.
12663 nsTHashtable<nsStringHashKey> idsSeen;
12664 for (size_t i = 0; i < ids.length(); ++i) {
12665 curId = ids[i];
12666
12667 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12668 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12669 &desc)) {
12670 return false;
12671 }
12672
12673 if (desc.isNothing() || !desc->enumerable()) {
12674 continue;
12675 }
12676
12677 idVal = js::IdToValue(curId);
12678 nsString propName;
12679 // This will just throw if idVal is a Symbol, like the spec says
12680 // to do.
12681 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12682 return false;
12683 }
12684
12685 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12686 return false;
12687 }
12688
12689 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12690 if (!idsSeen.EnsureInserted(propName)) {
12691 // Find the existing entry.
12692 auto idx = recordEntries.IndexOf(propName);
12693 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12694; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12694 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12694; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12695 // Now blow it away to make it look like it was just added
12696 // to the array, because it's not obvious that it's
12697 // safe to write to its already-initialized mValue via our
12698 // normal codegen conversions. For example, the value
12699 // could be a union and this would change its type, but
12700 // codegen assumes we won't do that.
12701 entry = recordEntries.ReconstructElementAt(idx);
12702 } else {
12703 // Safe to do an infallible append here, because we did a
12704 // SetCapacity above to the right capacity.
12705 entry = recordEntries.AppendElement();
12706 }
12707 entry->mKey = propName;
12708 Nullable<int32_t>& slot = entry->mValue;
12709 if (temp.isNullOrUndefined()) {
12710 slot.SetNull();
12711 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12712 return false;
12713 }
12714 }
12715 } else {
12716 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12717 return false;
12718 }
12719 }
12720 if (objIsXray) {
12721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12722 // we know Xrays have no dynamic unwrap behavior.
12723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12724 if (!unwrappedObj.ref()) {
12725 return false;
12726 }
12727 }
12728 FastErrorResult rv;
12729 // NOTE: This assert does NOT call the function.
12730 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12731 MOZ_KnownLive(self)(self)->PassOptionalRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12732 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfNullableInts"
)), 0))
) {
12733 return false;
12734 }
12735 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12735; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12736 args.rval().setUndefined();
12737 return true;
12738}
12739
12740static const JSJitInfo passOptionalRecordOfNullableInts_methodinfo = {
12741 { (JSJitGetterOp)passOptionalRecordOfNullableInts },
12742 { prototypes::id::TestJSImplInterface },
12743 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12744 JSJitInfo::Method,
12745 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12746 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12747 false, /* isInfallible. False in setters. */
12748 false, /* isMovable. Not relevant for setters. */
12749 false, /* isEliminatable. Not relevant for setters. */
12750 false, /* isAlwaysInSlot. Only relevant for getters. */
12751 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12752 false, /* isTypedMethod. Only relevant for methods. */
12753 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12754};
12755
12756MOZ_CAN_RUN_SCRIPT static bool
12757passOptionalNullableRecordOfNullableInts(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12758{
12759 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts");
12760 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12763( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12761 "TestJSImplInterface", "passOptionalNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12763( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12762 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12763( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12763 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12763( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12764
12765 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12766 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12767 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12768 if (objIsXray) {
12769 unwrappedObj.emplace(cx, obj);
12770 }
12771 Optional<Nullable<Record<nsString, Nullable<int32_t>>>> arg0;
12772 if (args.hasDefined(0)) {
12773 arg0.Construct();
12774 if (args[0].isObject()) {
12775 auto& recordEntries = arg0.Value().SetValue().Entries();
12776
12777 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12778 JS::RootedVector<jsid> ids(cx);
12779 if (!js::GetPropertyKeys(cx, recordObj,
12780 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12781 return false;
12782 }
12783 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12784 JS_ReportOutOfMemory(cx);
12785 return false;
12786 }
12787 JS::Rooted<JS::Value> propNameValue(cx);
12788 JS::Rooted<JS::Value> temp(cx);
12789 JS::Rooted<jsid> curId(cx);
12790 JS::Rooted<JS::Value> idVal(cx);
12791 // Use a hashset to keep track of ids seen, to avoid
12792 // introducing nasty O(N^2) behavior scanning for them all the
12793 // time. Ideally we'd use a data structure with O(1) lookup
12794 // _and_ ordering for the MozMap, but we don't have one lying
12795 // around.
12796 nsTHashtable<nsStringHashKey> idsSeen;
12797 for (size_t i = 0; i < ids.length(); ++i) {
12798 curId = ids[i];
12799
12800 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12801 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12802 &desc)) {
12803 return false;
12804 }
12805
12806 if (desc.isNothing() || !desc->enumerable()) {
12807 continue;
12808 }
12809
12810 idVal = js::IdToValue(curId);
12811 nsString propName;
12812 // This will just throw if idVal is a Symbol, like the spec says
12813 // to do.
12814 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12815 return false;
12816 }
12817
12818 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12819 return false;
12820 }
12821
12822 Record<nsString, Nullable<int32_t>>::EntryType* entry;
12823 if (!idsSeen.EnsureInserted(propName)) {
12824 // Find the existing entry.
12825 auto idx = recordEntries.IndexOf(propName);
12826 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12827); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12827; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12827 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12827); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12827; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12828 // Now blow it away to make it look like it was just added
12829 // to the array, because it's not obvious that it's
12830 // safe to write to its already-initialized mValue via our
12831 // normal codegen conversions. For example, the value
12832 // could be a union and this would change its type, but
12833 // codegen assumes we won't do that.
12834 entry = recordEntries.ReconstructElementAt(idx);
12835 } else {
12836 // Safe to do an infallible append here, because we did a
12837 // SetCapacity above to the right capacity.
12838 entry = recordEntries.AppendElement();
12839 }
12840 entry->mKey = propName;
12841 Nullable<int32_t>& slot = entry->mValue;
12842 if (temp.isNullOrUndefined()) {
12843 slot.SetNull();
12844 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot.SetValue())) {
12845 return false;
12846 }
12847 }
12848 } else if (args[0].isNullOrUndefined()) {
12849 arg0.Value().SetNull();
12850 } else {
12851 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12852 return false;
12853 }
12854 }
12855 if (objIsXray) {
12856 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12857 // we know Xrays have no dynamic unwrap behavior.
12858 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
12859 if (!unwrappedObj.ref()) {
12860 return false;
12861 }
12862 }
12863 FastErrorResult rv;
12864 // NOTE: This assert does NOT call the function.
12865 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
12866 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableInts(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
12867 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts"
)), 0))
) {
12868 return false;
12869 }
12870 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 12870); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 12870; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
12871 args.rval().setUndefined();
12872 return true;
12873}
12874
12875static const JSJitInfo passOptionalNullableRecordOfNullableInts_methodinfo = {
12876 { (JSJitGetterOp)passOptionalNullableRecordOfNullableInts },
12877 { prototypes::id::TestJSImplInterface },
12878 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
12879 JSJitInfo::Method,
12880 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
12881 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
12882 false, /* isInfallible. False in setters. */
12883 false, /* isMovable. Not relevant for setters. */
12884 false, /* isEliminatable. Not relevant for setters. */
12885 false, /* isAlwaysInSlot. Only relevant for getters. */
12886 false, /* isLazilyCachedInSlot. Only relevant for getters. */
12887 false, /* isTypedMethod. Only relevant for methods. */
12888 0 /* Reserved slot index, if we're stored in a slot, else 0. */
12889};
12890
12891MOZ_CAN_RUN_SCRIPT static bool
12892passCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
12893{
12894 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectRecord");
12895 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject12898( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12896 "TestJSImplInterface", "passCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject12898( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12897 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject12898( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
12898 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject12898( cx, "TestJSImplInterface"
, "passCastableObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
12899
12900 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
12901 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectRecord", 1)) {
12902 return false;
12903 }
12904 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
12905 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
12906 if (objIsXray) {
12907 unwrappedObj.emplace(cx, obj);
12908 }
12909 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>> arg0;
12910 if (args[0].isObject()) {
12911 auto& recordEntries = arg0.Entries();
12912
12913 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
12914 JS::RootedVector<jsid> ids(cx);
12915 if (!js::GetPropertyKeys(cx, recordObj,
12916 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
12917 return false;
12918 }
12919 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
12920 JS_ReportOutOfMemory(cx);
12921 return false;
12922 }
12923 JS::Rooted<JS::Value> propNameValue(cx);
12924 JS::Rooted<JS::Value> temp(cx);
12925 JS::Rooted<jsid> curId(cx);
12926 JS::Rooted<JS::Value> idVal(cx);
12927 // Use a hashset to keep track of ids seen, to avoid
12928 // introducing nasty O(N^2) behavior scanning for them all the
12929 // time. Ideally we'd use a data structure with O(1) lookup
12930 // _and_ ordering for the MozMap, but we don't have one lying
12931 // around.
12932 nsTHashtable<nsStringHashKey> idsSeen;
12933 for (size_t i = 0; i < ids.length(); ++i) {
12934 curId = ids[i];
12935
12936 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
12937 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
12938 &desc)) {
12939 return false;
12940 }
12941
12942 if (desc.isNothing() || !desc->enumerable()) {
12943 continue;
12944 }
12945
12946 idVal = js::IdToValue(curId);
12947 nsString propName;
12948 // This will just throw if idVal is a Symbol, like the spec says
12949 // to do.
12950 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
12951 return false;
12952 }
12953
12954 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
12955 return false;
12956 }
12957
12958 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
12959 if (!idsSeen.EnsureInserted(propName)) {
12960 // Find the existing entry.
12961 auto idx = recordEntries.IndexOf(propName);
12962 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12963); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12963; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
12963 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 12963); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 12963; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
12964 // Now blow it away to make it look like it was just added
12965 // to the array, because it's not obvious that it's
12966 // safe to write to its already-initialized mValue via our
12967 // normal codegen conversions. For example, the value
12968 // could be a union and this would change its type, but
12969 // codegen assumes we won't do that.
12970 entry = recordEntries.ReconstructElementAt(idx);
12971 } else {
12972 // Safe to do an infallible append here, because we did a
12973 // SetCapacity above to the right capacity.
12974 entry = recordEntries.AppendElement();
12975 }
12976 entry->mKey = propName;
12977 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
12978 if (temp.isObject()) {
12979 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
12980 {
12981 // Our JSContext should be in the right global to do unwrapping in.
12982 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
12983 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
12984 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
12985 return false;
12986 }
12987 }
12988 } else {
12989 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
12990 return false;
12991 }
12992 }
12993 } else {
12994 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
12995 return false;
12996 }
12997 if (objIsXray) {
12998 // Since our object is an Xray, we can just CheckedUnwrapStatic:
12999 // we know Xrays have no dynamic unwrap behavior.
13000 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13001 if (!unwrappedObj.ref()) {
13002 return false;
13003 }
13004 }
13005 FastErrorResult rv;
13006 // NOTE: This assert does NOT call the function.
13007 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13008 MOZ_KnownLive(self)(self)->PassCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13009 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectRecord"
)), 0))
) {
13010 return false;
13011 }
13012 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13012); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13012; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13013 args.rval().setUndefined();
13014 return true;
13015}
13016
13017static const JSJitInfo passCastableObjectRecord_methodinfo = {
13018 { (JSJitGetterOp)passCastableObjectRecord },
13019 { prototypes::id::TestJSImplInterface },
13020 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13021 JSJitInfo::Method,
13022 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13023 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13024 false, /* isInfallible. False in setters. */
13025 false, /* isMovable. Not relevant for setters. */
13026 false, /* isEliminatable. Not relevant for setters. */
13027 false, /* isAlwaysInSlot. Only relevant for getters. */
13028 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13029 false, /* isTypedMethod. Only relevant for methods. */
13030 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13031};
13032
13033MOZ_CAN_RUN_SCRIPT static bool
13034passNullableCastableObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13035{
13036 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectRecord");
13037 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13040( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13038 "TestJSImplInterface", "passNullableCastableObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13040( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13039 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13040( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13040 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13040( cx, "TestJSImplInterface"
, "passNullableCastableObjectRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13041
13042 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13043 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectRecord", 1)) {
13044 return false;
13045 }
13046 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13047 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13048 if (objIsXray) {
13049 unwrappedObj.emplace(cx, obj);
13050 }
13051 Record<nsString, RefPtr<mozilla::dom::TestInterface>> arg0;
13052 if (args[0].isObject()) {
13053 auto& recordEntries = arg0.Entries();
13054
13055 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13056 JS::RootedVector<jsid> ids(cx);
13057 if (!js::GetPropertyKeys(cx, recordObj,
13058 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13059 return false;
13060 }
13061 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13062 JS_ReportOutOfMemory(cx);
13063 return false;
13064 }
13065 JS::Rooted<JS::Value> propNameValue(cx);
13066 JS::Rooted<JS::Value> temp(cx);
13067 JS::Rooted<jsid> curId(cx);
13068 JS::Rooted<JS::Value> idVal(cx);
13069 // Use a hashset to keep track of ids seen, to avoid
13070 // introducing nasty O(N^2) behavior scanning for them all the
13071 // time. Ideally we'd use a data structure with O(1) lookup
13072 // _and_ ordering for the MozMap, but we don't have one lying
13073 // around.
13074 nsTHashtable<nsStringHashKey> idsSeen;
13075 for (size_t i = 0; i < ids.length(); ++i) {
13076 curId = ids[i];
13077
13078 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13079 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13080 &desc)) {
13081 return false;
13082 }
13083
13084 if (desc.isNothing() || !desc->enumerable()) {
13085 continue;
13086 }
13087
13088 idVal = js::IdToValue(curId);
13089 nsString propName;
13090 // This will just throw if idVal is a Symbol, like the spec says
13091 // to do.
13092 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13093 return false;
13094 }
13095
13096 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13097 return false;
13098 }
13099
13100 Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry;
13101 if (!idsSeen.EnsureInserted(propName)) {
13102 // Find the existing entry.
13103 auto idx = recordEntries.IndexOf(propName);
13104 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13105); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13105; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13105 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13105); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13105; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13106 // Now blow it away to make it look like it was just added
13107 // to the array, because it's not obvious that it's
13108 // safe to write to its already-initialized mValue via our
13109 // normal codegen conversions. For example, the value
13110 // could be a union and this would change its type, but
13111 // codegen assumes we won't do that.
13112 entry = recordEntries.ReconstructElementAt(idx);
13113 } else {
13114 // Safe to do an infallible append here, because we did a
13115 // SetCapacity above to the right capacity.
13116 entry = recordEntries.AppendElement();
13117 }
13118 entry->mKey = propName;
13119 RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue;
13120 if (temp.isObject()) {
13121 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13122 {
13123 // Our JSContext should be in the right global to do unwrapping in.
13124 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13125 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13126 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13127 return false;
13128 }
13129 }
13130 } else if (temp.isNullOrUndefined()) {
13131 slot = nullptr;
13132 } else {
13133 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13134 return false;
13135 }
13136 }
13137 } else {
13138 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13139 return false;
13140 }
13141 if (objIsXray) {
13142 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13143 // we know Xrays have no dynamic unwrap behavior.
13144 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13145 if (!unwrappedObj.ref()) {
13146 return false;
13147 }
13148 }
13149 FastErrorResult rv;
13150 // NOTE: This assert does NOT call the function.
13151 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13152 MOZ_KnownLive(self)(self)->PassNullableCastableObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectRecord"
)), 0))
) {
13154 return false;
13155 }
13156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13156; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13157 args.rval().setUndefined();
13158 return true;
13159}
13160
13161static const JSJitInfo passNullableCastableObjectRecord_methodinfo = {
13162 { (JSJitGetterOp)passNullableCastableObjectRecord },
13163 { prototypes::id::TestJSImplInterface },
13164 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13165 JSJitInfo::Method,
13166 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13167 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13168 false, /* isInfallible. False in setters. */
13169 false, /* isMovable. Not relevant for setters. */
13170 false, /* isEliminatable. Not relevant for setters. */
13171 false, /* isAlwaysInSlot. Only relevant for getters. */
13172 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13173 false, /* isTypedMethod. Only relevant for methods. */
13174 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13175};
13176
13177MOZ_CAN_RUN_SCRIPT static bool
13178passCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13179{
13180 BindingCallContext cx(cx_, "TestJSImplInterface.passCastableObjectNullableRecord");
13181 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13184( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13182 "TestJSImplInterface", "passCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13184( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13183 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13184( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13184 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13184( cx, "TestJSImplInterface"
, "passCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13185
13186 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13187 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCastableObjectNullableRecord", 1)) {
13188 return false;
13189 }
13190 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13191 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13192 if (objIsXray) {
13193 unwrappedObj.emplace(cx, obj);
13194 }
13195 Nullable<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0;
13196 if (args[0].isObject()) {
13197 auto& recordEntries = arg0.SetValue().Entries();
13198
13199 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13200 JS::RootedVector<jsid> ids(cx);
13201 if (!js::GetPropertyKeys(cx, recordObj,
13202 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13203 return false;
13204 }
13205 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13206 JS_ReportOutOfMemory(cx);
13207 return false;
13208 }
13209 JS::Rooted<JS::Value> propNameValue(cx);
13210 JS::Rooted<JS::Value> temp(cx);
13211 JS::Rooted<jsid> curId(cx);
13212 JS::Rooted<JS::Value> idVal(cx);
13213 // Use a hashset to keep track of ids seen, to avoid
13214 // introducing nasty O(N^2) behavior scanning for them all the
13215 // time. Ideally we'd use a data structure with O(1) lookup
13216 // _and_ ordering for the MozMap, but we don't have one lying
13217 // around.
13218 nsTHashtable<nsStringHashKey> idsSeen;
13219 for (size_t i = 0; i < ids.length(); ++i) {
13220 curId = ids[i];
13221
13222 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13223 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13224 &desc)) {
13225 return false;
13226 }
13227
13228 if (desc.isNothing() || !desc->enumerable()) {
13229 continue;
13230 }
13231
13232 idVal = js::IdToValue(curId);
13233 nsString propName;
13234 // This will just throw if idVal is a Symbol, like the spec says
13235 // to do.
13236 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13237 return false;
13238 }
13239
13240 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13241 return false;
13242 }
13243
13244 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
13245 if (!idsSeen.EnsureInserted(propName)) {
13246 // Find the existing entry.
13247 auto idx = recordEntries.IndexOf(propName);
13248 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13249); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13249; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13249 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13249); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13249; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13250 // Now blow it away to make it look like it was just added
13251 // to the array, because it's not obvious that it's
13252 // safe to write to its already-initialized mValue via our
13253 // normal codegen conversions. For example, the value
13254 // could be a union and this would change its type, but
13255 // codegen assumes we won't do that.
13256 entry = recordEntries.ReconstructElementAt(idx);
13257 } else {
13258 // Safe to do an infallible append here, because we did a
13259 // SetCapacity above to the right capacity.
13260 entry = recordEntries.AppendElement();
13261 }
13262 entry->mKey = propName;
13263 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
13264 if (temp.isObject()) {
13265 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13266 {
13267 // Our JSContext should be in the right global to do unwrapping in.
13268 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13269 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13270 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13271 return false;
13272 }
13273 }
13274 } else {
13275 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13276 return false;
13277 }
13278 }
13279 } else if (args[0].isNullOrUndefined()) {
13280 arg0.SetNull();
13281 } else {
13282 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13283 return false;
13284 }
13285 if (objIsXray) {
13286 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13287 // we know Xrays have no dynamic unwrap behavior.
13288 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13289 if (!unwrappedObj.ref()) {
13290 return false;
13291 }
13292 }
13293 FastErrorResult rv;
13294 // NOTE: This assert does NOT call the function.
13295 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13296 MOZ_KnownLive(self)(self)->PassCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13297 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCastableObjectNullableRecord"
)), 0))
) {
13298 return false;
13299 }
13300 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13300); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13300; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13301 args.rval().setUndefined();
13302 return true;
13303}
13304
13305static const JSJitInfo passCastableObjectNullableRecord_methodinfo = {
13306 { (JSJitGetterOp)passCastableObjectNullableRecord },
13307 { prototypes::id::TestJSImplInterface },
13308 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13309 JSJitInfo::Method,
13310 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13311 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13312 false, /* isInfallible. False in setters. */
13313 false, /* isMovable. Not relevant for setters. */
13314 false, /* isEliminatable. Not relevant for setters. */
13315 false, /* isAlwaysInSlot. Only relevant for getters. */
13316 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13317 false, /* isTypedMethod. Only relevant for methods. */
13318 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13319};
13320
13321MOZ_CAN_RUN_SCRIPT static bool
13322passNullableCastableObjectNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13323{
13324 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCastableObjectNullableRecord");
13325 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13328( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13326 "TestJSImplInterface", "passNullableCastableObjectNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13328( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13327 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13328( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13328 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13328( cx, "TestJSImplInterface"
, "passNullableCastableObjectNullableRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13329
13330 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13331 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord", 1)) {
13332 return false;
13333 }
13334 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13335 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13336 if (objIsXray) {
13337 unwrappedObj.emplace(cx, obj);
13338 }
13339 Nullable<Record<nsString, RefPtr<mozilla::dom::TestInterface>>> arg0;
13340 if (args[0].isObject()) {
13341 auto& recordEntries = arg0.SetValue().Entries();
13342
13343 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13344 JS::RootedVector<jsid> ids(cx);
13345 if (!js::GetPropertyKeys(cx, recordObj,
13346 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13347 return false;
13348 }
13349 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13350 JS_ReportOutOfMemory(cx);
13351 return false;
13352 }
13353 JS::Rooted<JS::Value> propNameValue(cx);
13354 JS::Rooted<JS::Value> temp(cx);
13355 JS::Rooted<jsid> curId(cx);
13356 JS::Rooted<JS::Value> idVal(cx);
13357 // Use a hashset to keep track of ids seen, to avoid
13358 // introducing nasty O(N^2) behavior scanning for them all the
13359 // time. Ideally we'd use a data structure with O(1) lookup
13360 // _and_ ordering for the MozMap, but we don't have one lying
13361 // around.
13362 nsTHashtable<nsStringHashKey> idsSeen;
13363 for (size_t i = 0; i < ids.length(); ++i) {
13364 curId = ids[i];
13365
13366 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13367 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13368 &desc)) {
13369 return false;
13370 }
13371
13372 if (desc.isNothing() || !desc->enumerable()) {
13373 continue;
13374 }
13375
13376 idVal = js::IdToValue(curId);
13377 nsString propName;
13378 // This will just throw if idVal is a Symbol, like the spec says
13379 // to do.
13380 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13381 return false;
13382 }
13383
13384 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13385 return false;
13386 }
13387
13388 Record<nsString, RefPtr<mozilla::dom::TestInterface>>::EntryType* entry;
13389 if (!idsSeen.EnsureInserted(propName)) {
13390 // Find the existing entry.
13391 auto idx = recordEntries.IndexOf(propName);
13392 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13393); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13393; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13393 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13393); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13393; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13394 // Now blow it away to make it look like it was just added
13395 // to the array, because it's not obvious that it's
13396 // safe to write to its already-initialized mValue via our
13397 // normal codegen conversions. For example, the value
13398 // could be a union and this would change its type, but
13399 // codegen assumes we won't do that.
13400 entry = recordEntries.ReconstructElementAt(idx);
13401 } else {
13402 // Safe to do an infallible append here, because we did a
13403 // SetCapacity above to the right capacity.
13404 entry = recordEntries.AppendElement();
13405 }
13406 entry->mKey = propName;
13407 RefPtr<mozilla::dom::TestInterface>& slot = entry->mValue;
13408 if (temp.isObject()) {
13409 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13410 {
13411 // Our JSContext should be in the right global to do unwrapping in.
13412 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13413 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13414 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13415 return false;
13416 }
13417 }
13418 } else if (temp.isNullOrUndefined()) {
13419 slot = nullptr;
13420 } else {
13421 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13422 return false;
13423 }
13424 }
13425 } else if (args[0].isNullOrUndefined()) {
13426 arg0.SetNull();
13427 } else {
13428 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13429 return false;
13430 }
13431 if (objIsXray) {
13432 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13433 // we know Xrays have no dynamic unwrap behavior.
13434 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13435 if (!unwrappedObj.ref()) {
13436 return false;
13437 }
13438 }
13439 FastErrorResult rv;
13440 // NOTE: This assert does NOT call the function.
13441 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13442 MOZ_KnownLive(self)(self)->PassNullableCastableObjectNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13443 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCastableObjectNullableRecord"
)), 0))
) {
13444 return false;
13445 }
13446 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13446; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13447 args.rval().setUndefined();
13448 return true;
13449}
13450
13451static const JSJitInfo passNullableCastableObjectNullableRecord_methodinfo = {
13452 { (JSJitGetterOp)passNullableCastableObjectNullableRecord },
13453 { prototypes::id::TestJSImplInterface },
13454 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13455 JSJitInfo::Method,
13456 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13457 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13458 false, /* isInfallible. False in setters. */
13459 false, /* isMovable. Not relevant for setters. */
13460 false, /* isEliminatable. Not relevant for setters. */
13461 false, /* isAlwaysInSlot. Only relevant for getters. */
13462 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13463 false, /* isTypedMethod. Only relevant for methods. */
13464 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13465};
13466
13467MOZ_CAN_RUN_SCRIPT static bool
13468passOptionalRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13469{
13470 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecord");
13471 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13474( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13472 "TestJSImplInterface", "passOptionalRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13474( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13473 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13474( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
13474 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13474( cx, "TestJSImplInterface"
, "passOptionalRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
13475
13476 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13477 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13478 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13479 if (objIsXray) {
13480 unwrappedObj.emplace(cx, obj);
13481 }
13482 Optional<Record<nsString, int32_t>> arg0;
13483 if (args.hasDefined(0)) {
13484 arg0.Construct();
13485 if (args[0].isObject()) {
13486 auto& recordEntries = arg0.Value().Entries();
13487
13488 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13489 JS::RootedVector<jsid> ids(cx);
13490 if (!js::GetPropertyKeys(cx, recordObj,
13491 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13492 return false;
13493 }
13494 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13495 JS_ReportOutOfMemory(cx);
13496 return false;
13497 }
13498 JS::Rooted<JS::Value> propNameValue(cx);
13499 JS::Rooted<JS::Value> temp(cx);
13500 JS::Rooted<jsid> curId(cx);
13501 JS::Rooted<JS::Value> idVal(cx);
13502 // Use a hashset to keep track of ids seen, to avoid
13503 // introducing nasty O(N^2) behavior scanning for them all the
13504 // time. Ideally we'd use a data structure with O(1) lookup
13505 // _and_ ordering for the MozMap, but we don't have one lying
13506 // around.
13507 nsTHashtable<nsStringHashKey> idsSeen;
13508 for (size_t i = 0; i < ids.length(); ++i) {
13509 curId = ids[i];
13510
13511 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13512 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13513 &desc)) {
13514 return false;
13515 }
13516
13517 if (desc.isNothing() || !desc->enumerable()) {
13518 continue;
13519 }
13520
13521 idVal = js::IdToValue(curId);
13522 nsString propName;
13523 // This will just throw if idVal is a Symbol, like the spec says
13524 // to do.
13525 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13526 return false;
13527 }
13528
13529 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13530 return false;
13531 }
13532
13533 Record<nsString, int32_t>::EntryType* entry;
13534 if (!idsSeen.EnsureInserted(propName)) {
13535 // Find the existing entry.
13536 auto idx = recordEntries.IndexOf(propName);
13537 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13538; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13538 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13538; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13539 // Now blow it away to make it look like it was just added
13540 // to the array, because it's not obvious that it's
13541 // safe to write to its already-initialized mValue via our
13542 // normal codegen conversions. For example, the value
13543 // could be a union and this would change its type, but
13544 // codegen assumes we won't do that.
13545 entry = recordEntries.ReconstructElementAt(idx);
13546 } else {
13547 // Safe to do an infallible append here, because we did a
13548 // SetCapacity above to the right capacity.
13549 entry = recordEntries.AppendElement();
13550 }
13551 entry->mKey = propName;
13552 int32_t& slot = entry->mValue;
13553 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13554 return false;
13555 }
13556 }
13557 } else {
13558 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13559 return false;
13560 }
13561 }
13562 if (objIsXray) {
13563 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13564 // we know Xrays have no dynamic unwrap behavior.
13565 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13566 if (!unwrappedObj.ref()) {
13567 return false;
13568 }
13569 }
13570 FastErrorResult rv;
13571 // NOTE: This assert does NOT call the function.
13572 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13573 MOZ_KnownLive(self)(self)->PassOptionalRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13574 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecord"
)), 0))
) {
13575 return false;
13576 }
13577 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13577); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13577; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13578 args.rval().setUndefined();
13579 return true;
13580}
13581
13582static const JSJitInfo passOptionalRecord_methodinfo = {
13583 { (JSJitGetterOp)passOptionalRecord },
13584 { prototypes::id::TestJSImplInterface },
13585 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13586 JSJitInfo::Method,
13587 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13588 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13589 false, /* isInfallible. False in setters. */
13590 false, /* isMovable. Not relevant for setters. */
13591 false, /* isEliminatable. Not relevant for setters. */
13592 false, /* isAlwaysInSlot. Only relevant for getters. */
13593 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13594 false, /* isTypedMethod. Only relevant for methods. */
13595 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13596};
13597
13598MOZ_CAN_RUN_SCRIPT static bool
13599passOptionalNullableRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13600{
13601 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecord");
13602 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13605( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13603 "TestJSImplInterface", "passOptionalNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13605( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13604 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13605( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13605 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13605( cx, "TestJSImplInterface"
, "passOptionalNullableRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13606
13607 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13608 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13609 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13610 if (objIsXray) {
13611 unwrappedObj.emplace(cx, obj);
13612 }
13613 Optional<Nullable<Record<nsString, int32_t>>> arg0;
13614 if (args.hasDefined(0)) {
13615 arg0.Construct();
13616 if (args[0].isObject()) {
13617 auto& recordEntries = arg0.Value().SetValue().Entries();
13618
13619 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13620 JS::RootedVector<jsid> ids(cx);
13621 if (!js::GetPropertyKeys(cx, recordObj,
13622 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13623 return false;
13624 }
13625 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13626 JS_ReportOutOfMemory(cx);
13627 return false;
13628 }
13629 JS::Rooted<JS::Value> propNameValue(cx);
13630 JS::Rooted<JS::Value> temp(cx);
13631 JS::Rooted<jsid> curId(cx);
13632 JS::Rooted<JS::Value> idVal(cx);
13633 // Use a hashset to keep track of ids seen, to avoid
13634 // introducing nasty O(N^2) behavior scanning for them all the
13635 // time. Ideally we'd use a data structure with O(1) lookup
13636 // _and_ ordering for the MozMap, but we don't have one lying
13637 // around.
13638 nsTHashtable<nsStringHashKey> idsSeen;
13639 for (size_t i = 0; i < ids.length(); ++i) {
13640 curId = ids[i];
13641
13642 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13643 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13644 &desc)) {
13645 return false;
13646 }
13647
13648 if (desc.isNothing() || !desc->enumerable()) {
13649 continue;
13650 }
13651
13652 idVal = js::IdToValue(curId);
13653 nsString propName;
13654 // This will just throw if idVal is a Symbol, like the spec says
13655 // to do.
13656 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13657 return false;
13658 }
13659
13660 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13661 return false;
13662 }
13663
13664 Record<nsString, int32_t>::EntryType* entry;
13665 if (!idsSeen.EnsureInserted(propName)) {
13666 // Find the existing entry.
13667 auto idx = recordEntries.IndexOf(propName);
13668 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13669); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13669; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13669 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13669); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13669; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13670 // Now blow it away to make it look like it was just added
13671 // to the array, because it's not obvious that it's
13672 // safe to write to its already-initialized mValue via our
13673 // normal codegen conversions. For example, the value
13674 // could be a union and this would change its type, but
13675 // codegen assumes we won't do that.
13676 entry = recordEntries.ReconstructElementAt(idx);
13677 } else {
13678 // Safe to do an infallible append here, because we did a
13679 // SetCapacity above to the right capacity.
13680 entry = recordEntries.AppendElement();
13681 }
13682 entry->mKey = propName;
13683 int32_t& slot = entry->mValue;
13684 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13685 return false;
13686 }
13687 }
13688 } else if (args[0].isNullOrUndefined()) {
13689 arg0.Value().SetNull();
13690 } else {
13691 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13692 return false;
13693 }
13694 }
13695 if (objIsXray) {
13696 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13697 // we know Xrays have no dynamic unwrap behavior.
13698 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13699 if (!unwrappedObj.ref()) {
13700 return false;
13701 }
13702 }
13703 FastErrorResult rv;
13704 // NOTE: This assert does NOT call the function.
13705 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13706 MOZ_KnownLive(self)(self)->PassOptionalNullableRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13707 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecord"
)), 0))
) {
13708 return false;
13709 }
13710 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13710); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13710; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13711 args.rval().setUndefined();
13712 return true;
13713}
13714
13715static const JSJitInfo passOptionalNullableRecord_methodinfo = {
13716 { (JSJitGetterOp)passOptionalNullableRecord },
13717 { prototypes::id::TestJSImplInterface },
13718 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13719 JSJitInfo::Method,
13720 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13721 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13722 false, /* isInfallible. False in setters. */
13723 false, /* isMovable. Not relevant for setters. */
13724 false, /* isEliminatable. Not relevant for setters. */
13725 false, /* isAlwaysInSlot. Only relevant for getters. */
13726 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13727 false, /* isTypedMethod. Only relevant for methods. */
13728 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13729};
13730
13731MOZ_CAN_RUN_SCRIPT static bool
13732passOptionalNullableRecordWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13733{
13734 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue");
13735 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13738( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13736 "TestJSImplInterface", "passOptionalNullableRecordWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13738( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13737 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13738( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13738 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13738( cx, "TestJSImplInterface"
, "passOptionalNullableRecordWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13739
13740 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13741 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13742 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13743 if (objIsXray) {
13744 unwrappedObj.emplace(cx, obj);
13745 }
13746 Nullable<Record<nsString, int32_t>> arg0;
13747 if (args.hasDefined(0)) {
13748 if (args[0].isObject()) {
13749 auto& recordEntries = arg0.SetValue().Entries();
13750
13751 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13752 JS::RootedVector<jsid> ids(cx);
13753 if (!js::GetPropertyKeys(cx, recordObj,
13754 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13755 return false;
13756 }
13757 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13758 JS_ReportOutOfMemory(cx);
13759 return false;
13760 }
13761 JS::Rooted<JS::Value> propNameValue(cx);
13762 JS::Rooted<JS::Value> temp(cx);
13763 JS::Rooted<jsid> curId(cx);
13764 JS::Rooted<JS::Value> idVal(cx);
13765 // Use a hashset to keep track of ids seen, to avoid
13766 // introducing nasty O(N^2) behavior scanning for them all the
13767 // time. Ideally we'd use a data structure with O(1) lookup
13768 // _and_ ordering for the MozMap, but we don't have one lying
13769 // around.
13770 nsTHashtable<nsStringHashKey> idsSeen;
13771 for (size_t i = 0; i < ids.length(); ++i) {
13772 curId = ids[i];
13773
13774 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13775 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13776 &desc)) {
13777 return false;
13778 }
13779
13780 if (desc.isNothing() || !desc->enumerable()) {
13781 continue;
13782 }
13783
13784 idVal = js::IdToValue(curId);
13785 nsString propName;
13786 // This will just throw if idVal is a Symbol, like the spec says
13787 // to do.
13788 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13789 return false;
13790 }
13791
13792 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13793 return false;
13794 }
13795
13796 Record<nsString, int32_t>::EntryType* entry;
13797 if (!idsSeen.EnsureInserted(propName)) {
13798 // Find the existing entry.
13799 auto idx = recordEntries.IndexOf(propName);
13800 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13801); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13801; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13801 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13801); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13801; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13802 // Now blow it away to make it look like it was just added
13803 // to the array, because it's not obvious that it's
13804 // safe to write to its already-initialized mValue via our
13805 // normal codegen conversions. For example, the value
13806 // could be a union and this would change its type, but
13807 // codegen assumes we won't do that.
13808 entry = recordEntries.ReconstructElementAt(idx);
13809 } else {
13810 // Safe to do an infallible append here, because we did a
13811 // SetCapacity above to the right capacity.
13812 entry = recordEntries.AppendElement();
13813 }
13814 entry->mKey = propName;
13815 int32_t& slot = entry->mValue;
13816 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
13817 return false;
13818 }
13819 }
13820 } else if (args[0].isNullOrUndefined()) {
13821 arg0.SetNull();
13822 } else {
13823 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13824 return false;
13825 }
13826 } else {
13827 arg0.SetNull();
13828 }
13829 if (objIsXray) {
13830 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13831 // we know Xrays have no dynamic unwrap behavior.
13832 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13833 if (!unwrappedObj.ref()) {
13834 return false;
13835 }
13836 }
13837 FastErrorResult rv;
13838 // NOTE: This assert does NOT call the function.
13839 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13840 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13841 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue"
)), 0))
) {
13842 return false;
13843 }
13844 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13844); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13844; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13845 args.rval().setUndefined();
13846 return true;
13847}
13848
13849static const JSJitInfo passOptionalNullableRecordWithDefaultValue_methodinfo = {
13850 { (JSJitGetterOp)passOptionalNullableRecordWithDefaultValue },
13851 { prototypes::id::TestJSImplInterface },
13852 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13853 JSJitInfo::Method,
13854 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13855 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13856 false, /* isInfallible. False in setters. */
13857 false, /* isMovable. Not relevant for setters. */
13858 false, /* isEliminatable. Not relevant for setters. */
13859 false, /* isAlwaysInSlot. Only relevant for getters. */
13860 false, /* isLazilyCachedInSlot. Only relevant for getters. */
13861 false, /* isTypedMethod. Only relevant for methods. */
13862 0 /* Reserved slot index, if we're stored in a slot, else 0. */
13863};
13864
13865MOZ_CAN_RUN_SCRIPT static bool
13866passOptionalObjectRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
13867{
13868 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObjectRecord");
13869 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject13872( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13870 "TestJSImplInterface", "passOptionalObjectRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject13872( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13871 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject13872( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
13872 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject13872( cx, "TestJSImplInterface"
, "passOptionalObjectRecord", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
13873
13874 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
13875 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
13876 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
13877 if (objIsXray) {
13878 unwrappedObj.emplace(cx, obj);
13879 }
13880 Optional<Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>> arg0;
13881 if (args.hasDefined(0)) {
13882 arg0.Construct();
13883 if (args[0].isObject()) {
13884 auto& recordEntries = arg0.Value().Entries();
13885
13886 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
13887 JS::RootedVector<jsid> ids(cx);
13888 if (!js::GetPropertyKeys(cx, recordObj,
13889 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
13890 return false;
13891 }
13892 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
13893 JS_ReportOutOfMemory(cx);
13894 return false;
13895 }
13896 JS::Rooted<JS::Value> propNameValue(cx);
13897 JS::Rooted<JS::Value> temp(cx);
13898 JS::Rooted<jsid> curId(cx);
13899 JS::Rooted<JS::Value> idVal(cx);
13900 // Use a hashset to keep track of ids seen, to avoid
13901 // introducing nasty O(N^2) behavior scanning for them all the
13902 // time. Ideally we'd use a data structure with O(1) lookup
13903 // _and_ ordering for the MozMap, but we don't have one lying
13904 // around.
13905 nsTHashtable<nsStringHashKey> idsSeen;
13906 for (size_t i = 0; i < ids.length(); ++i) {
13907 curId = ids[i];
13908
13909 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
13910 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
13911 &desc)) {
13912 return false;
13913 }
13914
13915 if (desc.isNothing() || !desc->enumerable()) {
13916 continue;
13917 }
13918
13919 idVal = js::IdToValue(curId);
13920 nsString propName;
13921 // This will just throw if idVal is a Symbol, like the spec says
13922 // to do.
13923 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
13924 return false;
13925 }
13926
13927 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
13928 return false;
13929 }
13930
13931 Record<nsString, OwningNonNull<mozilla::dom::TestInterface>>::EntryType* entry;
13932 if (!idsSeen.EnsureInserted(propName)) {
13933 // Find the existing entry.
13934 auto idx = recordEntries.IndexOf(propName);
13935 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13936); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13936; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
13936 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 13936); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 13936; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
13937 // Now blow it away to make it look like it was just added
13938 // to the array, because it's not obvious that it's
13939 // safe to write to its already-initialized mValue via our
13940 // normal codegen conversions. For example, the value
13941 // could be a union and this would change its type, but
13942 // codegen assumes we won't do that.
13943 entry = recordEntries.ReconstructElementAt(idx);
13944 } else {
13945 // Safe to do an infallible append here, because we did a
13946 // SetCapacity above to the right capacity.
13947 entry = recordEntries.AppendElement();
13948 }
13949 entry->mKey = propName;
13950 OwningNonNull<mozilla::dom::TestInterface>& slot = entry->mValue;
13951 if (temp.isObject()) {
13952 static_assert(IsRefcounted<mozilla::dom::TestInterface>::value, "We can only store refcounted classes.");
13953 {
13954 // Our JSContext should be in the right global to do unwrapping in.
13955 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(&temp, slot, cx);
13956 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
13957 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestInterface");
13958 return false;
13959 }
13960 }
13961 } else {
13962 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
13963 return false;
13964 }
13965 }
13966 } else {
13967 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
13968 return false;
13969 }
13970 }
13971 if (objIsXray) {
13972 // Since our object is an Xray, we can just CheckedUnwrapStatic:
13973 // we know Xrays have no dynamic unwrap behavior.
13974 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
13975 if (!unwrappedObj.ref()) {
13976 return false;
13977 }
13978 }
13979 FastErrorResult rv;
13980 // NOTE: This assert does NOT call the function.
13981 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
13982 MOZ_KnownLive(self)(self)->PassOptionalObjectRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
13983 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObjectRecord"
)), 0))
) {
13984 return false;
13985 }
13986 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 13986); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 13986; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
13987 args.rval().setUndefined();
13988 return true;
13989}
13990
13991static const JSJitInfo passOptionalObjectRecord_methodinfo = {
13992 { (JSJitGetterOp)passOptionalObjectRecord },
13993 { prototypes::id::TestJSImplInterface },
13994 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
13995 JSJitInfo::Method,
13996 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
13997 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
13998 false, /* isInfallible. False in setters. */
13999 false, /* isMovable. Not relevant for setters. */
14000 false, /* isEliminatable. Not relevant for setters. */
14001 false, /* isAlwaysInSlot. Only relevant for getters. */
14002 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14003 false, /* isTypedMethod. Only relevant for methods. */
14004 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14005};
14006
14007MOZ_CAN_RUN_SCRIPT static bool
14008passExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14009{
14010 BindingCallContext cx(cx_, "TestJSImplInterface.passExternalInterfaceRecord");
14011 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14014( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14012 "TestJSImplInterface", "passExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14014( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14013 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14014( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14014 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14014( cx, "TestJSImplInterface"
, "passExternalInterfaceRecord", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
14015
14016 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14017 if (!args.requireAtLeast(cx, "TestJSImplInterface.passExternalInterfaceRecord", 1)) {
14018 return false;
14019 }
14020 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14021 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14022 if (objIsXray) {
14023 unwrappedObj.emplace(cx, obj);
14024 }
14025 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0;
14026 if (args[0].isObject()) {
14027 auto& recordEntries = arg0.Entries();
14028
14029 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14030 JS::RootedVector<jsid> ids(cx);
14031 if (!js::GetPropertyKeys(cx, recordObj,
14032 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14033 return false;
14034 }
14035 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14036 JS_ReportOutOfMemory(cx);
14037 return false;
14038 }
14039 JS::Rooted<JS::Value> propNameValue(cx);
14040 JS::Rooted<JS::Value> temp(cx);
14041 JS::Rooted<jsid> curId(cx);
14042 JS::Rooted<JS::Value> idVal(cx);
14043 // Use a hashset to keep track of ids seen, to avoid
14044 // introducing nasty O(N^2) behavior scanning for them all the
14045 // time. Ideally we'd use a data structure with O(1) lookup
14046 // _and_ ordering for the MozMap, but we don't have one lying
14047 // around.
14048 nsTHashtable<nsStringHashKey> idsSeen;
14049 for (size_t i = 0; i < ids.length(); ++i) {
14050 curId = ids[i];
14051
14052 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14053 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14054 &desc)) {
14055 return false;
14056 }
14057
14058 if (desc.isNothing() || !desc->enumerable()) {
14059 continue;
14060 }
14061
14062 idVal = js::IdToValue(curId);
14063 nsString propName;
14064 // This will just throw if idVal is a Symbol, like the spec says
14065 // to do.
14066 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14067 return false;
14068 }
14069
14070 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14071 return false;
14072 }
14073
14074 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry;
14075 if (!idsSeen.EnsureInserted(propName)) {
14076 // Find the existing entry.
14077 auto idx = recordEntries.IndexOf(propName);
14078 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14079); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14079; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14079 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14079); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14079; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14080 // Now blow it away to make it look like it was just added
14081 // to the array, because it's not obvious that it's
14082 // safe to write to its already-initialized mValue via our
14083 // normal codegen conversions. For example, the value
14084 // could be a union and this would change its type, but
14085 // codegen assumes we won't do that.
14086 entry = recordEntries.ReconstructElementAt(idx);
14087 } else {
14088 // Safe to do an infallible append here, because we did a
14089 // SetCapacity above to the right capacity.
14090 entry = recordEntries.AppendElement();
14091 }
14092 entry->mKey = propName;
14093 RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue;
14094 if (temp.isObject()) {
14095 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
14096 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
14097 JS::Rooted<JSObject*> source(cx, &temp.toObject());
14098 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder
)))), 0)))
) {
14099 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface");
14100 return false;
14101 }
14102 MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tempHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestJSImplGenBinding.cpp"
, 14102); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { *((volatile int*)__null) = 14102; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14103 slot = tempHolder;
14104 } else {
14105 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14106 return false;
14107 }
14108 }
14109 } else {
14110 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14111 return false;
14112 }
14113 if (objIsXray) {
14114 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14115 // we know Xrays have no dynamic unwrap behavior.
14116 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14117 if (!unwrappedObj.ref()) {
14118 return false;
14119 }
14120 }
14121 FastErrorResult rv;
14122 // NOTE: This assert does NOT call the function.
14123 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14124 MOZ_KnownLive(self)(self)->PassExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14125 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passExternalInterfaceRecord"
)), 0))
) {
14126 return false;
14127 }
14128 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14128; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14129 args.rval().setUndefined();
14130 return true;
14131}
14132
14133static const JSJitInfo passExternalInterfaceRecord_methodinfo = {
14134 { (JSJitGetterOp)passExternalInterfaceRecord },
14135 { prototypes::id::TestJSImplInterface },
14136 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14137 JSJitInfo::Method,
14138 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14139 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14140 false, /* isInfallible. False in setters. */
14141 false, /* isMovable. Not relevant for setters. */
14142 false, /* isEliminatable. Not relevant for setters. */
14143 false, /* isAlwaysInSlot. Only relevant for getters. */
14144 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14145 false, /* isTypedMethod. Only relevant for methods. */
14146 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14147};
14148
14149MOZ_CAN_RUN_SCRIPT static bool
14150passNullableExternalInterfaceRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14151{
14152 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableExternalInterfaceRecord");
14153 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14156( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14154 "TestJSImplInterface", "passNullableExternalInterfaceRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14156( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14155 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14156( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
14156 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14156( cx, "TestJSImplInterface"
, "passNullableExternalInterfaceRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
14157
14158 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14159 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord", 1)) {
14160 return false;
14161 }
14162 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14163 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14164 if (objIsXray) {
14165 unwrappedObj.emplace(cx, obj);
14166 }
14167 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>> arg0;
14168 if (args[0].isObject()) {
14169 auto& recordEntries = arg0.Entries();
14170
14171 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14172 JS::RootedVector<jsid> ids(cx);
14173 if (!js::GetPropertyKeys(cx, recordObj,
14174 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14175 return false;
14176 }
14177 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14178 JS_ReportOutOfMemory(cx);
14179 return false;
14180 }
14181 JS::Rooted<JS::Value> propNameValue(cx);
14182 JS::Rooted<JS::Value> temp(cx);
14183 JS::Rooted<jsid> curId(cx);
14184 JS::Rooted<JS::Value> idVal(cx);
14185 // Use a hashset to keep track of ids seen, to avoid
14186 // introducing nasty O(N^2) behavior scanning for them all the
14187 // time. Ideally we'd use a data structure with O(1) lookup
14188 // _and_ ordering for the MozMap, but we don't have one lying
14189 // around.
14190 nsTHashtable<nsStringHashKey> idsSeen;
14191 for (size_t i = 0; i < ids.length(); ++i) {
14192 curId = ids[i];
14193
14194 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14195 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14196 &desc)) {
14197 return false;
14198 }
14199
14200 if (desc.isNothing() || !desc->enumerable()) {
14201 continue;
14202 }
14203
14204 idVal = js::IdToValue(curId);
14205 nsString propName;
14206 // This will just throw if idVal is a Symbol, like the spec says
14207 // to do.
14208 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14209 return false;
14210 }
14211
14212 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14213 return false;
14214 }
14215
14216 Record<nsString, RefPtr<mozilla::dom::TestExternalInterface>>::EntryType* entry;
14217 if (!idsSeen.EnsureInserted(propName)) {
14218 // Find the existing entry.
14219 auto idx = recordEntries.IndexOf(propName);
14220 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14221); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14221; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14221 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14221); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14221; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14222 // Now blow it away to make it look like it was just added
14223 // to the array, because it's not obvious that it's
14224 // safe to write to its already-initialized mValue via our
14225 // normal codegen conversions. For example, the value
14226 // could be a union and this would change its type, but
14227 // codegen assumes we won't do that.
14228 entry = recordEntries.ReconstructElementAt(idx);
14229 } else {
14230 // Safe to do an infallible append here, because we did a
14231 // SetCapacity above to the right capacity.
14232 entry = recordEntries.AppendElement();
14233 }
14234 entry->mKey = propName;
14235 RefPtr<mozilla::dom::TestExternalInterface>& slot = entry->mValue;
14236 if (temp.isObject()) {
14237 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
14238 RefPtr<mozilla::dom::TestExternalInterface> tempHolder;
14239 JS::Rooted<JSObject*> source(cx, &temp.toObject());
14240 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(tempHolder
)))), 0)))
) {
14241 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "TestExternalInterface");
14242 return false;
14243 }
14244 MOZ_ASSERT(tempHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(tempHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(tempHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("tempHolder", "../TestJSImplGenBinding.cpp"
, 14244); AnnotateMozCrashReason("MOZ_ASSERT" "(" "tempHolder"
")"); do { *((volatile int*)__null) = 14244; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14245 slot = tempHolder;
14246 } else if (temp.isNullOrUndefined()) {
14247 slot = nullptr;
14248 } else {
14249 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14250 return false;
14251 }
14252 }
14253 } else {
14254 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14255 return false;
14256 }
14257 if (objIsXray) {
14258 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14259 // we know Xrays have no dynamic unwrap behavior.
14260 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14261 if (!unwrappedObj.ref()) {
14262 return false;
14263 }
14264 }
14265 FastErrorResult rv;
14266 // NOTE: This assert does NOT call the function.
14267 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14268 MOZ_KnownLive(self)(self)->PassNullableExternalInterfaceRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14269 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableExternalInterfaceRecord"
)), 0))
) {
14270 return false;
14271 }
14272 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14272); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14272; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14273 args.rval().setUndefined();
14274 return true;
14275}
14276
14277static const JSJitInfo passNullableExternalInterfaceRecord_methodinfo = {
14278 { (JSJitGetterOp)passNullableExternalInterfaceRecord },
14279 { prototypes::id::TestJSImplInterface },
14280 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14281 JSJitInfo::Method,
14282 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14283 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14284 false, /* isInfallible. False in setters. */
14285 false, /* isMovable. Not relevant for setters. */
14286 false, /* isEliminatable. Not relevant for setters. */
14287 false, /* isAlwaysInSlot. Only relevant for getters. */
14288 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14289 false, /* isTypedMethod. Only relevant for methods. */
14290 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14291};
14292
14293MOZ_CAN_RUN_SCRIPT static bool
14294passStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14295{
14296 BindingCallContext cx(cx_, "TestJSImplInterface.passStringRecord");
14297 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14300( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14298 "TestJSImplInterface", "passStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14300( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14299 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14300( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14300 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14300( cx, "TestJSImplInterface"
, "passStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14301
14302 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14303 if (!args.requireAtLeast(cx, "TestJSImplInterface.passStringRecord", 1)) {
14304 return false;
14305 }
14306 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14307 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14308 if (objIsXray) {
14309 unwrappedObj.emplace(cx, obj);
14310 }
14311 Record<nsString, nsString> arg0;
14312 if (args[0].isObject()) {
14313 auto& recordEntries = arg0.Entries();
14314
14315 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14316 JS::RootedVector<jsid> ids(cx);
14317 if (!js::GetPropertyKeys(cx, recordObj,
14318 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14319 return false;
14320 }
14321 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14322 JS_ReportOutOfMemory(cx);
14323 return false;
14324 }
14325 JS::Rooted<JS::Value> propNameValue(cx);
14326 JS::Rooted<JS::Value> temp(cx);
14327 JS::Rooted<jsid> curId(cx);
14328 JS::Rooted<JS::Value> idVal(cx);
14329 // Use a hashset to keep track of ids seen, to avoid
14330 // introducing nasty O(N^2) behavior scanning for them all the
14331 // time. Ideally we'd use a data structure with O(1) lookup
14332 // _and_ ordering for the MozMap, but we don't have one lying
14333 // around.
14334 nsTHashtable<nsStringHashKey> idsSeen;
14335 for (size_t i = 0; i < ids.length(); ++i) {
14336 curId = ids[i];
14337
14338 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14339 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14340 &desc)) {
14341 return false;
14342 }
14343
14344 if (desc.isNothing() || !desc->enumerable()) {
14345 continue;
14346 }
14347
14348 idVal = js::IdToValue(curId);
14349 nsString propName;
14350 // This will just throw if idVal is a Symbol, like the spec says
14351 // to do.
14352 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14353 return false;
14354 }
14355
14356 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14357 return false;
14358 }
14359
14360 Record<nsString, nsString>::EntryType* entry;
14361 if (!idsSeen.EnsureInserted(propName)) {
14362 // Find the existing entry.
14363 auto idx = recordEntries.IndexOf(propName);
14364 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14365); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14365; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14365 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14365); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14365; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14366 // Now blow it away to make it look like it was just added
14367 // to the array, because it's not obvious that it's
14368 // safe to write to its already-initialized mValue via our
14369 // normal codegen conversions. For example, the value
14370 // could be a union and this would change its type, but
14371 // codegen assumes we won't do that.
14372 entry = recordEntries.ReconstructElementAt(idx);
14373 } else {
14374 // Safe to do an infallible append here, because we did a
14375 // SetCapacity above to the right capacity.
14376 entry = recordEntries.AppendElement();
14377 }
14378 entry->mKey = propName;
14379 nsString& slot = entry->mValue;
14380 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
14381 return false;
14382 }
14383 }
14384 } else {
14385 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14386 return false;
14387 }
14388 if (objIsXray) {
14389 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14390 // we know Xrays have no dynamic unwrap behavior.
14391 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14392 if (!unwrappedObj.ref()) {
14393 return false;
14394 }
14395 }
14396 FastErrorResult rv;
14397 // NOTE: This assert does NOT call the function.
14398 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14399 MOZ_KnownLive(self)(self)->PassStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14400 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passStringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passStringRecord"
)), 0))
) {
14401 return false;
14402 }
14403 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14403); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14403; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14404 args.rval().setUndefined();
14405 return true;
14406}
14407
14408static const JSJitInfo passStringRecord_methodinfo = {
14409 { (JSJitGetterOp)passStringRecord },
14410 { prototypes::id::TestJSImplInterface },
14411 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14412 JSJitInfo::Method,
14413 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14414 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14415 false, /* isInfallible. False in setters. */
14416 false, /* isMovable. Not relevant for setters. */
14417 false, /* isEliminatable. Not relevant for setters. */
14418 false, /* isAlwaysInSlot. Only relevant for getters. */
14419 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14420 false, /* isTypedMethod. Only relevant for methods. */
14421 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14422};
14423
14424MOZ_CAN_RUN_SCRIPT static bool
14425passByteStringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14426{
14427 BindingCallContext cx(cx_, "TestJSImplInterface.passByteStringRecord");
14428 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14431( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14429 "TestJSImplInterface", "passByteStringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14431( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14430 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14431( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14431 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14431( cx, "TestJSImplInterface"
, "passByteStringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14432
14433 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14434 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByteStringRecord", 1)) {
14435 return false;
14436 }
14437 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14438 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14439 if (objIsXray) {
14440 unwrappedObj.emplace(cx, obj);
14441 }
14442 Record<nsString, nsCString> arg0;
14443 if (args[0].isObject()) {
14444 auto& recordEntries = arg0.Entries();
14445
14446 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14447 JS::RootedVector<jsid> ids(cx);
14448 if (!js::GetPropertyKeys(cx, recordObj,
14449 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14450 return false;
14451 }
14452 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14453 JS_ReportOutOfMemory(cx);
14454 return false;
14455 }
14456 JS::Rooted<JS::Value> propNameValue(cx);
14457 JS::Rooted<JS::Value> temp(cx);
14458 JS::Rooted<jsid> curId(cx);
14459 JS::Rooted<JS::Value> idVal(cx);
14460 // Use a hashset to keep track of ids seen, to avoid
14461 // introducing nasty O(N^2) behavior scanning for them all the
14462 // time. Ideally we'd use a data structure with O(1) lookup
14463 // _and_ ordering for the MozMap, but we don't have one lying
14464 // around.
14465 nsTHashtable<nsStringHashKey> idsSeen;
14466 for (size_t i = 0; i < ids.length(); ++i) {
14467 curId = ids[i];
14468
14469 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14470 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14471 &desc)) {
14472 return false;
14473 }
14474
14475 if (desc.isNothing() || !desc->enumerable()) {
14476 continue;
14477 }
14478
14479 idVal = js::IdToValue(curId);
14480 nsString propName;
14481 // This will just throw if idVal is a Symbol, like the spec says
14482 // to do.
14483 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14484 return false;
14485 }
14486
14487 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14488 return false;
14489 }
14490
14491 Record<nsString, nsCString>::EntryType* entry;
14492 if (!idsSeen.EnsureInserted(propName)) {
14493 // Find the existing entry.
14494 auto idx = recordEntries.IndexOf(propName);
14495 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14496); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14496; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14496 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14496); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14496; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14497 // Now blow it away to make it look like it was just added
14498 // to the array, because it's not obvious that it's
14499 // safe to write to its already-initialized mValue via our
14500 // normal codegen conversions. For example, the value
14501 // could be a union and this would change its type, but
14502 // codegen assumes we won't do that.
14503 entry = recordEntries.ReconstructElementAt(idx);
14504 } else {
14505 // Safe to do an infallible append here, because we did a
14506 // SetCapacity above to the right capacity.
14507 entry = recordEntries.AppendElement();
14508 }
14509 entry->mKey = propName;
14510 nsCString& slot = entry->mValue;
14511 if (!ConvertJSValueToByteString(cx, temp, false, "value in argument 1", slot)) {
14512 return false;
14513 }
14514 }
14515 } else {
14516 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14517 return false;
14518 }
14519 if (objIsXray) {
14520 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14521 // we know Xrays have no dynamic unwrap behavior.
14522 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14523 if (!unwrappedObj.ref()) {
14524 return false;
14525 }
14526 }
14527 FastErrorResult rv;
14528 // NOTE: This assert does NOT call the function.
14529 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByteStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14530 MOZ_KnownLive(self)(self)->PassByteStringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14531 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteStringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteStringRecord"
)), 0))
) {
14532 return false;
14533 }
14534 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14534); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14534; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14535 args.rval().setUndefined();
14536 return true;
14537}
14538
14539static const JSJitInfo passByteStringRecord_methodinfo = {
14540 { (JSJitGetterOp)passByteStringRecord },
14541 { prototypes::id::TestJSImplInterface },
14542 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14543 JSJitInfo::Method,
14544 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14545 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14546 false, /* isInfallible. False in setters. */
14547 false, /* isMovable. Not relevant for setters. */
14548 false, /* isEliminatable. Not relevant for setters. */
14549 false, /* isAlwaysInSlot. Only relevant for getters. */
14550 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14551 false, /* isTypedMethod. Only relevant for methods. */
14552 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14553};
14554
14555MOZ_CAN_RUN_SCRIPT static bool
14556passUTF8StringRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14557{
14558 BindingCallContext cx(cx_, "TestJSImplInterface.passUTF8StringRecord");
14559 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14562( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14560 "TestJSImplInterface", "passUTF8StringRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14562( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14561 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14562( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14562 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14562( cx, "TestJSImplInterface"
, "passUTF8StringRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14563
14564 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14565 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUTF8StringRecord", 1)) {
14566 return false;
14567 }
14568 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14569 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14570 if (objIsXray) {
14571 unwrappedObj.emplace(cx, obj);
14572 }
14573 Record<nsString, nsCString> arg0;
14574 if (args[0].isObject()) {
14575 auto& recordEntries = arg0.Entries();
14576
14577 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14578 JS::RootedVector<jsid> ids(cx);
14579 if (!js::GetPropertyKeys(cx, recordObj,
14580 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14581 return false;
14582 }
14583 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14584 JS_ReportOutOfMemory(cx);
14585 return false;
14586 }
14587 JS::Rooted<JS::Value> propNameValue(cx);
14588 JS::Rooted<JS::Value> temp(cx);
14589 JS::Rooted<jsid> curId(cx);
14590 JS::Rooted<JS::Value> idVal(cx);
14591 // Use a hashset to keep track of ids seen, to avoid
14592 // introducing nasty O(N^2) behavior scanning for them all the
14593 // time. Ideally we'd use a data structure with O(1) lookup
14594 // _and_ ordering for the MozMap, but we don't have one lying
14595 // around.
14596 nsTHashtable<nsStringHashKey> idsSeen;
14597 for (size_t i = 0; i < ids.length(); ++i) {
14598 curId = ids[i];
14599
14600 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14601 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14602 &desc)) {
14603 return false;
14604 }
14605
14606 if (desc.isNothing() || !desc->enumerable()) {
14607 continue;
14608 }
14609
14610 idVal = js::IdToValue(curId);
14611 nsString propName;
14612 // This will just throw if idVal is a Symbol, like the spec says
14613 // to do.
14614 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14615 return false;
14616 }
14617
14618 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14619 return false;
14620 }
14621
14622 Record<nsString, nsCString>::EntryType* entry;
14623 if (!idsSeen.EnsureInserted(propName)) {
14624 // Find the existing entry.
14625 auto idx = recordEntries.IndexOf(propName);
14626 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14627); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14627; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14627 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14627); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14627; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14628 // Now blow it away to make it look like it was just added
14629 // to the array, because it's not obvious that it's
14630 // safe to write to its already-initialized mValue via our
14631 // normal codegen conversions. For example, the value
14632 // could be a union and this would change its type, but
14633 // codegen assumes we won't do that.
14634 entry = recordEntries.ReconstructElementAt(idx);
14635 } else {
14636 // Safe to do an infallible append here, because we did a
14637 // SetCapacity above to the right capacity.
14638 entry = recordEntries.AppendElement();
14639 }
14640 entry->mKey = propName;
14641 nsCString& slot = entry->mValue;
14642 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
14643 return false;
14644 }
14645 }
14646 } else {
14647 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14648 return false;
14649 }
14650 if (objIsXray) {
14651 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14652 // we know Xrays have no dynamic unwrap behavior.
14653 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14654 if (!unwrappedObj.ref()) {
14655 return false;
14656 }
14657 }
14658 FastErrorResult rv;
14659 // NOTE: This assert does NOT call the function.
14660 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUTF8StringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14661 MOZ_KnownLive(self)(self)->PassUTF8StringRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14662 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8StringRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8StringRecord"
)), 0))
) {
14663 return false;
14664 }
14665 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14665); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14665; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14666 args.rval().setUndefined();
14667 return true;
14668}
14669
14670static const JSJitInfo passUTF8StringRecord_methodinfo = {
14671 { (JSJitGetterOp)passUTF8StringRecord },
14672 { prototypes::id::TestJSImplInterface },
14673 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14674 JSJitInfo::Method,
14675 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14676 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14677 false, /* isInfallible. False in setters. */
14678 false, /* isMovable. Not relevant for setters. */
14679 false, /* isEliminatable. Not relevant for setters. */
14680 false, /* isAlwaysInSlot. Only relevant for getters. */
14681 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14682 false, /* isTypedMethod. Only relevant for methods. */
14683 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14684};
14685
14686MOZ_CAN_RUN_SCRIPT static bool
14687passRecordOfRecords(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14688{
14689 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfRecords");
14690 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14693( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14691 "TestJSImplInterface", "passRecordOfRecords", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14693( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14692 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14693( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14693 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14693( cx, "TestJSImplInterface"
, "passRecordOfRecords", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14694
14695 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14696 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfRecords", 1)) {
14697 return false;
14698 }
14699 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14700 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14701 if (objIsXray) {
14702 unwrappedObj.emplace(cx, obj);
14703 }
14704 Record<nsString, Record<nsString, int32_t>> arg0;
14705 if (args[0].isObject()) {
14706 auto& recordEntries = arg0.Entries();
14707
14708 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
14709 JS::RootedVector<jsid> ids(cx);
14710 if (!js::GetPropertyKeys(cx, recordObj,
14711 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14712 return false;
14713 }
14714 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14715 JS_ReportOutOfMemory(cx);
14716 return false;
14717 }
14718 JS::Rooted<JS::Value> propNameValue(cx);
14719 JS::Rooted<JS::Value> temp(cx);
14720 JS::Rooted<jsid> curId(cx);
14721 JS::Rooted<JS::Value> idVal(cx);
14722 // Use a hashset to keep track of ids seen, to avoid
14723 // introducing nasty O(N^2) behavior scanning for them all the
14724 // time. Ideally we'd use a data structure with O(1) lookup
14725 // _and_ ordering for the MozMap, but we don't have one lying
14726 // around.
14727 nsTHashtable<nsStringHashKey> idsSeen;
14728 for (size_t i = 0; i < ids.length(); ++i) {
14729 curId = ids[i];
14730
14731 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14732 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14733 &desc)) {
14734 return false;
14735 }
14736
14737 if (desc.isNothing() || !desc->enumerable()) {
14738 continue;
14739 }
14740
14741 idVal = js::IdToValue(curId);
14742 nsString propName;
14743 // This will just throw if idVal is a Symbol, like the spec says
14744 // to do.
14745 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
14746 return false;
14747 }
14748
14749 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14750 return false;
14751 }
14752
14753 Record<nsString, Record<nsString, int32_t>>::EntryType* entry;
14754 if (!idsSeen.EnsureInserted(propName)) {
14755 // Find the existing entry.
14756 auto idx = recordEntries.IndexOf(propName);
14757 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14758); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14758; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14758 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14758); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14758; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14759 // Now blow it away to make it look like it was just added
14760 // to the array, because it's not obvious that it's
14761 // safe to write to its already-initialized mValue via our
14762 // normal codegen conversions. For example, the value
14763 // could be a union and this would change its type, but
14764 // codegen assumes we won't do that.
14765 entry = recordEntries.ReconstructElementAt(idx);
14766 } else {
14767 // Safe to do an infallible append here, because we did a
14768 // SetCapacity above to the right capacity.
14769 entry = recordEntries.AppendElement();
14770 }
14771 entry->mKey = propName;
14772 Record<nsString, int32_t>& slot = entry->mValue;
14773 if (temp.isObject()) {
14774 auto& recordEntries = slot.Entries();
14775
14776 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
14777 JS::RootedVector<jsid> ids(cx);
14778 if (!js::GetPropertyKeys(cx, recordObj,
14779 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
14780 return false;
14781 }
14782 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
14783 JS_ReportOutOfMemory(cx);
14784 return false;
14785 }
14786 JS::Rooted<JS::Value> propNameValue(cx);
14787 JS::Rooted<JS::Value> temp(cx);
14788 JS::Rooted<jsid> curId(cx);
14789 JS::Rooted<JS::Value> idVal(cx);
14790 // Use a hashset to keep track of ids seen, to avoid
14791 // introducing nasty O(N^2) behavior scanning for them all the
14792 // time. Ideally we'd use a data structure with O(1) lookup
14793 // _and_ ordering for the MozMap, but we don't have one lying
14794 // around.
14795 nsTHashtable<nsStringHashKey> idsSeen;
14796 for (size_t i = 0; i < ids.length(); ++i) {
14797 curId = ids[i];
14798
14799 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
14800 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
14801 &desc)) {
14802 return false;
14803 }
14804
14805 if (desc.isNothing() || !desc->enumerable()) {
14806 continue;
14807 }
14808
14809 idVal = js::IdToValue(curId);
14810 nsString propName;
14811 // This will just throw if idVal is a Symbol, like the spec says
14812 // to do.
14813 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
14814 return false;
14815 }
14816
14817 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
14818 return false;
14819 }
14820
14821 Record<nsString, int32_t>::EntryType* entry;
14822 if (!idsSeen.EnsureInserted(propName)) {
14823 // Find the existing entry.
14824 auto idx = recordEntries.IndexOf(propName);
14825 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14826; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
14826 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 14826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 14826; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
14827 // Now blow it away to make it look like it was just added
14828 // to the array, because it's not obvious that it's
14829 // safe to write to its already-initialized mValue via our
14830 // normal codegen conversions. For example, the value
14831 // could be a union and this would change its type, but
14832 // codegen assumes we won't do that.
14833 entry = recordEntries.ReconstructElementAt(idx);
14834 } else {
14835 // Safe to do an infallible append here, because we did a
14836 // SetCapacity above to the right capacity.
14837 entry = recordEntries.AppendElement();
14838 }
14839 entry->mKey = propName;
14840 int32_t& slot = entry->mValue;
14841 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in value in argument 1", &slot)) {
14842 return false;
14843 }
14844 }
14845 } else {
14846 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
14847 return false;
14848 }
14849 }
14850 } else {
14851 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
14852 return false;
14853 }
14854 if (objIsXray) {
14855 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14856 // we know Xrays have no dynamic unwrap behavior.
14857 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14858 if (!unwrappedObj.ref()) {
14859 return false;
14860 }
14861 }
14862 FastErrorResult rv;
14863 // NOTE: This assert does NOT call the function.
14864 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfRecords(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14865 MOZ_KnownLive(self)(self)->PassRecordOfRecords(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14866 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecords"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecords"
)), 0))
) {
14867 return false;
14868 }
14869 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14869); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14869; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14870 args.rval().setUndefined();
14871 return true;
14872}
14873
14874static const JSJitInfo passRecordOfRecords_methodinfo = {
14875 { (JSJitGetterOp)passRecordOfRecords },
14876 { prototypes::id::TestJSImplInterface },
14877 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14878 JSJitInfo::Method,
14879 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14880 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
14881 false, /* isInfallible. False in setters. */
14882 false, /* isMovable. Not relevant for setters. */
14883 false, /* isEliminatable. Not relevant for setters. */
14884 false, /* isAlwaysInSlot. Only relevant for getters. */
14885 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14886 false, /* isTypedMethod. Only relevant for methods. */
14887 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14888};
14889
14890MOZ_CAN_RUN_SCRIPT static bool
14891receiveRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14892{
14893 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14896( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14894 "TestJSImplInterface", "receiveRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14896( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14895 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14896( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14896 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14896( cx, "TestJSImplInterface"
, "receiveRecord", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14897
14898 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14899 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14900 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14901 if (objIsXray) {
14902 unwrappedObj.emplace(cx, obj);
14903 }
14904 if (objIsXray) {
14905 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14906 // we know Xrays have no dynamic unwrap behavior.
14907 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14908 if (!unwrappedObj.ref()) {
14909 return false;
14910 }
14911 }
14912 FastErrorResult rv;
14913 Record<nsString, int32_t> result;
14914 // NOTE: This assert does NOT call the function.
14915 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14916 MOZ_KnownLive(self)(self)->ReceiveRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14917 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecord"
)), 0))
) {
14918 return false;
14919 }
14920 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14920); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14920; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14921
14922 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
14923 if (!returnObj) {
14924 return false;
14925 }
14926 // Scope for 'tmp'
14927 {
14928 JS::Rooted<JS::Value> tmp(cx);
14929 for (auto& entry : result.Entries()) {
14930 auto& recordValue0 = entry.mValue;
14931 // Control block to let us common up the JS_DefineUCProperty calls when there
14932 // are different ways to succeed at wrapping the value.
14933 do {
14934 tmp.setInt32(int32_t(recordValue0));
14935 break;
14936 } while (false);
14937 if (!JS_DefineUCProperty(cx, returnObj,
14938 entry.mKey.BeginReading(),
14939 entry.mKey.Length(), tmp,
14940 JSPROP_ENUMERATE)) {
14941 return false;
14942 }
14943 }
14944 }
14945 args.rval().setObject(*returnObj);
14946 return true;
14947}
14948
14949static const JSJitInfo receiveRecord_methodinfo = {
14950 { (JSJitGetterOp)receiveRecord },
14951 { prototypes::id::TestJSImplInterface },
14952 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
14953 JSJitInfo::Method,
14954 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
14955 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
14956 false, /* isInfallible. False in setters. */
14957 false, /* isMovable. Not relevant for setters. */
14958 false, /* isEliminatable. Not relevant for setters. */
14959 false, /* isAlwaysInSlot. Only relevant for getters. */
14960 false, /* isLazilyCachedInSlot. Only relevant for getters. */
14961 false, /* isTypedMethod. Only relevant for methods. */
14962 0 /* Reserved slot index, if we're stored in a slot, else 0. */
14963};
14964
14965MOZ_CAN_RUN_SCRIPT static bool
14966receiveNullableRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
14967{
14968 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject14971( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14969 "TestJSImplInterface", "receiveNullableRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject14971( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14970 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject14971( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
14971 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject14971( cx, "TestJSImplInterface"
, "receiveNullableRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
14972
14973 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
14974 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
14975 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
14976 if (objIsXray) {
14977 unwrappedObj.emplace(cx, obj);
14978 }
14979 if (objIsXray) {
14980 // Since our object is an Xray, we can just CheckedUnwrapStatic:
14981 // we know Xrays have no dynamic unwrap behavior.
14982 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
14983 if (!unwrappedObj.ref()) {
14984 return false;
14985 }
14986 }
14987 FastErrorResult rv;
14988 Nullable<Record<nsString, int32_t>> result;
14989 // NOTE: This assert does NOT call the function.
14990 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
14991 MOZ_KnownLive(self)(self)->ReceiveNullableRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
14992 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecord"
)), 0))
) {
14993 return false;
14994 }
14995 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 14995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 14995; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
14996
14997 if (result.IsNull()) {
14998 args.rval().setNull();
14999 return true;
15000 }
15001
15002 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15003 if (!returnObj) {
15004 return false;
15005 }
15006 // Scope for 'tmp'
15007 {
15008 JS::Rooted<JS::Value> tmp(cx);
15009 for (auto& entry : result.Value().Entries()) {
15010 auto& recordValue0 = entry.mValue;
15011 // Control block to let us common up the JS_DefineUCProperty calls when there
15012 // are different ways to succeed at wrapping the value.
15013 do {
15014 tmp.setInt32(int32_t(recordValue0));
15015 break;
15016 } while (false);
15017 if (!JS_DefineUCProperty(cx, returnObj,
15018 entry.mKey.BeginReading(),
15019 entry.mKey.Length(), tmp,
15020 JSPROP_ENUMERATE)) {
15021 return false;
15022 }
15023 }
15024 }
15025 args.rval().setObject(*returnObj);
15026 return true;
15027}
15028
15029static const JSJitInfo receiveNullableRecord_methodinfo = {
15030 { (JSJitGetterOp)receiveNullableRecord },
15031 { prototypes::id::TestJSImplInterface },
15032 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15033 JSJitInfo::Method,
15034 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15035 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
15036 false, /* isInfallible. False in setters. */
15037 false, /* isMovable. Not relevant for setters. */
15038 false, /* isEliminatable. Not relevant for setters. */
15039 false, /* isAlwaysInSlot. Only relevant for getters. */
15040 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15041 false, /* isTypedMethod. Only relevant for methods. */
15042 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15043};
15044
15045MOZ_CAN_RUN_SCRIPT static bool
15046receiveRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15047{
15048 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15051( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15049 "TestJSImplInterface", "receiveRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15051( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15050 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15051( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15051 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15051( cx, "TestJSImplInterface"
, "receiveRecordOfNullableInts", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15052
15053 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15054 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15055 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15056 if (objIsXray) {
15057 unwrappedObj.emplace(cx, obj);
15058 }
15059 if (objIsXray) {
15060 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15061 // we know Xrays have no dynamic unwrap behavior.
15062 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15063 if (!unwrappedObj.ref()) {
15064 return false;
15065 }
15066 }
15067 FastErrorResult rv;
15068 Record<nsString, Nullable<int32_t>> result;
15069 // NOTE: This assert does NOT call the function.
15070 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15071 MOZ_KnownLive(self)(self)->ReceiveRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15072 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveRecordOfNullableInts"
)), 0))
) {
15073 return false;
15074 }
15075 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15075); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15075; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15076
15077 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15078 if (!returnObj) {
15079 return false;
15080 }
15081 // Scope for 'tmp'
15082 {
15083 JS::Rooted<JS::Value> tmp(cx);
15084 for (auto& entry : result.Entries()) {
15085 auto& recordValue0 = entry.mValue;
15086 // Control block to let us common up the JS_DefineUCProperty calls when there
15087 // are different ways to succeed at wrapping the value.
15088 do {
15089 if (recordValue0.IsNull()) {
15090 tmp.setNull();
15091 break;
15092 }
15093 tmp.setInt32(int32_t(recordValue0.Value()));
15094 break;
15095 } while (false);
15096 if (!JS_DefineUCProperty(cx, returnObj,
15097 entry.mKey.BeginReading(),
15098 entry.mKey.Length(), tmp,
15099 JSPROP_ENUMERATE)) {
15100 return false;
15101 }
15102 }
15103 }
15104 args.rval().setObject(*returnObj);
15105 return true;
15106}
15107
15108static const JSJitInfo receiveRecordOfNullableInts_methodinfo = {
15109 { (JSJitGetterOp)receiveRecordOfNullableInts },
15110 { prototypes::id::TestJSImplInterface },
15111 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15112 JSJitInfo::Method,
15113 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15114 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
15115 false, /* isInfallible. False in setters. */
15116 false, /* isMovable. Not relevant for setters. */
15117 false, /* isEliminatable. Not relevant for setters. */
15118 false, /* isAlwaysInSlot. Only relevant for getters. */
15119 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15120 false, /* isTypedMethod. Only relevant for methods. */
15121 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15122};
15123
15124MOZ_CAN_RUN_SCRIPT static bool
15125receiveNullableRecordOfNullableInts(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15126{
15127 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15130( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15128 "TestJSImplInterface", "receiveNullableRecordOfNullableInts", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15130( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15129 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15130( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15130 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15130( cx, "TestJSImplInterface"
, "receiveNullableRecordOfNullableInts", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15131
15132 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15133 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15134 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15135 if (objIsXray) {
15136 unwrappedObj.emplace(cx, obj);
15137 }
15138 if (objIsXray) {
15139 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15140 // we know Xrays have no dynamic unwrap behavior.
15141 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15142 if (!unwrappedObj.ref()) {
15143 return false;
15144 }
15145 }
15146 FastErrorResult rv;
15147 Nullable<Record<nsString, Nullable<int32_t>>> result;
15148 // NOTE: This assert does NOT call the function.
15149 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15150 MOZ_KnownLive(self)(self)->ReceiveNullableRecordOfNullableInts(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15151 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecordOfNullableInts"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableRecordOfNullableInts"
)), 0))
) {
15152 return false;
15153 }
15154 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15154); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15154; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15155
15156 if (result.IsNull()) {
15157 args.rval().setNull();
15158 return true;
15159 }
15160
15161 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15162 if (!returnObj) {
15163 return false;
15164 }
15165 // Scope for 'tmp'
15166 {
15167 JS::Rooted<JS::Value> tmp(cx);
15168 for (auto& entry : result.Value().Entries()) {
15169 auto& recordValue0 = entry.mValue;
15170 // Control block to let us common up the JS_DefineUCProperty calls when there
15171 // are different ways to succeed at wrapping the value.
15172 do {
15173 if (recordValue0.IsNull()) {
15174 tmp.setNull();
15175 break;
15176 }
15177 tmp.setInt32(int32_t(recordValue0.Value()));
15178 break;
15179 } while (false);
15180 if (!JS_DefineUCProperty(cx, returnObj,
15181 entry.mKey.BeginReading(),
15182 entry.mKey.Length(), tmp,
15183 JSPROP_ENUMERATE)) {
15184 return false;
15185 }
15186 }
15187 }
15188 args.rval().setObject(*returnObj);
15189 return true;
15190}
15191
15192static const JSJitInfo receiveNullableRecordOfNullableInts_methodinfo = {
15193 { (JSJitGetterOp)receiveNullableRecordOfNullableInts },
15194 { prototypes::id::TestJSImplInterface },
15195 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15196 JSJitInfo::Method,
15197 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15198 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
15199 false, /* isInfallible. False in setters. */
15200 false, /* isMovable. Not relevant for setters. */
15201 false, /* isEliminatable. Not relevant for setters. */
15202 false, /* isAlwaysInSlot. Only relevant for getters. */
15203 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15204 false, /* isTypedMethod. Only relevant for methods. */
15205 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15206};
15207
15208MOZ_CAN_RUN_SCRIPT static bool
15209receiveAnyRecord(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15210{
15211 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15214( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15212 "TestJSImplInterface", "receiveAnyRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15214( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15213 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15214( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15214 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15214( cx, "TestJSImplInterface"
, "receiveAnyRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15215
15216 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15217 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15218 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15219 if (objIsXray) {
15220 unwrappedObj.emplace(cx, obj);
15221 }
15222 if (objIsXray) {
15223 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15224 // we know Xrays have no dynamic unwrap behavior.
15225 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15226 if (!unwrappedObj.ref()) {
15227 return false;
15228 }
15229 }
15230 FastErrorResult rv;
15231 Record<nsString, JS::Value> result;
15232 RecordRooter<nsString, JS::Value> resultRooter(cx, &result);
15233 // NOTE: This assert does NOT call the function.
15234 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAnyRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15235 MOZ_KnownLive(self)(self)->ReceiveAnyRecord(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15236 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnyRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAnyRecord"
)), 0))
) {
15237 return false;
15238 }
15239 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15239); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15239; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15240
15241 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
15242 if (!returnObj) {
15243 return false;
15244 }
15245 // Scope for 'tmp'
15246 {
15247 JS::Rooted<JS::Value> tmp(cx);
15248 for (auto& entry : result.Entries()) {
15249 auto& recordValue0 = entry.mValue;
15250 // Control block to let us common up the JS_DefineUCProperty calls when there
15251 // are different ways to succeed at wrapping the value.
15252 do {
15253 JS::ExposeValueToActiveJS(recordValue0);
15254 tmp.set(recordValue0);
15255 if (!MaybeWrapValue(cx, &tmp)) {
15256 return false;
15257 }
15258 break;
15259 } while (false);
15260 if (!JS_DefineUCProperty(cx, returnObj,
15261 entry.mKey.BeginReading(),
15262 entry.mKey.Length(), tmp,
15263 JSPROP_ENUMERATE)) {
15264 return false;
15265 }
15266 }
15267 }
15268 args.rval().setObject(*returnObj);
15269 return true;
15270}
15271
15272static const JSJitInfo receiveAnyRecord_methodinfo = {
15273 { (JSJitGetterOp)receiveAnyRecord },
15274 { prototypes::id::TestJSImplInterface },
15275 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15276 JSJitInfo::Method,
15277 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15278 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
15279 false, /* isInfallible. False in setters. */
15280 false, /* isMovable. Not relevant for setters. */
15281 false, /* isEliminatable. Not relevant for setters. */
15282 false, /* isAlwaysInSlot. Only relevant for getters. */
15283 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15284 false, /* isTypedMethod. Only relevant for methods. */
15285 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15286};
15287
15288MOZ_CAN_RUN_SCRIPT static bool
15289passArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15290{
15291 BindingCallContext cx(cx_, "TestJSImplInterface.passArrayBuffer");
15292 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15295( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15293 "TestJSImplInterface", "passArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15295( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15294 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15295( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15295 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15295( cx, "TestJSImplInterface"
, "passArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15296
15297 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15298 if (!args.requireAtLeast(cx, "TestJSImplInterface.passArrayBuffer", 1)) {
15299 return false;
15300 }
15301 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15302 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15303 if (objIsXray) {
15304 unwrappedObj.emplace(cx, obj);
15305 }
15306 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
15307 if (args[0].isObject()) {
15308 if (!arg0.Init(&args[0].toObject())) {
15309 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
15310 return false;
15311 }
15312 if (JS::IsSharedArrayBufferObject(arg0.Obj())) {
15313 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15314 return false;
15315 }
15316 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
15317 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15318 return false;
15319 }
15320 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
15321 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15322 return false;
15323 }
15324 } else {
15325 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15326 return false;
15327 }
15328 if (objIsXray) {
15329 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15330 // we know Xrays have no dynamic unwrap behavior.
15331 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15332 if (!unwrappedObj.ref()) {
15333 return false;
15334 }
15335 }
15336 FastErrorResult rv;
15337 // NOTE: This assert does NOT call the function.
15338 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15339 MOZ_KnownLive(self)(self)->PassArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15340 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBuffer"
)), 0))
) {
15341 return false;
15342 }
15343 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15343); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15343; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15344 args.rval().setUndefined();
15345 return true;
15346}
15347
15348static const JSJitInfo passArrayBuffer_methodinfo = {
15349 { (JSJitGetterOp)passArrayBuffer },
15350 { prototypes::id::TestJSImplInterface },
15351 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15352 JSJitInfo::Method,
15353 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15354 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15355 false, /* isInfallible. False in setters. */
15356 false, /* isMovable. Not relevant for setters. */
15357 false, /* isEliminatable. Not relevant for setters. */
15358 false, /* isAlwaysInSlot. Only relevant for getters. */
15359 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15360 false, /* isTypedMethod. Only relevant for methods. */
15361 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15362};
15363
15364MOZ_CAN_RUN_SCRIPT static bool
15365passNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15366{
15367 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableArrayBuffer");
15368 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15371( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15369 "TestJSImplInterface", "passNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15371( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15370 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15371( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15371 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15371( cx, "TestJSImplInterface"
, "passNullableArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15372
15373 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15374 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableArrayBuffer", 1)) {
15375 return false;
15376 }
15377 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15378 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15379 if (objIsXray) {
15380 unwrappedObj.emplace(cx, obj);
15381 }
15382 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
15383 if (args[0].isObject()) {
15384 if (!arg0.SetValue().Init(&args[0].toObject())) {
15385 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15386 return false;
15387 }
15388 if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) {
15389 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15390 return false;
15391 }
15392 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15393 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15394 return false;
15395 }
15396 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15397 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15398 return false;
15399 }
15400 } else if (args[0].isNullOrUndefined()) {
15401 arg0.SetNull();
15402 } else {
15403 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15404 return false;
15405 }
15406 if (objIsXray) {
15407 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15408 // we know Xrays have no dynamic unwrap behavior.
15409 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15410 if (!unwrappedObj.ref()) {
15411 return false;
15412 }
15413 }
15414 FastErrorResult rv;
15415 // NOTE: This assert does NOT call the function.
15416 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15417 MOZ_KnownLive(self)(self)->PassNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15418 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableArrayBuffer"
)), 0))
) {
15419 return false;
15420 }
15421 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15421); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15421; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15422 args.rval().setUndefined();
15423 return true;
15424}
15425
15426static const JSJitInfo passNullableArrayBuffer_methodinfo = {
15427 { (JSJitGetterOp)passNullableArrayBuffer },
15428 { prototypes::id::TestJSImplInterface },
15429 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15430 JSJitInfo::Method,
15431 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15432 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15433 false, /* isInfallible. False in setters. */
15434 false, /* isMovable. Not relevant for setters. */
15435 false, /* isEliminatable. Not relevant for setters. */
15436 false, /* isAlwaysInSlot. Only relevant for getters. */
15437 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15438 false, /* isTypedMethod. Only relevant for methods. */
15439 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15440};
15441
15442MOZ_CAN_RUN_SCRIPT static bool
15443passOptionalArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15444{
15445 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalArrayBuffer");
15446 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15449( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15447 "TestJSImplInterface", "passOptionalArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15449( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15448 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15449( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15449 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15449( cx, "TestJSImplInterface"
, "passOptionalArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15450
15451 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15452 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15453 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15454 if (objIsXray) {
15455 unwrappedObj.emplace(cx, obj);
15456 }
15457 Optional<ArrayBuffer> arg0;
15458 Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder;
15459 if (args.hasDefined(0)) {
15460 arg0.Construct();
15461 arg0_holder.emplace(cx, &arg0.Value());
15462 if (args[0].isObject()) {
15463 if (!arg0.Value().Init(&args[0].toObject())) {
15464 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
15465 return false;
15466 }
15467 if (JS::IsSharedArrayBufferObject(arg0.Value().Obj())) {
15468 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15469 return false;
15470 }
15471 if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().Obj())) {
15472 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15473 return false;
15474 }
15475 if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().Obj())) {
15476 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15477 return false;
15478 }
15479 } else {
15480 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15481 return false;
15482 }
15483 }
15484 if (objIsXray) {
15485 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15486 // we know Xrays have no dynamic unwrap behavior.
15487 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15488 if (!unwrappedObj.ref()) {
15489 return false;
15490 }
15491 }
15492 FastErrorResult rv;
15493 // NOTE: This assert does NOT call the function.
15494 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15495 MOZ_KnownLive(self)(self)->PassOptionalArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15496 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalArrayBuffer"
)), 0))
) {
15497 return false;
15498 }
15499 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15499); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15499; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15500 args.rval().setUndefined();
15501 return true;
15502}
15503
15504static const JSJitInfo passOptionalArrayBuffer_methodinfo = {
15505 { (JSJitGetterOp)passOptionalArrayBuffer },
15506 { prototypes::id::TestJSImplInterface },
15507 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15508 JSJitInfo::Method,
15509 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15510 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15511 false, /* isInfallible. False in setters. */
15512 false, /* isMovable. Not relevant for setters. */
15513 false, /* isEliminatable. Not relevant for setters. */
15514 false, /* isAlwaysInSlot. Only relevant for getters. */
15515 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15516 false, /* isTypedMethod. Only relevant for methods. */
15517 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15518};
15519
15520MOZ_CAN_RUN_SCRIPT static bool
15521passOptionalNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15522{
15523 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBuffer");
15524 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15527( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15525 "TestJSImplInterface", "passOptionalNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15527( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15526 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15527( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15527 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15527( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15528
15529 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15530 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15531 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15532 if (objIsXray) {
15533 unwrappedObj.emplace(cx, obj);
15534 }
15535 Optional<Nullable<ArrayBuffer>> arg0;
15536 Maybe<SpiderMonkeyInterfaceRooter<ArrayBuffer>> arg0_holder;
15537 if (args.hasDefined(0)) {
15538 arg0.Construct();
15539 arg0_holder.emplace(cx, &arg0.Value().SetValue());
15540 if (args[0].isObject()) {
15541 if (!arg0.Value().SetValue().Init(&args[0].toObject())) {
15542 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15543 return false;
15544 }
15545 if (JS::IsSharedArrayBufferObject(arg0.Value().SetValue().Obj())) {
15546 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15547 return false;
15548 }
15549 if (JS::IsLargeArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) {
15550 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15551 return false;
15552 }
15553 if (JS::IsResizableArrayBufferMaybeShared(arg0.Value().SetValue().Obj())) {
15554 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15555 return false;
15556 }
15557 } else if (args[0].isNullOrUndefined()) {
15558 arg0.Value().SetNull();
15559 } else {
15560 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15561 return false;
15562 }
15563 }
15564 if (objIsXray) {
15565 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15566 // we know Xrays have no dynamic unwrap behavior.
15567 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15568 if (!unwrappedObj.ref()) {
15569 return false;
15570 }
15571 }
15572 FastErrorResult rv;
15573 // NOTE: This assert does NOT call the function.
15574 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15575 MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15576 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBuffer"
)), 0))
) {
15577 return false;
15578 }
15579 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15579); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15579; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15580 args.rval().setUndefined();
15581 return true;
15582}
15583
15584static const JSJitInfo passOptionalNullableArrayBuffer_methodinfo = {
15585 { (JSJitGetterOp)passOptionalNullableArrayBuffer },
15586 { prototypes::id::TestJSImplInterface },
15587 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15588 JSJitInfo::Method,
15589 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15590 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15591 false, /* isInfallible. False in setters. */
15592 false, /* isMovable. Not relevant for setters. */
15593 false, /* isEliminatable. Not relevant for setters. */
15594 false, /* isAlwaysInSlot. Only relevant for getters. */
15595 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15596 false, /* isTypedMethod. Only relevant for methods. */
15597 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15598};
15599
15600MOZ_CAN_RUN_SCRIPT static bool
15601passOptionalNullableArrayBufferWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15602{
15603 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue");
15604 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15607( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15605 "TestJSImplInterface", "passOptionalNullableArrayBufferWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15607( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15606 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15607( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
15607 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15607( cx, "TestJSImplInterface"
, "passOptionalNullableArrayBufferWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
15608
15609 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15610 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15611 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15612 if (objIsXray) {
15613 unwrappedObj.emplace(cx, obj);
15614 }
15615 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
15616 if (args.hasDefined(0)) {
15617 if (args[0].isObject()) {
15618 if (!arg0.SetValue().Init(&args[0].toObject())) {
15619 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
15620 return false;
15621 }
15622 if (JS::IsSharedArrayBufferObject(arg0.SetValue().Obj())) {
15623 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15624 return false;
15625 }
15626 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15627 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15628 return false;
15629 }
15630 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
15631 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15632 return false;
15633 }
15634 } else if (args[0].isNullOrUndefined()) {
15635 arg0.SetNull();
15636 } else {
15637 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15638 return false;
15639 }
15640 } else {
15641 arg0.SetNull();
15642 }
15643 if (objIsXray) {
15644 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15645 // we know Xrays have no dynamic unwrap behavior.
15646 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15647 if (!unwrappedObj.ref()) {
15648 return false;
15649 }
15650 }
15651 FastErrorResult rv;
15652 // NOTE: This assert does NOT call the function.
15653 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15654 MOZ_KnownLive(self)(self)->PassOptionalNullableArrayBufferWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15655 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue"
)), 0))
) {
15656 return false;
15657 }
15658 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15658); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15658; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15659 args.rval().setUndefined();
15660 return true;
15661}
15662
15663static const JSJitInfo passOptionalNullableArrayBufferWithDefaultValue_methodinfo = {
15664 { (JSJitGetterOp)passOptionalNullableArrayBufferWithDefaultValue },
15665 { prototypes::id::TestJSImplInterface },
15666 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15667 JSJitInfo::Method,
15668 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15669 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15670 false, /* isInfallible. False in setters. */
15671 false, /* isMovable. Not relevant for setters. */
15672 false, /* isEliminatable. Not relevant for setters. */
15673 false, /* isAlwaysInSlot. Only relevant for getters. */
15674 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15675 false, /* isTypedMethod. Only relevant for methods. */
15676 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15677};
15678
15679MOZ_CAN_RUN_SCRIPT static bool
15680passArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15681{
15682 BindingCallContext cx(cx_, "TestJSImplInterface.passArrayBufferView");
15683 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15686( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15684 "TestJSImplInterface", "passArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15686( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15685 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15686( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15686 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15686( cx, "TestJSImplInterface"
, "passArrayBufferView", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15687
15688 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15689 if (!args.requireAtLeast(cx, "TestJSImplInterface.passArrayBufferView", 1)) {
15690 return false;
15691 }
15692 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15693 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15694 if (objIsXray) {
15695 unwrappedObj.emplace(cx, obj);
15696 }
15697 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
15698 if (args[0].isObject()) {
15699 if (!arg0.Init(&args[0].toObject())) {
15700 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
15701 return false;
15702 }
15703 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15704 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15705 return false;
15706 }
15707 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15708 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15709 return false;
15710 }
15711 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15712 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15713 return false;
15714 }
15715 } else {
15716 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15717 return false;
15718 }
15719 if (objIsXray) {
15720 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15721 // we know Xrays have no dynamic unwrap behavior.
15722 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15723 if (!unwrappedObj.ref()) {
15724 return false;
15725 }
15726 }
15727 FastErrorResult rv;
15728 // NOTE: This assert does NOT call the function.
15729 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15730 MOZ_KnownLive(self)(self)->PassArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15731 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArrayBufferView"
)), 0))
) {
15732 return false;
15733 }
15734 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15734; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15735 args.rval().setUndefined();
15736 return true;
15737}
15738
15739static const JSJitInfo passArrayBufferView_methodinfo = {
15740 { (JSJitGetterOp)passArrayBufferView },
15741 { prototypes::id::TestJSImplInterface },
15742 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15743 JSJitInfo::Method,
15744 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15745 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15746 false, /* isInfallible. False in setters. */
15747 false, /* isMovable. Not relevant for setters. */
15748 false, /* isEliminatable. Not relevant for setters. */
15749 false, /* isAlwaysInSlot. Only relevant for getters. */
15750 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15751 false, /* isTypedMethod. Only relevant for methods. */
15752 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15753};
15754
15755MOZ_CAN_RUN_SCRIPT static bool
15756passInt8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15757{
15758 BindingCallContext cx(cx_, "TestJSImplInterface.passInt8Array");
15759 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15762( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15760 "TestJSImplInterface", "passInt8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15762( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15761 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15762( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15762 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15762( cx, "TestJSImplInterface"
, "passInt8Array", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15763
15764 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15765 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt8Array", 1)) {
15766 return false;
15767 }
15768 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15769 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15770 if (objIsXray) {
15771 unwrappedObj.emplace(cx, obj);
15772 }
15773 RootedSpiderMonkeyInterface<Int8Array> arg0(cx);
15774 if (args[0].isObject()) {
15775 if (!arg0.Init(&args[0].toObject())) {
15776 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int8Array");
15777 return false;
15778 }
15779 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15780 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15781 return false;
15782 }
15783 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15784 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15785 return false;
15786 }
15787 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15788 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15789 return false;
15790 }
15791 } else {
15792 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15793 return false;
15794 }
15795 if (objIsXray) {
15796 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15797 // we know Xrays have no dynamic unwrap behavior.
15798 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15799 if (!unwrappedObj.ref()) {
15800 return false;
15801 }
15802 }
15803 FastErrorResult rv;
15804 // NOTE: This assert does NOT call the function.
15805 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15806 MOZ_KnownLive(self)(self)->PassInt8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15807 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt8Array"
)), 0))
) {
15808 return false;
15809 }
15810 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15810); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15810; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15811 args.rval().setUndefined();
15812 return true;
15813}
15814
15815static const JSJitInfo passInt8Array_methodinfo = {
15816 { (JSJitGetterOp)passInt8Array },
15817 { prototypes::id::TestJSImplInterface },
15818 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15819 JSJitInfo::Method,
15820 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15821 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15822 false, /* isInfallible. False in setters. */
15823 false, /* isMovable. Not relevant for setters. */
15824 false, /* isEliminatable. Not relevant for setters. */
15825 false, /* isAlwaysInSlot. Only relevant for getters. */
15826 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15827 false, /* isTypedMethod. Only relevant for methods. */
15828 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15829};
15830
15831MOZ_CAN_RUN_SCRIPT static bool
15832passInt16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15833{
15834 BindingCallContext cx(cx_, "TestJSImplInterface.passInt16Array");
15835 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15838( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15836 "TestJSImplInterface", "passInt16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15838( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15837 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15838( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15838 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15838( cx, "TestJSImplInterface"
, "passInt16Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15839
15840 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15841 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt16Array", 1)) {
15842 return false;
15843 }
15844 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15845 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15846 if (objIsXray) {
15847 unwrappedObj.emplace(cx, obj);
15848 }
15849 RootedSpiderMonkeyInterface<Int16Array> arg0(cx);
15850 if (args[0].isObject()) {
15851 if (!arg0.Init(&args[0].toObject())) {
15852 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int16Array");
15853 return false;
15854 }
15855 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15856 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15857 return false;
15858 }
15859 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15860 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15861 return false;
15862 }
15863 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15864 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15865 return false;
15866 }
15867 } else {
15868 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15869 return false;
15870 }
15871 if (objIsXray) {
15872 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15873 // we know Xrays have no dynamic unwrap behavior.
15874 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15875 if (!unwrappedObj.ref()) {
15876 return false;
15877 }
15878 }
15879 FastErrorResult rv;
15880 // NOTE: This assert does NOT call the function.
15881 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15882 MOZ_KnownLive(self)(self)->PassInt16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15883 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt16Array"
)), 0))
) {
15884 return false;
15885 }
15886 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15886); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15886; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15887 args.rval().setUndefined();
15888 return true;
15889}
15890
15891static const JSJitInfo passInt16Array_methodinfo = {
15892 { (JSJitGetterOp)passInt16Array },
15893 { prototypes::id::TestJSImplInterface },
15894 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15895 JSJitInfo::Method,
15896 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15897 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15898 false, /* isInfallible. False in setters. */
15899 false, /* isMovable. Not relevant for setters. */
15900 false, /* isEliminatable. Not relevant for setters. */
15901 false, /* isAlwaysInSlot. Only relevant for getters. */
15902 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15903 false, /* isTypedMethod. Only relevant for methods. */
15904 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15905};
15906
15907MOZ_CAN_RUN_SCRIPT static bool
15908passInt32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15909{
15910 BindingCallContext cx(cx_, "TestJSImplInterface.passInt32Array");
15911 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15914( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15912 "TestJSImplInterface", "passInt32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15914( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15913 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15914( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15914 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15914( cx, "TestJSImplInterface"
, "passInt32Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15915
15916 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15917 if (!args.requireAtLeast(cx, "TestJSImplInterface.passInt32Array", 1)) {
15918 return false;
15919 }
15920 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15921 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15922 if (objIsXray) {
15923 unwrappedObj.emplace(cx, obj);
15924 }
15925 RootedSpiderMonkeyInterface<Int32Array> arg0(cx);
15926 if (args[0].isObject()) {
15927 if (!arg0.Init(&args[0].toObject())) {
15928 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Int32Array");
15929 return false;
15930 }
15931 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
15932 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
15933 return false;
15934 }
15935 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
15936 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
15937 return false;
15938 }
15939 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
15940 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
15941 return false;
15942 }
15943 } else {
15944 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
15945 return false;
15946 }
15947 if (objIsXray) {
15948 // Since our object is an Xray, we can just CheckedUnwrapStatic:
15949 // we know Xrays have no dynamic unwrap behavior.
15950 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
15951 if (!unwrappedObj.ref()) {
15952 return false;
15953 }
15954 }
15955 FastErrorResult rv;
15956 // NOTE: This assert does NOT call the function.
15957 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
15958 MOZ_KnownLive(self)(self)->PassInt32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
15959 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passInt32Array"
)), 0))
) {
15960 return false;
15961 }
15962 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 15962); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 15962; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
15963 args.rval().setUndefined();
15964 return true;
15965}
15966
15967static const JSJitInfo passInt32Array_methodinfo = {
15968 { (JSJitGetterOp)passInt32Array },
15969 { prototypes::id::TestJSImplInterface },
15970 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
15971 JSJitInfo::Method,
15972 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
15973 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
15974 false, /* isInfallible. False in setters. */
15975 false, /* isMovable. Not relevant for setters. */
15976 false, /* isEliminatable. Not relevant for setters. */
15977 false, /* isAlwaysInSlot. Only relevant for getters. */
15978 false, /* isLazilyCachedInSlot. Only relevant for getters. */
15979 false, /* isTypedMethod. Only relevant for methods. */
15980 0 /* Reserved slot index, if we're stored in a slot, else 0. */
15981};
15982
15983MOZ_CAN_RUN_SCRIPT static bool
15984passUint8Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
15985{
15986 BindingCallContext cx(cx_, "TestJSImplInterface.passUint8Array");
15987 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject15990( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15988 "TestJSImplInterface", "passUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject15990( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15989 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject15990( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
15990 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject15990( cx, "TestJSImplInterface"
, "passUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
15991
15992 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
15993 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8Array", 1)) {
15994 return false;
15995 }
15996 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
15997 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
15998 if (objIsXray) {
15999 unwrappedObj.emplace(cx, obj);
16000 }
16001 RootedSpiderMonkeyInterface<Uint8Array> arg0(cx);
16002 if (args[0].isObject()) {
16003 if (!arg0.Init(&args[0].toObject())) {
16004 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8Array");
16005 return false;
16006 }
16007 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16008 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16009 return false;
16010 }
16011 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16012 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16013 return false;
16014 }
16015 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16016 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16017 return false;
16018 }
16019 } else {
16020 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16021 return false;
16022 }
16023 if (objIsXray) {
16024 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16025 // we know Xrays have no dynamic unwrap behavior.
16026 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16027 if (!unwrappedObj.ref()) {
16028 return false;
16029 }
16030 }
16031 FastErrorResult rv;
16032 // NOTE: This assert does NOT call the function.
16033 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16034 MOZ_KnownLive(self)(self)->PassUint8Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16035 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8Array"
)), 0))
) {
16036 return false;
16037 }
16038 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16038); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16038; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16039 args.rval().setUndefined();
16040 return true;
16041}
16042
16043static const JSJitInfo passUint8Array_methodinfo = {
16044 { (JSJitGetterOp)passUint8Array },
16045 { prototypes::id::TestJSImplInterface },
16046 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16047 JSJitInfo::Method,
16048 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16049 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16050 false, /* isInfallible. False in setters. */
16051 false, /* isMovable. Not relevant for setters. */
16052 false, /* isEliminatable. Not relevant for setters. */
16053 false, /* isAlwaysInSlot. Only relevant for getters. */
16054 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16055 false, /* isTypedMethod. Only relevant for methods. */
16056 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16057};
16058
16059MOZ_CAN_RUN_SCRIPT static bool
16060passUint16Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16061{
16062 BindingCallContext cx(cx_, "TestJSImplInterface.passUint16Array");
16063 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16066( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16064 "TestJSImplInterface", "passUint16Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16066( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16065 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16066( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16066 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16066( cx, "TestJSImplInterface"
, "passUint16Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16067
16068 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16069 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint16Array", 1)) {
16070 return false;
16071 }
16072 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16073 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16074 if (objIsXray) {
16075 unwrappedObj.emplace(cx, obj);
16076 }
16077 RootedSpiderMonkeyInterface<Uint16Array> arg0(cx);
16078 if (args[0].isObject()) {
16079 if (!arg0.Init(&args[0].toObject())) {
16080 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint16Array");
16081 return false;
16082 }
16083 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16084 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16085 return false;
16086 }
16087 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16088 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16089 return false;
16090 }
16091 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16092 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16093 return false;
16094 }
16095 } else {
16096 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16097 return false;
16098 }
16099 if (objIsXray) {
16100 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16101 // we know Xrays have no dynamic unwrap behavior.
16102 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16103 if (!unwrappedObj.ref()) {
16104 return false;
16105 }
16106 }
16107 FastErrorResult rv;
16108 // NOTE: This assert does NOT call the function.
16109 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16110 MOZ_KnownLive(self)(self)->PassUint16Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16111 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint16Array"
)), 0))
) {
16112 return false;
16113 }
16114 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16114); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16114; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16115 args.rval().setUndefined();
16116 return true;
16117}
16118
16119static const JSJitInfo passUint16Array_methodinfo = {
16120 { (JSJitGetterOp)passUint16Array },
16121 { prototypes::id::TestJSImplInterface },
16122 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16123 JSJitInfo::Method,
16124 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16125 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16126 false, /* isInfallible. False in setters. */
16127 false, /* isMovable. Not relevant for setters. */
16128 false, /* isEliminatable. Not relevant for setters. */
16129 false, /* isAlwaysInSlot. Only relevant for getters. */
16130 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16131 false, /* isTypedMethod. Only relevant for methods. */
16132 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16133};
16134
16135MOZ_CAN_RUN_SCRIPT static bool
16136passUint32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16137{
16138 BindingCallContext cx(cx_, "TestJSImplInterface.passUint32Array");
16139 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16142( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16140 "TestJSImplInterface", "passUint32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16142( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16141 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16142( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16142 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16142( cx, "TestJSImplInterface"
, "passUint32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16143
16144 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16145 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint32Array", 1)) {
16146 return false;
16147 }
16148 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16149 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16150 if (objIsXray) {
16151 unwrappedObj.emplace(cx, obj);
16152 }
16153 RootedSpiderMonkeyInterface<Uint32Array> arg0(cx);
16154 if (args[0].isObject()) {
16155 if (!arg0.Init(&args[0].toObject())) {
16156 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint32Array");
16157 return false;
16158 }
16159 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16160 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16161 return false;
16162 }
16163 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16164 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16165 return false;
16166 }
16167 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16168 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16169 return false;
16170 }
16171 } else {
16172 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16173 return false;
16174 }
16175 if (objIsXray) {
16176 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16177 // we know Xrays have no dynamic unwrap behavior.
16178 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16179 if (!unwrappedObj.ref()) {
16180 return false;
16181 }
16182 }
16183 FastErrorResult rv;
16184 // NOTE: This assert does NOT call the function.
16185 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16186 MOZ_KnownLive(self)(self)->PassUint32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16187 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint32Array"
)), 0))
) {
16188 return false;
16189 }
16190 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16190; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16191 args.rval().setUndefined();
16192 return true;
16193}
16194
16195static const JSJitInfo passUint32Array_methodinfo = {
16196 { (JSJitGetterOp)passUint32Array },
16197 { prototypes::id::TestJSImplInterface },
16198 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16199 JSJitInfo::Method,
16200 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16201 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16202 false, /* isInfallible. False in setters. */
16203 false, /* isMovable. Not relevant for setters. */
16204 false, /* isEliminatable. Not relevant for setters. */
16205 false, /* isAlwaysInSlot. Only relevant for getters. */
16206 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16207 false, /* isTypedMethod. Only relevant for methods. */
16208 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16209};
16210
16211MOZ_CAN_RUN_SCRIPT static bool
16212passUint8ClampedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16213{
16214 BindingCallContext cx(cx_, "TestJSImplInterface.passUint8ClampedArray");
16215 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16218( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16216 "TestJSImplInterface", "passUint8ClampedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16218( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16217 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16218( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16218 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16218( cx, "TestJSImplInterface"
, "passUint8ClampedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16219
16220 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16221 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUint8ClampedArray", 1)) {
16222 return false;
16223 }
16224 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16225 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16226 if (objIsXray) {
16227 unwrappedObj.emplace(cx, obj);
16228 }
16229 RootedSpiderMonkeyInterface<Uint8ClampedArray> arg0(cx);
16230 if (args[0].isObject()) {
16231 if (!arg0.Init(&args[0].toObject())) {
16232 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Uint8ClampedArray");
16233 return false;
16234 }
16235 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16236 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16237 return false;
16238 }
16239 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16240 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16241 return false;
16242 }
16243 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16244 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16245 return false;
16246 }
16247 } else {
16248 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16249 return false;
16250 }
16251 if (objIsXray) {
16252 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16253 // we know Xrays have no dynamic unwrap behavior.
16254 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16255 if (!unwrappedObj.ref()) {
16256 return false;
16257 }
16258 }
16259 FastErrorResult rv;
16260 // NOTE: This assert does NOT call the function.
16261 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16262 MOZ_KnownLive(self)(self)->PassUint8ClampedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16263 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUint8ClampedArray"
)), 0))
) {
16264 return false;
16265 }
16266 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16266); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16266; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16267 args.rval().setUndefined();
16268 return true;
16269}
16270
16271static const JSJitInfo passUint8ClampedArray_methodinfo = {
16272 { (JSJitGetterOp)passUint8ClampedArray },
16273 { prototypes::id::TestJSImplInterface },
16274 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16275 JSJitInfo::Method,
16276 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16277 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16278 false, /* isInfallible. False in setters. */
16279 false, /* isMovable. Not relevant for setters. */
16280 false, /* isEliminatable. Not relevant for setters. */
16281 false, /* isAlwaysInSlot. Only relevant for getters. */
16282 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16283 false, /* isTypedMethod. Only relevant for methods. */
16284 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16285};
16286
16287MOZ_CAN_RUN_SCRIPT static bool
16288passFloat32Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16289{
16290 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat32Array");
16291 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16294( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16292 "TestJSImplInterface", "passFloat32Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16294( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16293 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16294( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16294 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16294( cx, "TestJSImplInterface"
, "passFloat32Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16295
16296 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16297 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat32Array", 1)) {
16298 return false;
16299 }
16300 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16301 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16302 if (objIsXray) {
16303 unwrappedObj.emplace(cx, obj);
16304 }
16305 RootedSpiderMonkeyInterface<Float32Array> arg0(cx);
16306 if (args[0].isObject()) {
16307 if (!arg0.Init(&args[0].toObject())) {
16308 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array");
16309 return false;
16310 }
16311 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16312 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16313 return false;
16314 }
16315 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16316 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16317 return false;
16318 }
16319 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16320 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16321 return false;
16322 }
16323 } else {
16324 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16325 return false;
16326 }
16327 if (objIsXray) {
16328 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16329 // we know Xrays have no dynamic unwrap behavior.
16330 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16331 if (!unwrappedObj.ref()) {
16332 return false;
16333 }
16334 }
16335 FastErrorResult rv;
16336 // NOTE: This assert does NOT call the function.
16337 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16338 MOZ_KnownLive(self)(self)->PassFloat32Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16339 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat32Array"
)), 0))
) {
16340 return false;
16341 }
16342 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16342; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16343 args.rval().setUndefined();
16344 return true;
16345}
16346
16347static const JSJitInfo passFloat32Array_methodinfo = {
16348 { (JSJitGetterOp)passFloat32Array },
16349 { prototypes::id::TestJSImplInterface },
16350 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16351 JSJitInfo::Method,
16352 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16353 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16354 false, /* isInfallible. False in setters. */
16355 false, /* isMovable. Not relevant for setters. */
16356 false, /* isEliminatable. Not relevant for setters. */
16357 false, /* isAlwaysInSlot. Only relevant for getters. */
16358 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16359 false, /* isTypedMethod. Only relevant for methods. */
16360 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16361};
16362
16363MOZ_CAN_RUN_SCRIPT static bool
16364passFloat64Array(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16365{
16366 BindingCallContext cx(cx_, "TestJSImplInterface.passFloat64Array");
16367 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16370( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16368 "TestJSImplInterface", "passFloat64Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16370( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16369 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16370( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16370 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16370( cx, "TestJSImplInterface"
, "passFloat64Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16371
16372 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16373 if (!args.requireAtLeast(cx, "TestJSImplInterface.passFloat64Array", 1)) {
16374 return false;
16375 }
16376 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16377 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16378 if (objIsXray) {
16379 unwrappedObj.emplace(cx, obj);
16380 }
16381 RootedSpiderMonkeyInterface<Float64Array> arg0(cx);
16382 if (args[0].isObject()) {
16383 if (!arg0.Init(&args[0].toObject())) {
16384 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float64Array");
16385 return false;
16386 }
16387 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
16388 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16389 return false;
16390 }
16391 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
16392 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16393 return false;
16394 }
16395 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
16396 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16397 return false;
16398 }
16399 } else {
16400 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16401 return false;
16402 }
16403 if (objIsXray) {
16404 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16405 // we know Xrays have no dynamic unwrap behavior.
16406 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16407 if (!unwrappedObj.ref()) {
16408 return false;
16409 }
16410 }
16411 FastErrorResult rv;
16412 // NOTE: This assert does NOT call the function.
16413 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16414 MOZ_KnownLive(self)(self)->PassFloat64Array(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16415 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passFloat64Array"
)), 0))
) {
16416 return false;
16417 }
16418 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16418; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16419 args.rval().setUndefined();
16420 return true;
16421}
16422
16423static const JSJitInfo passFloat64Array_methodinfo = {
16424 { (JSJitGetterOp)passFloat64Array },
16425 { prototypes::id::TestJSImplInterface },
16426 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16427 JSJitInfo::Method,
16428 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16429 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16430 false, /* isInfallible. False in setters. */
16431 false, /* isMovable. Not relevant for setters. */
16432 false, /* isEliminatable. Not relevant for setters. */
16433 false, /* isAlwaysInSlot. Only relevant for getters. */
16434 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16435 false, /* isTypedMethod. Only relevant for methods. */
16436 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16437};
16438
16439MOZ_CAN_RUN_SCRIPT static bool
16440passSequenceOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16441{
16442 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfArrayBuffers");
16443 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16446( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16444 "TestJSImplInterface", "passSequenceOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16446( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16445 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16446( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16446 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16446( cx, "TestJSImplInterface"
, "passSequenceOfArrayBuffers", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16447
16448 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16449 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfArrayBuffers", 1)) {
16450 return false;
16451 }
16452 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16453 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16454 if (objIsXray) {
16455 unwrappedObj.emplace(cx, obj);
16456 }
16457 binding_detail::AutoSequence<ArrayBuffer> arg0;
16458 SequenceRooter<ArrayBuffer> arg0_holder(cx, &arg0);
16459 if (args[0].isObject()) {
16460 JS::ForOfIterator iter(cx);
16461 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
16462 return false;
16463 }
16464 if (!iter.valueIsIterable()) {
16465 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16466 return false;
16467 }
16468 binding_detail::AutoSequence<ArrayBuffer> &arr = arg0;
16469 JS::Rooted<JS::Value> temp(cx);
16470 while (true) {
16471 bool done;
16472 if (!iter.next(&temp, &done)) {
16473 return false;
16474 }
16475 if (done) {
16476 break;
16477 }
16478 ArrayBuffer* slotPtr = arr.AppendElement(mozilla::fallible);
16479 if (!slotPtr) {
16480 JS_ReportOutOfMemory(cx);
16481 return false;
16482 }
16483 ArrayBuffer& slot = *slotPtr;
16484 if (temp.isObject()) {
16485 if (!slot.Init(&temp.toObject())) {
16486 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBuffer");
16487 return false;
16488 }
16489 if (JS::IsSharedArrayBufferObject(slot.Obj())) {
16490 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1");
16491 return false;
16492 }
16493 if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) {
16494 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1");
16495 return false;
16496 }
16497 if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) {
16498 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1");
16499 return false;
16500 }
16501 } else {
16502 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
16503 return false;
16504 }
16505 }
16506 } else {
16507 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16508 return false;
16509 }
16510 if (objIsXray) {
16511 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16512 // we know Xrays have no dynamic unwrap behavior.
16513 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16514 if (!unwrappedObj.ref()) {
16515 return false;
16516 }
16517 }
16518 FastErrorResult rv;
16519 // NOTE: This assert does NOT call the function.
16520 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16521 MOZ_KnownLive(self)(self)->PassSequenceOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16522 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfArrayBuffers"
)), 0))
) {
16523 return false;
16524 }
16525 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16525; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16526 args.rval().setUndefined();
16527 return true;
16528}
16529
16530static const JSJitInfo passSequenceOfArrayBuffers_methodinfo = {
16531 { (JSJitGetterOp)passSequenceOfArrayBuffers },
16532 { prototypes::id::TestJSImplInterface },
16533 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16534 JSJitInfo::Method,
16535 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16536 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16537 false, /* isInfallible. False in setters. */
16538 false, /* isMovable. Not relevant for setters. */
16539 false, /* isEliminatable. Not relevant for setters. */
16540 false, /* isAlwaysInSlot. Only relevant for getters. */
16541 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16542 false, /* isTypedMethod. Only relevant for methods. */
16543 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16544};
16545
16546MOZ_CAN_RUN_SCRIPT static bool
16547passSequenceOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16548{
16549 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableArrayBuffers");
16550 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16553( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16551 "TestJSImplInterface", "passSequenceOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16553( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16552 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16553( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16553 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16553( cx, "TestJSImplInterface"
, "passSequenceOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16554
16555 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16556 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", 1)) {
16557 return false;
16558 }
16559 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16560 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16561 if (objIsXray) {
16562 unwrappedObj.emplace(cx, obj);
16563 }
16564 binding_detail::AutoSequence<Nullable<ArrayBuffer>> arg0;
16565 SequenceRooter<Nullable<ArrayBuffer>> arg0_holder(cx, &arg0);
16566 if (args[0].isObject()) {
16567 JS::ForOfIterator iter(cx);
16568 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
16569 return false;
16570 }
16571 if (!iter.valueIsIterable()) {
16572 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16573 return false;
16574 }
16575 binding_detail::AutoSequence<Nullable<ArrayBuffer>> &arr = arg0;
16576 JS::Rooted<JS::Value> temp(cx);
16577 while (true) {
16578 bool done;
16579 if (!iter.next(&temp, &done)) {
16580 return false;
16581 }
16582 if (done) {
16583 break;
16584 }
16585 Nullable<ArrayBuffer>* slotPtr = arr.AppendElement(mozilla::fallible);
16586 if (!slotPtr) {
16587 JS_ReportOutOfMemory(cx);
16588 return false;
16589 }
16590 Nullable<ArrayBuffer>& slot = *slotPtr;
16591 if (temp.isObject()) {
16592 if (!slot.SetValue().Init(&temp.toObject())) {
16593 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of argument 1", "ArrayBufferOrNull");
16594 return false;
16595 }
16596 if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) {
16597 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Element of argument 1");
16598 return false;
16599 }
16600 if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) {
16601 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Element of argument 1");
16602 return false;
16603 }
16604 if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16605 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Element of argument 1");
16606 return false;
16607 }
16608 } else if (temp.isNullOrUndefined()) {
16609 slot.SetNull();
16610 } else {
16611 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
16612 return false;
16613 }
16614 }
16615 } else {
16616 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
16617 return false;
16618 }
16619 if (objIsXray) {
16620 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16621 // we know Xrays have no dynamic unwrap behavior.
16622 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16623 if (!unwrappedObj.ref()) {
16624 return false;
16625 }
16626 }
16627 FastErrorResult rv;
16628 // NOTE: This assert does NOT call the function.
16629 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16630 MOZ_KnownLive(self)(self)->PassSequenceOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16631 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableArrayBuffers"
)), 0))
) {
16632 return false;
16633 }
16634 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16634); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16634; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16635 args.rval().setUndefined();
16636 return true;
16637}
16638
16639static const JSJitInfo passSequenceOfNullableArrayBuffers_methodinfo = {
16640 { (JSJitGetterOp)passSequenceOfNullableArrayBuffers },
16641 { prototypes::id::TestJSImplInterface },
16642 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16643 JSJitInfo::Method,
16644 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16645 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16646 false, /* isInfallible. False in setters. */
16647 false, /* isMovable. Not relevant for setters. */
16648 false, /* isEliminatable. Not relevant for setters. */
16649 false, /* isAlwaysInSlot. Only relevant for getters. */
16650 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16651 false, /* isTypedMethod. Only relevant for methods. */
16652 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16653};
16654
16655MOZ_CAN_RUN_SCRIPT static bool
16656passRecordOfArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16657{
16658 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfArrayBuffers");
16659 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16662( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16660 "TestJSImplInterface", "passRecordOfArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16662( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16661 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16662( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16662 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16662( cx, "TestJSImplInterface"
, "passRecordOfArrayBuffers", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16663
16664 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16665 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfArrayBuffers", 1)) {
16666 return false;
16667 }
16668 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16669 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16670 if (objIsXray) {
16671 unwrappedObj.emplace(cx, obj);
16672 }
16673 Record<nsString, ArrayBuffer> arg0;
16674 RecordRooter<nsString, ArrayBuffer> arg0_holder(cx, &arg0);
16675 if (args[0].isObject()) {
16676 auto& recordEntries = arg0.Entries();
16677
16678 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
16679 JS::RootedVector<jsid> ids(cx);
16680 if (!js::GetPropertyKeys(cx, recordObj,
16681 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
16682 return false;
16683 }
16684 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
16685 JS_ReportOutOfMemory(cx);
16686 return false;
16687 }
16688 JS::Rooted<JS::Value> propNameValue(cx);
16689 JS::Rooted<JS::Value> temp(cx);
16690 JS::Rooted<jsid> curId(cx);
16691 JS::Rooted<JS::Value> idVal(cx);
16692 // Use a hashset to keep track of ids seen, to avoid
16693 // introducing nasty O(N^2) behavior scanning for them all the
16694 // time. Ideally we'd use a data structure with O(1) lookup
16695 // _and_ ordering for the MozMap, but we don't have one lying
16696 // around.
16697 nsTHashtable<nsStringHashKey> idsSeen;
16698 for (size_t i = 0; i < ids.length(); ++i) {
16699 curId = ids[i];
16700
16701 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
16702 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
16703 &desc)) {
16704 return false;
16705 }
16706
16707 if (desc.isNothing() || !desc->enumerable()) {
16708 continue;
16709 }
16710
16711 idVal = js::IdToValue(curId);
16712 nsString propName;
16713 // This will just throw if idVal is a Symbol, like the spec says
16714 // to do.
16715 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
16716 return false;
16717 }
16718
16719 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
16720 return false;
16721 }
16722
16723 Record<nsString, ArrayBuffer>::EntryType* entry;
16724 if (!idsSeen.EnsureInserted(propName)) {
16725 // Find the existing entry.
16726 auto idx = recordEntries.IndexOf(propName);
16727 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 16728); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 16728; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
16728 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 16728); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 16728; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
16729 // Now blow it away to make it look like it was just added
16730 // to the array, because it's not obvious that it's
16731 // safe to write to its already-initialized mValue via our
16732 // normal codegen conversions. For example, the value
16733 // could be a union and this would change its type, but
16734 // codegen assumes we won't do that.
16735 entry = recordEntries.ReconstructElementAt(idx);
16736 } else {
16737 // Safe to do an infallible append here, because we did a
16738 // SetCapacity above to the right capacity.
16739 entry = recordEntries.AppendElement();
16740 }
16741 entry->mKey = propName;
16742 ArrayBuffer& slot = entry->mValue;
16743 if (temp.isObject()) {
16744 if (!slot.Init(&temp.toObject())) {
16745 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBuffer");
16746 return false;
16747 }
16748 if (JS::IsSharedArrayBufferObject(slot.Obj())) {
16749 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1");
16750 return false;
16751 }
16752 if (JS::IsLargeArrayBufferMaybeShared(slot.Obj())) {
16753 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1");
16754 return false;
16755 }
16756 if (JS::IsResizableArrayBufferMaybeShared(slot.Obj())) {
16757 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1");
16758 return false;
16759 }
16760 } else {
16761 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
16762 return false;
16763 }
16764 }
16765 } else {
16766 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16767 return false;
16768 }
16769 if (objIsXray) {
16770 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16771 // we know Xrays have no dynamic unwrap behavior.
16772 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16773 if (!unwrappedObj.ref()) {
16774 return false;
16775 }
16776 }
16777 FastErrorResult rv;
16778 // NOTE: This assert does NOT call the function.
16779 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16780 MOZ_KnownLive(self)(self)->PassRecordOfArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16781 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfArrayBuffers"
)), 0))
) {
16782 return false;
16783 }
16784 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16784); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16784; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16785 args.rval().setUndefined();
16786 return true;
16787}
16788
16789static const JSJitInfo passRecordOfArrayBuffers_methodinfo = {
16790 { (JSJitGetterOp)passRecordOfArrayBuffers },
16791 { prototypes::id::TestJSImplInterface },
16792 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16793 JSJitInfo::Method,
16794 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16795 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16796 false, /* isInfallible. False in setters. */
16797 false, /* isMovable. Not relevant for setters. */
16798 false, /* isEliminatable. Not relevant for setters. */
16799 false, /* isAlwaysInSlot. Only relevant for getters. */
16800 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16801 false, /* isTypedMethod. Only relevant for methods. */
16802 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16803};
16804
16805MOZ_CAN_RUN_SCRIPT static bool
16806passRecordOfNullableArrayBuffers(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16807{
16808 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableArrayBuffers");
16809 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16812( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16810 "TestJSImplInterface", "passRecordOfNullableArrayBuffers", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16812( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16811 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16812( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
16812 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16812( cx, "TestJSImplInterface"
, "passRecordOfNullableArrayBuffers", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
16813
16814 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16815 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers", 1)) {
16816 return false;
16817 }
16818 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16819 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16820 if (objIsXray) {
16821 unwrappedObj.emplace(cx, obj);
16822 }
16823 Record<nsString, Nullable<ArrayBuffer>> arg0;
16824 RecordRooter<nsString, Nullable<ArrayBuffer>> arg0_holder(cx, &arg0);
16825 if (args[0].isObject()) {
16826 auto& recordEntries = arg0.Entries();
16827
16828 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
16829 JS::RootedVector<jsid> ids(cx);
16830 if (!js::GetPropertyKeys(cx, recordObj,
16831 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
16832 return false;
16833 }
16834 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
16835 JS_ReportOutOfMemory(cx);
16836 return false;
16837 }
16838 JS::Rooted<JS::Value> propNameValue(cx);
16839 JS::Rooted<JS::Value> temp(cx);
16840 JS::Rooted<jsid> curId(cx);
16841 JS::Rooted<JS::Value> idVal(cx);
16842 // Use a hashset to keep track of ids seen, to avoid
16843 // introducing nasty O(N^2) behavior scanning for them all the
16844 // time. Ideally we'd use a data structure with O(1) lookup
16845 // _and_ ordering for the MozMap, but we don't have one lying
16846 // around.
16847 nsTHashtable<nsStringHashKey> idsSeen;
16848 for (size_t i = 0; i < ids.length(); ++i) {
16849 curId = ids[i];
16850
16851 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
16852 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
16853 &desc)) {
16854 return false;
16855 }
16856
16857 if (desc.isNothing() || !desc->enumerable()) {
16858 continue;
16859 }
16860
16861 idVal = js::IdToValue(curId);
16862 nsString propName;
16863 // This will just throw if idVal is a Symbol, like the spec says
16864 // to do.
16865 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
16866 return false;
16867 }
16868
16869 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
16870 return false;
16871 }
16872
16873 Record<nsString, Nullable<ArrayBuffer>>::EntryType* entry;
16874 if (!idsSeen.EnsureInserted(propName)) {
16875 // Find the existing entry.
16876 auto idx = recordEntries.IndexOf(propName);
16877 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 16878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 16878; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
16878 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 16878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 16878; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
16879 // Now blow it away to make it look like it was just added
16880 // to the array, because it's not obvious that it's
16881 // safe to write to its already-initialized mValue via our
16882 // normal codegen conversions. For example, the value
16883 // could be a union and this would change its type, but
16884 // codegen assumes we won't do that.
16885 entry = recordEntries.ReconstructElementAt(idx);
16886 } else {
16887 // Safe to do an infallible append here, because we did a
16888 // SetCapacity above to the right capacity.
16889 entry = recordEntries.AppendElement();
16890 }
16891 entry->mKey = propName;
16892 Nullable<ArrayBuffer>& slot = entry->mValue;
16893 if (temp.isObject()) {
16894 if (!slot.SetValue().Init(&temp.toObject())) {
16895 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value in argument 1", "ArrayBufferOrNull");
16896 return false;
16897 }
16898 if (JS::IsSharedArrayBufferObject(slot.SetValue().Obj())) {
16899 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value in argument 1");
16900 return false;
16901 }
16902 if (JS::IsLargeArrayBufferMaybeShared(slot.SetValue().Obj())) {
16903 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value in argument 1");
16904 return false;
16905 }
16906 if (JS::IsResizableArrayBufferMaybeShared(slot.SetValue().Obj())) {
16907 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value in argument 1");
16908 return false;
16909 }
16910 } else if (temp.isNullOrUndefined()) {
16911 slot.SetNull();
16912 } else {
16913 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
16914 return false;
16915 }
16916 }
16917 } else {
16918 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
16919 return false;
16920 }
16921 if (objIsXray) {
16922 // Since our object is an Xray, we can just CheckedUnwrapStatic:
16923 // we know Xrays have no dynamic unwrap behavior.
16924 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
16925 if (!unwrappedObj.ref()) {
16926 return false;
16927 }
16928 }
16929 FastErrorResult rv;
16930 // NOTE: This assert does NOT call the function.
16931 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
16932 MOZ_KnownLive(self)(self)->PassRecordOfNullableArrayBuffers(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
16933 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableArrayBuffers"
)), 0))
) {
16934 return false;
16935 }
16936 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 16936); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 16936; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
16937 args.rval().setUndefined();
16938 return true;
16939}
16940
16941static const JSJitInfo passRecordOfNullableArrayBuffers_methodinfo = {
16942 { (JSJitGetterOp)passRecordOfNullableArrayBuffers },
16943 { prototypes::id::TestJSImplInterface },
16944 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
16945 JSJitInfo::Method,
16946 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
16947 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
16948 false, /* isInfallible. False in setters. */
16949 false, /* isMovable. Not relevant for setters. */
16950 false, /* isEliminatable. Not relevant for setters. */
16951 false, /* isAlwaysInSlot. Only relevant for getters. */
16952 false, /* isLazilyCachedInSlot. Only relevant for getters. */
16953 false, /* isTypedMethod. Only relevant for methods. */
16954 0 /* Reserved slot index, if we're stored in a slot, else 0. */
16955};
16956
16957MOZ_CAN_RUN_SCRIPT static bool
16958passVariadicTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
16959{
16960 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicTypedArray");
16961 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject16964( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16962 "TestJSImplInterface", "passVariadicTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject16964( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16963 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject16964( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
16964 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject16964( cx, "TestJSImplInterface"
, "passVariadicTypedArray", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
16965
16966 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
16967 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
16968 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
16969 if (objIsXray) {
16970 unwrappedObj.emplace(cx, obj);
16971 }
16972 AutoSequence<Float32Array> arg0;
16973 SequenceRooter<Float32Array> arg0_holder(cx, &arg0);
16974 if (args.length() > 0) {
16975 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
16976 JS_ReportOutOfMemory(cx);
16977 return false;
16978 }
16979 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
16980 // OK to do infallible append here, since we ensured capacity already.
16981 Float32Array& slot = *arg0.AppendElement();
16982 if (args[variadicArg].isObject()) {
16983 if (!slot.Init(&args[variadicArg].toObject())) {
16984 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32Array");
16985 return false;
16986 }
16987 if (JS::IsArrayBufferViewShared(slot.Obj())) {
16988 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
16989 return false;
16990 }
16991 if (JS::IsLargeArrayBufferView(slot.Obj())) {
16992 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
16993 return false;
16994 }
16995 if (JS::IsResizableArrayBufferView(slot.Obj())) {
16996 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
16997 return false;
16998 }
16999 } else {
17000 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
17001 return false;
17002 }
17003 }
17004 }
17005 if (objIsXray) {
17006 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17007 // we know Xrays have no dynamic unwrap behavior.
17008 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17009 if (!unwrappedObj.ref()) {
17010 return false;
17011 }
17012 }
17013 FastErrorResult rv;
17014 // NOTE: This assert does NOT call the function.
17015 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17016 MOZ_KnownLive(self)(self)->PassVariadicTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17017 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicTypedArray"
)), 0))
) {
17018 return false;
17019 }
17020 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17020); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17020; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17021 args.rval().setUndefined();
17022 return true;
17023}
17024
17025static const JSJitInfo passVariadicTypedArray_methodinfo = {
17026 { (JSJitGetterOp)passVariadicTypedArray },
17027 { prototypes::id::TestJSImplInterface },
17028 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17029 JSJitInfo::Method,
17030 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17031 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17032 false, /* isInfallible. False in setters. */
17033 false, /* isMovable. Not relevant for setters. */
17034 false, /* isEliminatable. Not relevant for setters. */
17035 false, /* isAlwaysInSlot. Only relevant for getters. */
17036 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17037 false, /* isTypedMethod. Only relevant for methods. */
17038 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17039};
17040
17041MOZ_CAN_RUN_SCRIPT static bool
17042passVariadicNullableTypedArray(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17043{
17044 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableTypedArray");
17045 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17048( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17046 "TestJSImplInterface", "passVariadicNullableTypedArray", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17048( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17047 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17048( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17048 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17048( cx, "TestJSImplInterface"
, "passVariadicNullableTypedArray", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17049
17050 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17051 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17052 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17053 if (objIsXray) {
17054 unwrappedObj.emplace(cx, obj);
17055 }
17056 AutoSequence<Nullable<Float32Array>> arg0;
17057 SequenceRooter<Nullable<Float32Array>> arg0_holder(cx, &arg0);
17058 if (args.length() > 0) {
17059 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
17060 JS_ReportOutOfMemory(cx);
17061 return false;
17062 }
17063 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
17064 // OK to do infallible append here, since we ensured capacity already.
17065 Nullable<Float32Array>& slot = *arg0.AppendElement();
17066 if (args[variadicArg].isObject()) {
17067 if (!slot.SetValue().Init(&args[variadicArg].toObject())) {
17068 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "Float32ArrayOrNull");
17069 return false;
17070 }
17071 if (JS::IsArrayBufferViewShared(slot.SetValue().Obj())) {
17072 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 1");
17073 return false;
17074 }
17075 if (JS::IsLargeArrayBufferView(slot.SetValue().Obj())) {
17076 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
17077 return false;
17078 }
17079 if (JS::IsResizableArrayBufferView(slot.SetValue().Obj())) {
17080 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
17081 return false;
17082 }
17083 } else if (args[variadicArg].isNullOrUndefined()) {
17084 slot.SetNull();
17085 } else {
17086 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
17087 return false;
17088 }
17089 }
17090 }
17091 if (objIsXray) {
17092 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17093 // we know Xrays have no dynamic unwrap behavior.
17094 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17095 if (!unwrappedObj.ref()) {
17096 return false;
17097 }
17098 }
17099 FastErrorResult rv;
17100 // NOTE: This assert does NOT call the function.
17101 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17102 MOZ_KnownLive(self)(self)->PassVariadicNullableTypedArray(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17103 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableTypedArray"
)), 0))
) {
17104 return false;
17105 }
17106 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17106); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17106; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17107 args.rval().setUndefined();
17108 return true;
17109}
17110
17111static const JSJitInfo passVariadicNullableTypedArray_methodinfo = {
17112 { (JSJitGetterOp)passVariadicNullableTypedArray },
17113 { prototypes::id::TestJSImplInterface },
17114 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17115 JSJitInfo::Method,
17116 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17117 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17118 false, /* isInfallible. False in setters. */
17119 false, /* isMovable. Not relevant for setters. */
17120 false, /* isEliminatable. Not relevant for setters. */
17121 false, /* isAlwaysInSlot. Only relevant for getters. */
17122 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17123 false, /* isTypedMethod. Only relevant for methods. */
17124 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17125};
17126
17127MOZ_CAN_RUN_SCRIPT static bool
17128receiveUint8Array(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17129{
17130 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17133( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17131 "TestJSImplInterface", "receiveUint8Array", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17133( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17132 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17133( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17133 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17133( cx, "TestJSImplInterface"
, "receiveUint8Array", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17134
17135 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17136 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17137 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17138 if (objIsXray) {
17139 unwrappedObj.emplace(cx, obj);
17140 }
17141 if (objIsXray) {
17142 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17143 // we know Xrays have no dynamic unwrap behavior.
17144 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17145 if (!unwrappedObj.ref()) {
17146 return false;
17147 }
17148 }
17149 FastErrorResult rv;
17150 JS::Rooted<JSObject*> result(cx);
17151 // NOTE: This assert does NOT call the function.
17152 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUint8Array(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17153 MOZ_KnownLive(self)(self)->ReceiveUint8Array(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17154 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUint8Array"
)), 0))
) {
17155 return false;
17156 }
17157 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17157); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17157; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17158 JS::ExposeObjectToActiveJS(result);
17159 args.rval().setObject(*result);
17160 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
17161 return false;
17162 }
17163 return true;
17164}
17165
17166static const JSJitInfo receiveUint8Array_methodinfo = {
17167 { (JSJitGetterOp)receiveUint8Array },
17168 { prototypes::id::TestJSImplInterface },
17169 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17170 JSJitInfo::Method,
17171 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17172 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
17173 false, /* isInfallible. False in setters. */
17174 false, /* isMovable. Not relevant for setters. */
17175 false, /* isEliminatable. Not relevant for setters. */
17176 false, /* isAlwaysInSlot. Only relevant for getters. */
17177 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17178 false, /* isTypedMethod. Only relevant for methods. */
17179 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17180};
17181
17182MOZ_CAN_RUN_SCRIPT static bool
17183get_uint8ArrayAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
17184{
17185 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17188( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17186 "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17188( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17187 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject17188( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17188 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17188( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17189
17190 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17191 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17192 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17193 if (objIsXray) {
17194 unwrappedObj.emplace(cx, obj);
17195 }
17196 if (objIsXray) {
17197 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17198 // we know Xrays have no dynamic unwrap behavior.
17199 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17200 if (!unwrappedObj.ref()) {
17201 return false;
17202 }
17203 }
17204 FastErrorResult rv;
17205 JS::Rooted<JSObject*> result(cx);
17206 // NOTE: This assert does NOT call the function.
17207 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17208 MOZ_KnownLive(self)(self)->GetUint8ArrayAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17209 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr getter"
)), 0))
) {
17210 return false;
17211 }
17212 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17212); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17212; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17213 JS::ExposeObjectToActiveJS(result);
17214 args.rval().setObject(*result);
17215 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
17216 return false;
17217 }
17218 return true;
17219}
17220
17221MOZ_CAN_RUN_SCRIPT static bool
17222set_uint8ArrayAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
17223{
17224 BindingCallContext cx(cx_, "TestJSImplInterface.uint8ArrayAttr setter");
17225 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17228( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17226 "TestJSImplInterface", "uint8ArrayAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17228( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17227 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject17228( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17228 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17228( cx, "TestJSImplInterface"
, "uint8ArrayAttr", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17229
17230 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17231 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17232 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17233 if (objIsXray) {
17234 unwrappedObj.emplace(cx, obj);
17235 }
17236 RootedSpiderMonkeyInterface<Uint8Array> arg0(cx);
17237 if (args[0].isObject()) {
17238 if (!arg0.Init(&args[0].toObject())) {
17239 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "Uint8Array");
17240 return false;
17241 }
17242 if (JS::IsArrayBufferViewShared(arg0.Obj())) {
17243 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Value being assigned");
17244 return false;
17245 }
17246 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
17247 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
17248 return false;
17249 }
17250 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
17251 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
17252 return false;
17253 }
17254 } else {
17255 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
17256 return false;
17257 }
17258 if (objIsXray) {
17259 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17260 // we know Xrays have no dynamic unwrap behavior.
17261 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17262 if (!unwrappedObj.ref()) {
17263 return false;
17264 }
17265 }
17266 FastErrorResult rv;
17267 // NOTE: This assert does NOT call the function.
17268 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17269 MOZ_KnownLive(self)(self)->SetUint8ArrayAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17270 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.uint8ArrayAttr setter"
)), 0))
) {
17271 return false;
17272 }
17273 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17273); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17273; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17274
17275 return true;
17276}
17277
17278static const JSJitInfo uint8ArrayAttr_getterinfo = {
17279 { get_uint8ArrayAttr },
17280 { prototypes::id::TestJSImplInterface },
17281 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17282 JSJitInfo::Getter,
17283 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17284 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
17285 false, /* isInfallible. False in setters. */
17286 false, /* isMovable. Not relevant for setters. */
17287 false, /* isEliminatable. Not relevant for setters. */
17288 false, /* isAlwaysInSlot. Only relevant for getters. */
17289 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17290 false, /* isTypedMethod. Only relevant for methods. */
17291 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17292};
17293static const JSJitInfo uint8ArrayAttr_setterinfo = {
17294 { (JSJitGetterOp)set_uint8ArrayAttr },
17295 { prototypes::id::TestJSImplInterface },
17296 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17297 JSJitInfo::Setter,
17298 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17299 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17300 false, /* isInfallible. False in setters. */
17301 false, /* isMovable. Not relevant for setters. */
17302 false, /* isEliminatable. Not relevant for setters. */
17303 false, /* isAlwaysInSlot. Only relevant for getters. */
17304 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17305 false, /* isTypedMethod. Only relevant for methods. */
17306 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17307};
17308
17309MOZ_CAN_RUN_SCRIPT static bool
17310passString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17311{
17312 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17315( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17313 "TestJSImplInterface", "passString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17315( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17314 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17315( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17315 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17315( cx, "TestJSImplInterface"
, "passString", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17316
17317 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17318 if (!args.requireAtLeast(cx, "TestJSImplInterface.passString", 1)) {
17319 return false;
17320 }
17321 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17322 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17323 if (objIsXray) {
17324 unwrappedObj.emplace(cx, obj);
17325 }
17326 binding_detail::FakeString<char16_t> arg0;
17327 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
17328 return false;
17329 }
17330 if (objIsXray) {
17331 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17332 // we know Xrays have no dynamic unwrap behavior.
17333 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17334 if (!unwrappedObj.ref()) {
17335 return false;
17336 }
17337 }
17338 FastErrorResult rv;
17339 // NOTE: This assert does NOT call the function.
17340 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17341 MOZ_KnownLive(self)(self)->PassString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17342 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passString"
)), 0))
) {
17343 return false;
17344 }
17345 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17345); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17345; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17346 args.rval().setUndefined();
17347 return true;
17348}
17349
17350static const JSJitInfo passString_methodinfo = {
17351 { (JSJitGetterOp)passString },
17352 { prototypes::id::TestJSImplInterface },
17353 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17354 JSJitInfo::Method,
17355 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17356 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17357 false, /* isInfallible. False in setters. */
17358 false, /* isMovable. Not relevant for setters. */
17359 false, /* isEliminatable. Not relevant for setters. */
17360 false, /* isAlwaysInSlot. Only relevant for getters. */
17361 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17362 false, /* isTypedMethod. Only relevant for methods. */
17363 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17364};
17365
17366MOZ_CAN_RUN_SCRIPT static bool
17367passNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17368{
17369 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17372( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17370 "TestJSImplInterface", "passNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17372( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17371 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17372( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17372 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17372( cx, "TestJSImplInterface"
, "passNullableString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17373
17374 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17375 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableString", 1)) {
17376 return false;
17377 }
17378 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17379 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17380 if (objIsXray) {
17381 unwrappedObj.emplace(cx, obj);
17382 }
17383 binding_detail::FakeString<char16_t> arg0;
17384 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
17385 return false;
17386 }
17387 if (objIsXray) {
17388 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17389 // we know Xrays have no dynamic unwrap behavior.
17390 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17391 if (!unwrappedObj.ref()) {
17392 return false;
17393 }
17394 }
17395 FastErrorResult rv;
17396 // NOTE: This assert does NOT call the function.
17397 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17398 MOZ_KnownLive(self)(self)->PassNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17399 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableString"
)), 0))
) {
17400 return false;
17401 }
17402 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17402); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17402; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17403 args.rval().setUndefined();
17404 return true;
17405}
17406
17407static const JSJitInfo passNullableString_methodinfo = {
17408 { (JSJitGetterOp)passNullableString },
17409 { prototypes::id::TestJSImplInterface },
17410 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17411 JSJitInfo::Method,
17412 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17413 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17414 false, /* isInfallible. False in setters. */
17415 false, /* isMovable. Not relevant for setters. */
17416 false, /* isEliminatable. Not relevant for setters. */
17417 false, /* isAlwaysInSlot. Only relevant for getters. */
17418 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17419 false, /* isTypedMethod. Only relevant for methods. */
17420 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17421};
17422
17423MOZ_CAN_RUN_SCRIPT static bool
17424passOptionalString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17425{
17426 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17429( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17427 "TestJSImplInterface", "passOptionalString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17429( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17428 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17429( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17429 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17429( cx, "TestJSImplInterface"
, "passOptionalString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17430
17431 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17432 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17433 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17434 if (objIsXray) {
17435 unwrappedObj.emplace(cx, obj);
17436 }
17437 Optional<nsAString> arg0;
17438 binding_detail::FakeString<char16_t> arg0_holder;
17439 if (args.hasDefined(0)) {
17440 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
17441 return false;
17442 }
17443 arg0 = &arg0_holder;
17444 }
17445 if (objIsXray) {
17446 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17447 // we know Xrays have no dynamic unwrap behavior.
17448 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17449 if (!unwrappedObj.ref()) {
17450 return false;
17451 }
17452 }
17453 FastErrorResult rv;
17454 // NOTE: This assert does NOT call the function.
17455 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17456 MOZ_KnownLive(self)(self)->PassOptionalString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17457 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalString"
)), 0))
) {
17458 return false;
17459 }
17460 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17460); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17460; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17461 args.rval().setUndefined();
17462 return true;
17463}
17464
17465static const JSJitInfo passOptionalString_methodinfo = {
17466 { (JSJitGetterOp)passOptionalString },
17467 { prototypes::id::TestJSImplInterface },
17468 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17469 JSJitInfo::Method,
17470 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17471 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17472 false, /* isInfallible. False in setters. */
17473 false, /* isMovable. Not relevant for setters. */
17474 false, /* isEliminatable. Not relevant for setters. */
17475 false, /* isAlwaysInSlot. Only relevant for getters. */
17476 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17477 false, /* isTypedMethod. Only relevant for methods. */
17478 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17479};
17480
17481MOZ_CAN_RUN_SCRIPT static bool
17482passOptionalStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17483{
17484 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17487( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17485 "TestJSImplInterface", "passOptionalStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17487( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17486 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17487( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17487 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17487( cx, "TestJSImplInterface"
, "passOptionalStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17488
17489 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17490 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17491 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17492 if (objIsXray) {
17493 unwrappedObj.emplace(cx, obj);
17494 }
17495 binding_detail::FakeString<char16_t> arg0;
17496 if (args.hasDefined(0)) {
17497 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
17498 return false;
17499 }
17500 } else {
17501 arg0.AssignLiteral(u"abc");
17502 }
17503 if (objIsXray) {
17504 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17505 // we know Xrays have no dynamic unwrap behavior.
17506 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17507 if (!unwrappedObj.ref()) {
17508 return false;
17509 }
17510 }
17511 FastErrorResult rv;
17512 // NOTE: This assert does NOT call the function.
17513 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17514 MOZ_KnownLive(self)(self)->PassOptionalStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17515 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalStringWithDefaultValue"
)), 0))
) {
17516 return false;
17517 }
17518 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17518; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17519 args.rval().setUndefined();
17520 return true;
17521}
17522
17523static const JSJitInfo passOptionalStringWithDefaultValue_methodinfo = {
17524 { (JSJitGetterOp)passOptionalStringWithDefaultValue },
17525 { prototypes::id::TestJSImplInterface },
17526 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17527 JSJitInfo::Method,
17528 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17529 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17530 false, /* isInfallible. False in setters. */
17531 false, /* isMovable. Not relevant for setters. */
17532 false, /* isEliminatable. Not relevant for setters. */
17533 false, /* isAlwaysInSlot. Only relevant for getters. */
17534 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17535 false, /* isTypedMethod. Only relevant for methods. */
17536 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17537};
17538
17539MOZ_CAN_RUN_SCRIPT static bool
17540passOptionalNullableString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17541{
17542 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17545( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17543 "TestJSImplInterface", "passOptionalNullableString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17545( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17544 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17545( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17545 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17545( cx, "TestJSImplInterface"
, "passOptionalNullableString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17546
17547 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17548 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17549 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17550 if (objIsXray) {
17551 unwrappedObj.emplace(cx, obj);
17552 }
17553 Optional<nsAString> arg0;
17554 binding_detail::FakeString<char16_t> arg0_holder;
17555 if (args.hasDefined(0)) {
17556 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
17557 return false;
17558 }
17559 arg0 = &arg0_holder;
17560 }
17561 if (objIsXray) {
17562 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17563 // we know Xrays have no dynamic unwrap behavior.
17564 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17565 if (!unwrappedObj.ref()) {
17566 return false;
17567 }
17568 }
17569 FastErrorResult rv;
17570 // NOTE: This assert does NOT call the function.
17571 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17572 MOZ_KnownLive(self)(self)->PassOptionalNullableString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17573 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableString"
)), 0))
) {
17574 return false;
17575 }
17576 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17576); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17576; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17577 args.rval().setUndefined();
17578 return true;
17579}
17580
17581static const JSJitInfo passOptionalNullableString_methodinfo = {
17582 { (JSJitGetterOp)passOptionalNullableString },
17583 { prototypes::id::TestJSImplInterface },
17584 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17585 JSJitInfo::Method,
17586 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17587 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17588 false, /* isInfallible. False in setters. */
17589 false, /* isMovable. Not relevant for setters. */
17590 false, /* isEliminatable. Not relevant for setters. */
17591 false, /* isAlwaysInSlot. Only relevant for getters. */
17592 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17593 false, /* isTypedMethod. Only relevant for methods. */
17594 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17595};
17596
17597MOZ_CAN_RUN_SCRIPT static bool
17598passOptionalNullableStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17599{
17600 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17603( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17601 "TestJSImplInterface", "passOptionalNullableStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17603( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17602 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17603( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17603 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17603( cx, "TestJSImplInterface"
, "passOptionalNullableStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17604
17605 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17606 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17607 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17608 if (objIsXray) {
17609 unwrappedObj.emplace(cx, obj);
17610 }
17611 binding_detail::FakeString<char16_t> arg0;
17612 if (args.hasDefined(0)) {
17613 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
17614 return false;
17615 }
17616 } else {
17617 arg0.SetIsVoid(true);
17618 }
17619 if (objIsXray) {
17620 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17621 // we know Xrays have no dynamic unwrap behavior.
17622 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17623 if (!unwrappedObj.ref()) {
17624 return false;
17625 }
17626 }
17627 FastErrorResult rv;
17628 // NOTE: This assert does NOT call the function.
17629 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17630 MOZ_KnownLive(self)(self)->PassOptionalNullableStringWithDefaultValue(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17631 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue"
)), 0))
) {
17632 return false;
17633 }
17634 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17634); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17634; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17635 args.rval().setUndefined();
17636 return true;
17637}
17638
17639static const JSJitInfo passOptionalNullableStringWithDefaultValue_methodinfo = {
17640 { (JSJitGetterOp)passOptionalNullableStringWithDefaultValue },
17641 { prototypes::id::TestJSImplInterface },
17642 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17643 JSJitInfo::Method,
17644 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17645 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17646 false, /* isInfallible. False in setters. */
17647 false, /* isMovable. Not relevant for setters. */
17648 false, /* isEliminatable. Not relevant for setters. */
17649 false, /* isAlwaysInSlot. Only relevant for getters. */
17650 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17651 false, /* isTypedMethod. Only relevant for methods. */
17652 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17653};
17654
17655MOZ_CAN_RUN_SCRIPT static bool
17656passVariadicString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17657{
17658 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17661( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17659 "TestJSImplInterface", "passVariadicString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17661( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17660 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17661( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17661 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17661( cx, "TestJSImplInterface"
, "passVariadicString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17662
17663 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17664 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17665 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17666 if (objIsXray) {
17667 unwrappedObj.emplace(cx, obj);
17668 }
17669 AutoSequence<nsString> arg0;
17670 if (args.length() > 0) {
17671 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
17672 JS_ReportOutOfMemory(cx);
17673 return false;
17674 }
17675 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
17676 // OK to do infallible append here, since we ensured capacity already.
17677 nsString& slot = *arg0.AppendElement();
17678 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
17679 return false;
17680 }
17681 }
17682 }
17683 if (objIsXray) {
17684 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17685 // we know Xrays have no dynamic unwrap behavior.
17686 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17687 if (!unwrappedObj.ref()) {
17688 return false;
17689 }
17690 }
17691 FastErrorResult rv;
17692 // NOTE: This assert does NOT call the function.
17693 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17694 MOZ_KnownLive(self)(self)->PassVariadicString(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17695 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicString"
)), 0))
) {
17696 return false;
17697 }
17698 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17698; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17699 args.rval().setUndefined();
17700 return true;
17701}
17702
17703static const JSJitInfo passVariadicString_methodinfo = {
17704 { (JSJitGetterOp)passVariadicString },
17705 { prototypes::id::TestJSImplInterface },
17706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17707 JSJitInfo::Method,
17708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17709 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17710 false, /* isInfallible. False in setters. */
17711 false, /* isMovable. Not relevant for setters. */
17712 false, /* isEliminatable. Not relevant for setters. */
17713 false, /* isAlwaysInSlot. Only relevant for getters. */
17714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17715 false, /* isTypedMethod. Only relevant for methods. */
17716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17717};
17718
17719MOZ_CAN_RUN_SCRIPT static bool
17720passByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17721{
17722 BindingCallContext cx(cx_, "TestJSImplInterface.passByteString");
17723 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17726( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17724 "TestJSImplInterface", "passByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17726( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17725 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17726( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17726 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17726( cx, "TestJSImplInterface"
, "passByteString", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17727
17728 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17729 if (!args.requireAtLeast(cx, "TestJSImplInterface.passByteString", 1)) {
17730 return false;
17731 }
17732 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17733 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17734 if (objIsXray) {
17735 unwrappedObj.emplace(cx, obj);
17736 }
17737 nsCString arg0;
17738 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
17739 return false;
17740 }
17741 if (objIsXray) {
17742 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17743 // we know Xrays have no dynamic unwrap behavior.
17744 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17745 if (!unwrappedObj.ref()) {
17746 return false;
17747 }
17748 }
17749 FastErrorResult rv;
17750 // NOTE: This assert does NOT call the function.
17751 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17752 MOZ_KnownLive(self)(self)->PassByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17753 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passByteString"
)), 0))
) {
17754 return false;
17755 }
17756 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17756); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17756; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17757 args.rval().setUndefined();
17758 return true;
17759}
17760
17761static const JSJitInfo passByteString_methodinfo = {
17762 { (JSJitGetterOp)passByteString },
17763 { prototypes::id::TestJSImplInterface },
17764 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17765 JSJitInfo::Method,
17766 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17767 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17768 false, /* isInfallible. False in setters. */
17769 false, /* isMovable. Not relevant for setters. */
17770 false, /* isEliminatable. Not relevant for setters. */
17771 false, /* isAlwaysInSlot. Only relevant for getters. */
17772 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17773 false, /* isTypedMethod. Only relevant for methods. */
17774 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17775};
17776
17777MOZ_CAN_RUN_SCRIPT static bool
17778passNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17779{
17780 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableByteString");
17781 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17784( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17782 "TestJSImplInterface", "passNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17784( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17783 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17784( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17784 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17784( cx, "TestJSImplInterface"
, "passNullableByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17785
17786 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17787 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableByteString", 1)) {
17788 return false;
17789 }
17790 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17791 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17792 if (objIsXray) {
17793 unwrappedObj.emplace(cx, obj);
17794 }
17795 nsCString arg0;
17796 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) {
17797 return false;
17798 }
17799 if (objIsXray) {
17800 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17801 // we know Xrays have no dynamic unwrap behavior.
17802 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17803 if (!unwrappedObj.ref()) {
17804 return false;
17805 }
17806 }
17807 FastErrorResult rv;
17808 // NOTE: This assert does NOT call the function.
17809 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17810 MOZ_KnownLive(self)(self)->PassNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17811 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableByteString"
)), 0))
) {
17812 return false;
17813 }
17814 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17814); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17814; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17815 args.rval().setUndefined();
17816 return true;
17817}
17818
17819static const JSJitInfo passNullableByteString_methodinfo = {
17820 { (JSJitGetterOp)passNullableByteString },
17821 { prototypes::id::TestJSImplInterface },
17822 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17823 JSJitInfo::Method,
17824 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17825 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17826 false, /* isInfallible. False in setters. */
17827 false, /* isMovable. Not relevant for setters. */
17828 false, /* isEliminatable. Not relevant for setters. */
17829 false, /* isAlwaysInSlot. Only relevant for getters. */
17830 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17831 false, /* isTypedMethod. Only relevant for methods. */
17832 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17833};
17834
17835MOZ_CAN_RUN_SCRIPT static bool
17836passOptionalByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17837{
17838 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteString");
17839 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17842( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17840 "TestJSImplInterface", "passOptionalByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17842( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17841 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17842( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
17842 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17842( cx, "TestJSImplInterface"
, "passOptionalByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
17843
17844 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17845 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17846 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17847 if (objIsXray) {
17848 unwrappedObj.emplace(cx, obj);
17849 }
17850 Optional<nsCString> arg0;
17851 if (args.hasDefined(0)) {
17852 arg0.Construct();
17853 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0.Value())) {
17854 return false;
17855 }
17856 }
17857 if (objIsXray) {
17858 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17859 // we know Xrays have no dynamic unwrap behavior.
17860 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17861 if (!unwrappedObj.ref()) {
17862 return false;
17863 }
17864 }
17865 FastErrorResult rv;
17866 // NOTE: This assert does NOT call the function.
17867 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17868 MOZ_KnownLive(self)(self)->PassOptionalByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17869 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteString"
)), 0))
) {
17870 return false;
17871 }
17872 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17872); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17872; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17873 args.rval().setUndefined();
17874 return true;
17875}
17876
17877static const JSJitInfo passOptionalByteString_methodinfo = {
17878 { (JSJitGetterOp)passOptionalByteString },
17879 { prototypes::id::TestJSImplInterface },
17880 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17881 JSJitInfo::Method,
17882 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17883 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17884 false, /* isInfallible. False in setters. */
17885 false, /* isMovable. Not relevant for setters. */
17886 false, /* isEliminatable. Not relevant for setters. */
17887 false, /* isAlwaysInSlot. Only relevant for getters. */
17888 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17889 false, /* isTypedMethod. Only relevant for methods. */
17890 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17891};
17892
17893MOZ_CAN_RUN_SCRIPT static bool
17894passOptionalByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17895{
17896 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalByteStringWithDefaultValue");
17897 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17900( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17898 "TestJSImplInterface", "passOptionalByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17900( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17899 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17900( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17900 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17900( cx, "TestJSImplInterface"
, "passOptionalByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17901
17902 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17903 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17904 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17905 if (objIsXray) {
17906 unwrappedObj.emplace(cx, obj);
17907 }
17908 nsCString arg0;
17909 if (args.hasDefined(0)) {
17910 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
17911 return false;
17912 }
17913 } else {
17914 arg0.AssignLiteral("abc");
17915 }
17916 if (objIsXray) {
17917 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17918 // we know Xrays have no dynamic unwrap behavior.
17919 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17920 if (!unwrappedObj.ref()) {
17921 return false;
17922 }
17923 }
17924 FastErrorResult rv;
17925 // NOTE: This assert does NOT call the function.
17926 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17927 MOZ_KnownLive(self)(self)->PassOptionalByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17928 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalByteStringWithDefaultValue"
)), 0))
) {
17929 return false;
17930 }
17931 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17931); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17931; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17932 args.rval().setUndefined();
17933 return true;
17934}
17935
17936static const JSJitInfo passOptionalByteStringWithDefaultValue_methodinfo = {
17937 { (JSJitGetterOp)passOptionalByteStringWithDefaultValue },
17938 { prototypes::id::TestJSImplInterface },
17939 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17940 JSJitInfo::Method,
17941 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
17942 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
17943 false, /* isInfallible. False in setters. */
17944 false, /* isMovable. Not relevant for setters. */
17945 false, /* isEliminatable. Not relevant for setters. */
17946 false, /* isAlwaysInSlot. Only relevant for getters. */
17947 false, /* isLazilyCachedInSlot. Only relevant for getters. */
17948 false, /* isTypedMethod. Only relevant for methods. */
17949 0 /* Reserved slot index, if we're stored in a slot, else 0. */
17950};
17951
17952MOZ_CAN_RUN_SCRIPT static bool
17953passOptionalNullableByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
17954{
17955 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteString");
17956 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject17959( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17957 "TestJSImplInterface", "passOptionalNullableByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject17959( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17958 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject17959( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
17959 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject17959( cx, "TestJSImplInterface"
, "passOptionalNullableByteString", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
17960
17961 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
17962 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
17963 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
17964 if (objIsXray) {
17965 unwrappedObj.emplace(cx, obj);
17966 }
17967 Optional<nsCString> arg0;
17968 if (args.hasDefined(0)) {
17969 arg0.Construct();
17970 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0.Value())) {
17971 return false;
17972 }
17973 }
17974 if (objIsXray) {
17975 // Since our object is an Xray, we can just CheckedUnwrapStatic:
17976 // we know Xrays have no dynamic unwrap behavior.
17977 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
17978 if (!unwrappedObj.ref()) {
17979 return false;
17980 }
17981 }
17982 FastErrorResult rv;
17983 // NOTE: This assert does NOT call the function.
17984 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
17985 MOZ_KnownLive(self)(self)->PassOptionalNullableByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
17986 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteString"
)), 0))
) {
17987 return false;
17988 }
17989 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 17989); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 17989; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
17990 args.rval().setUndefined();
17991 return true;
17992}
17993
17994static const JSJitInfo passOptionalNullableByteString_methodinfo = {
17995 { (JSJitGetterOp)passOptionalNullableByteString },
17996 { prototypes::id::TestJSImplInterface },
17997 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
17998 JSJitInfo::Method,
17999 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18000 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18001 false, /* isInfallible. False in setters. */
18002 false, /* isMovable. Not relevant for setters. */
18003 false, /* isEliminatable. Not relevant for setters. */
18004 false, /* isAlwaysInSlot. Only relevant for getters. */
18005 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18006 false, /* isTypedMethod. Only relevant for methods. */
18007 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18008};
18009
18010MOZ_CAN_RUN_SCRIPT static bool
18011passOptionalNullableByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18012{
18013 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue");
18014 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18017( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18015 "TestJSImplInterface", "passOptionalNullableByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18017( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18016 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18017( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18017 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18017( cx, "TestJSImplInterface"
, "passOptionalNullableByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18018
18019 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18020 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18021 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18022 if (objIsXray) {
18023 unwrappedObj.emplace(cx, obj);
18024 }
18025 nsCString arg0;
18026 if (args.hasDefined(0)) {
18027 if (!ConvertJSValueToByteString(cx, args[0], true, "argument 1", arg0)) {
18028 return false;
18029 }
18030 } else {
18031 arg0.SetIsVoid(true);
18032 }
18033 if (objIsXray) {
18034 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18035 // we know Xrays have no dynamic unwrap behavior.
18036 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18037 if (!unwrappedObj.ref()) {
18038 return false;
18039 }
18040 }
18041 FastErrorResult rv;
18042 // NOTE: This assert does NOT call the function.
18043 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18044 MOZ_KnownLive(self)(self)->PassOptionalNullableByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18045 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue"
)), 0))
) {
18046 return false;
18047 }
18048 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18048; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18049 args.rval().setUndefined();
18050 return true;
18051}
18052
18053static const JSJitInfo passOptionalNullableByteStringWithDefaultValue_methodinfo = {
18054 { (JSJitGetterOp)passOptionalNullableByteStringWithDefaultValue },
18055 { prototypes::id::TestJSImplInterface },
18056 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18057 JSJitInfo::Method,
18058 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18059 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18060 false, /* isInfallible. False in setters. */
18061 false, /* isMovable. Not relevant for setters. */
18062 false, /* isEliminatable. Not relevant for setters. */
18063 false, /* isAlwaysInSlot. Only relevant for getters. */
18064 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18065 false, /* isTypedMethod. Only relevant for methods. */
18066 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18067};
18068
18069MOZ_CAN_RUN_SCRIPT static bool
18070passVariadicByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18071{
18072 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicByteString");
18073 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18076( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18074 "TestJSImplInterface", "passVariadicByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18076( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18075 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18076( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18076 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18076( cx, "TestJSImplInterface"
, "passVariadicByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18077
18078 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18079 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18080 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18081 if (objIsXray) {
18082 unwrappedObj.emplace(cx, obj);
18083 }
18084 AutoSequence<nsCString> arg0;
18085 if (args.length() > 0) {
18086 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
18087 JS_ReportOutOfMemory(cx);
18088 return false;
18089 }
18090 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
18091 // OK to do infallible append here, since we ensured capacity already.
18092 nsCString& slot = *arg0.AppendElement();
18093 if (!ConvertJSValueToByteString(cx, args[variadicArg], false, "argument 1", slot)) {
18094 return false;
18095 }
18096 }
18097 }
18098 if (objIsXray) {
18099 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18100 // we know Xrays have no dynamic unwrap behavior.
18101 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18102 if (!unwrappedObj.ref()) {
18103 return false;
18104 }
18105 }
18106 FastErrorResult rv;
18107 // NOTE: This assert does NOT call the function.
18108 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18109 MOZ_KnownLive(self)(self)->PassVariadicByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18110 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicByteString"
)), 0))
) {
18111 return false;
18112 }
18113 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18113); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18113; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18114 args.rval().setUndefined();
18115 return true;
18116}
18117
18118static const JSJitInfo passVariadicByteString_methodinfo = {
18119 { (JSJitGetterOp)passVariadicByteString },
18120 { prototypes::id::TestJSImplInterface },
18121 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18122 JSJitInfo::Method,
18123 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18124 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18125 false, /* isInfallible. False in setters. */
18126 false, /* isMovable. Not relevant for setters. */
18127 false, /* isEliminatable. Not relevant for setters. */
18128 false, /* isAlwaysInSlot. Only relevant for getters. */
18129 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18130 false, /* isTypedMethod. Only relevant for methods. */
18131 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18132};
18133
18134MOZ_CAN_RUN_SCRIPT static bool
18135passUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18136{
18137 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionByteString");
18138 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18141( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18139 "TestJSImplInterface", "passUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18141( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18140 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18141( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18141 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18141( cx, "TestJSImplInterface"
, "passUnionByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18142
18143 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18144 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionByteString", 1)) {
18145 return false;
18146 }
18147 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18148 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18149 if (objIsXray) {
18150 unwrappedObj.emplace(cx, obj);
18151 }
18152 ByteStringOrLong arg0;
18153 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18154 return false;
18155 }
18156 if (objIsXray) {
18157 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18158 // we know Xrays have no dynamic unwrap behavior.
18159 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18160 if (!unwrappedObj.ref()) {
18161 return false;
18162 }
18163 }
18164 FastErrorResult rv;
18165 // NOTE: This assert does NOT call the function.
18166 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18167 MOZ_KnownLive(self)(self)->PassUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18168 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionByteString"
)), 0))
) {
18169 return false;
18170 }
18171 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18171; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18172 args.rval().setUndefined();
18173 return true;
18174}
18175
18176static const JSJitInfo passUnionByteString_methodinfo = {
18177 { (JSJitGetterOp)passUnionByteString },
18178 { prototypes::id::TestJSImplInterface },
18179 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18180 JSJitInfo::Method,
18181 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18182 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18183 false, /* isInfallible. False in setters. */
18184 false, /* isMovable. Not relevant for setters. */
18185 false, /* isEliminatable. Not relevant for setters. */
18186 false, /* isAlwaysInSlot. Only relevant for getters. */
18187 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18188 false, /* isTypedMethod. Only relevant for methods. */
18189 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18190};
18191
18192MOZ_CAN_RUN_SCRIPT static bool
18193passOptionalUnionByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18194{
18195 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteString");
18196 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18199( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18197 "TestJSImplInterface", "passOptionalUnionByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18199( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18198 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18199( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18199 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18199( cx, "TestJSImplInterface"
, "passOptionalUnionByteString", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18200
18201 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18202 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18203 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18204 if (objIsXray) {
18205 unwrappedObj.emplace(cx, obj);
18206 }
18207 Optional<ByteStringOrLong> arg0;
18208 if (args.hasDefined(0)) {
18209 arg0.Construct();
18210 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
18211 return false;
18212 }
18213 }
18214 if (objIsXray) {
18215 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18216 // we know Xrays have no dynamic unwrap behavior.
18217 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18218 if (!unwrappedObj.ref()) {
18219 return false;
18220 }
18221 }
18222 FastErrorResult rv;
18223 // NOTE: This assert does NOT call the function.
18224 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18225 MOZ_KnownLive(self)(self)->PassOptionalUnionByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18226 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteString"
)), 0))
) {
18227 return false;
18228 }
18229 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18229); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18229; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18230 args.rval().setUndefined();
18231 return true;
18232}
18233
18234static const JSJitInfo passOptionalUnionByteString_methodinfo = {
18235 { (JSJitGetterOp)passOptionalUnionByteString },
18236 { prototypes::id::TestJSImplInterface },
18237 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18238 JSJitInfo::Method,
18239 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18240 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18241 false, /* isInfallible. False in setters. */
18242 false, /* isMovable. Not relevant for setters. */
18243 false, /* isEliminatable. Not relevant for setters. */
18244 false, /* isAlwaysInSlot. Only relevant for getters. */
18245 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18246 false, /* isTypedMethod. Only relevant for methods. */
18247 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18248};
18249
18250MOZ_CAN_RUN_SCRIPT static bool
18251passOptionalUnionByteStringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18252{
18253 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue");
18254 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18257( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18255 "TestJSImplInterface", "passOptionalUnionByteStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18257( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18256 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18257( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18257 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18257( cx, "TestJSImplInterface"
, "passOptionalUnionByteStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18258
18259 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18260 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18261 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18262 if (objIsXray) {
18263 unwrappedObj.emplace(cx, obj);
18264 }
18265 ByteStringOrLong arg0;
18266 if (!(args.hasDefined(0))) {
18267 arg0.SetStringLiteral("abc");
18268 } else {
18269 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18270 return false;
18271 }
18272 }
18273 if (objIsXray) {
18274 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18275 // we know Xrays have no dynamic unwrap behavior.
18276 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18277 if (!unwrappedObj.ref()) {
18278 return false;
18279 }
18280 }
18281 FastErrorResult rv;
18282 // NOTE: This assert does NOT call the function.
18283 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18284 MOZ_KnownLive(self)(self)->PassOptionalUnionByteStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18285 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue"
)), 0))
) {
18286 return false;
18287 }
18288 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18288); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18288; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18289 args.rval().setUndefined();
18290 return true;
18291}
18292
18293static const JSJitInfo passOptionalUnionByteStringWithDefaultValue_methodinfo = {
18294 { (JSJitGetterOp)passOptionalUnionByteStringWithDefaultValue },
18295 { prototypes::id::TestJSImplInterface },
18296 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18297 JSJitInfo::Method,
18298 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18299 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18300 false, /* isInfallible. False in setters. */
18301 false, /* isMovable. Not relevant for setters. */
18302 false, /* isEliminatable. Not relevant for setters. */
18303 false, /* isAlwaysInSlot. Only relevant for getters. */
18304 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18305 false, /* isTypedMethod. Only relevant for methods. */
18306 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18307};
18308
18309MOZ_CAN_RUN_SCRIPT static bool
18310passUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18311{
18312 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18315( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18313 "TestJSImplInterface", "passUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18315( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18314 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18315( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18315 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18315( cx, "TestJSImplInterface"
, "passUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18316
18317 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18318 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUTF8String", 1)) {
18319 return false;
18320 }
18321 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18322 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18323 if (objIsXray) {
18324 unwrappedObj.emplace(cx, obj);
18325 }
18326 binding_detail::FakeString<char> arg0;
18327 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
18328 return false;
18329 }
18330 if (objIsXray) {
18331 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18332 // we know Xrays have no dynamic unwrap behavior.
18333 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18334 if (!unwrappedObj.ref()) {
18335 return false;
18336 }
18337 }
18338 FastErrorResult rv;
18339 // NOTE: This assert does NOT call the function.
18340 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18341 MOZ_KnownLive(self)(self)->PassUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18342 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUTF8String"
)), 0))
) {
18343 return false;
18344 }
18345 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18345); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18345; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18346 args.rval().setUndefined();
18347 return true;
18348}
18349
18350static const JSJitInfo passUTF8String_methodinfo = {
18351 { (JSJitGetterOp)passUTF8String },
18352 { prototypes::id::TestJSImplInterface },
18353 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18354 JSJitInfo::Method,
18355 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18356 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18357 false, /* isInfallible. False in setters. */
18358 false, /* isMovable. Not relevant for setters. */
18359 false, /* isEliminatable. Not relevant for setters. */
18360 false, /* isAlwaysInSlot. Only relevant for getters. */
18361 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18362 false, /* isTypedMethod. Only relevant for methods. */
18363 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18364};
18365
18366MOZ_CAN_RUN_SCRIPT static bool
18367passNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18368{
18369 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18372( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18370 "TestJSImplInterface", "passNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18372( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18371 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18372( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18372 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18372( cx, "TestJSImplInterface"
, "passNullableUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18373
18374 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18375 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUTF8String", 1)) {
18376 return false;
18377 }
18378 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18379 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18380 if (objIsXray) {
18381 unwrappedObj.emplace(cx, obj);
18382 }
18383 binding_detail::FakeString<char> arg0;
18384 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
18385 return false;
18386 }
18387 if (objIsXray) {
18388 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18389 // we know Xrays have no dynamic unwrap behavior.
18390 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18391 if (!unwrappedObj.ref()) {
18392 return false;
18393 }
18394 }
18395 FastErrorResult rv;
18396 // NOTE: This assert does NOT call the function.
18397 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18398 MOZ_KnownLive(self)(self)->PassNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18399 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUTF8String"
)), 0))
) {
18400 return false;
18401 }
18402 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18402); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18402; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18403 args.rval().setUndefined();
18404 return true;
18405}
18406
18407static const JSJitInfo passNullableUTF8String_methodinfo = {
18408 { (JSJitGetterOp)passNullableUTF8String },
18409 { prototypes::id::TestJSImplInterface },
18410 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18411 JSJitInfo::Method,
18412 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18413 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18414 false, /* isInfallible. False in setters. */
18415 false, /* isMovable. Not relevant for setters. */
18416 false, /* isEliminatable. Not relevant for setters. */
18417 false, /* isAlwaysInSlot. Only relevant for getters. */
18418 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18419 false, /* isTypedMethod. Only relevant for methods. */
18420 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18421};
18422
18423MOZ_CAN_RUN_SCRIPT static bool
18424passOptionalUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18425{
18426 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18429( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18427 "TestJSImplInterface", "passOptionalUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18429( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18428 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18429( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18429 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18429( cx, "TestJSImplInterface"
, "passOptionalUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18430
18431 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18432 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18433 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18434 if (objIsXray) {
18435 unwrappedObj.emplace(cx, obj);
18436 }
18437 Optional<nsACString> arg0;
18438 binding_detail::FakeString<char> arg0_holder;
18439 if (args.hasDefined(0)) {
18440 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
18441 return false;
18442 }
18443 arg0 = &arg0_holder;
18444 }
18445 if (objIsXray) {
18446 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18447 // we know Xrays have no dynamic unwrap behavior.
18448 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18449 if (!unwrappedObj.ref()) {
18450 return false;
18451 }
18452 }
18453 FastErrorResult rv;
18454 // NOTE: This assert does NOT call the function.
18455 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18456 MOZ_KnownLive(self)(self)->PassOptionalUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18457 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8String"
)), 0))
) {
18458 return false;
18459 }
18460 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18460); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18460; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18461 args.rval().setUndefined();
18462 return true;
18463}
18464
18465static const JSJitInfo passOptionalUTF8String_methodinfo = {
18466 { (JSJitGetterOp)passOptionalUTF8String },
18467 { prototypes::id::TestJSImplInterface },
18468 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18469 JSJitInfo::Method,
18470 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18471 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18472 false, /* isInfallible. False in setters. */
18473 false, /* isMovable. Not relevant for setters. */
18474 false, /* isEliminatable. Not relevant for setters. */
18475 false, /* isAlwaysInSlot. Only relevant for getters. */
18476 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18477 false, /* isTypedMethod. Only relevant for methods. */
18478 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18479};
18480
18481MOZ_CAN_RUN_SCRIPT static bool
18482passOptionalUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18483{
18484 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18487( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18485 "TestJSImplInterface", "passOptionalUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18487( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18486 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18487( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18487 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18487( cx, "TestJSImplInterface"
, "passOptionalUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18488
18489 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18490 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18491 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18492 if (objIsXray) {
18493 unwrappedObj.emplace(cx, obj);
18494 }
18495 binding_detail::FakeString<char> arg0;
18496 if (args.hasDefined(0)) {
18497 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
18498 return false;
18499 }
18500 } else {
18501 arg0.AssignLiteral("abc");
18502 }
18503 if (objIsXray) {
18504 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18505 // we know Xrays have no dynamic unwrap behavior.
18506 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18507 if (!unwrappedObj.ref()) {
18508 return false;
18509 }
18510 }
18511 FastErrorResult rv;
18512 // NOTE: This assert does NOT call the function.
18513 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18514 MOZ_KnownLive(self)(self)->PassOptionalUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18515 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue"
)), 0))
) {
18516 return false;
18517 }
18518 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18518; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18519 args.rval().setUndefined();
18520 return true;
18521}
18522
18523static const JSJitInfo passOptionalUTF8StringWithDefaultValue_methodinfo = {
18524 { (JSJitGetterOp)passOptionalUTF8StringWithDefaultValue },
18525 { prototypes::id::TestJSImplInterface },
18526 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18527 JSJitInfo::Method,
18528 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18529 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18530 false, /* isInfallible. False in setters. */
18531 false, /* isMovable. Not relevant for setters. */
18532 false, /* isEliminatable. Not relevant for setters. */
18533 false, /* isAlwaysInSlot. Only relevant for getters. */
18534 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18535 false, /* isTypedMethod. Only relevant for methods. */
18536 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18537};
18538
18539MOZ_CAN_RUN_SCRIPT static bool
18540passOptionalNullableUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18541{
18542 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18545( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18543 "TestJSImplInterface", "passOptionalNullableUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18545( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18544 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18545( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18545 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18545( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8String", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18546
18547 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18548 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18549 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18550 if (objIsXray) {
18551 unwrappedObj.emplace(cx, obj);
18552 }
18553 Optional<nsACString> arg0;
18554 binding_detail::FakeString<char> arg0_holder;
18555 if (args.hasDefined(0)) {
18556 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
18557 return false;
18558 }
18559 arg0 = &arg0_holder;
18560 }
18561 if (objIsXray) {
18562 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18563 // we know Xrays have no dynamic unwrap behavior.
18564 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18565 if (!unwrappedObj.ref()) {
18566 return false;
18567 }
18568 }
18569 FastErrorResult rv;
18570 // NOTE: This assert does NOT call the function.
18571 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18572 MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18573 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8String"
)), 0))
) {
18574 return false;
18575 }
18576 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18576); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18576; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18577 args.rval().setUndefined();
18578 return true;
18579}
18580
18581static const JSJitInfo passOptionalNullableUTF8String_methodinfo = {
18582 { (JSJitGetterOp)passOptionalNullableUTF8String },
18583 { prototypes::id::TestJSImplInterface },
18584 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18585 JSJitInfo::Method,
18586 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18587 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18588 false, /* isInfallible. False in setters. */
18589 false, /* isMovable. Not relevant for setters. */
18590 false, /* isEliminatable. Not relevant for setters. */
18591 false, /* isAlwaysInSlot. Only relevant for getters. */
18592 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18593 false, /* isTypedMethod. Only relevant for methods. */
18594 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18595};
18596
18597MOZ_CAN_RUN_SCRIPT static bool
18598passOptionalNullableUTF8StringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18599{
18600 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18603( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18601 "TestJSImplInterface", "passOptionalNullableUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18603( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18602 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18603( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18603 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18603( cx, "TestJSImplInterface"
, "passOptionalNullableUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18604
18605 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18606 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18607 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18608 if (objIsXray) {
18609 unwrappedObj.emplace(cx, obj);
18610 }
18611 binding_detail::FakeString<char> arg0;
18612 if (args.hasDefined(0)) {
18613 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
18614 return false;
18615 }
18616 } else {
18617 arg0.SetIsVoid(true);
18618 }
18619 if (objIsXray) {
18620 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18621 // we know Xrays have no dynamic unwrap behavior.
18622 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18623 if (!unwrappedObj.ref()) {
18624 return false;
18625 }
18626 }
18627 FastErrorResult rv;
18628 // NOTE: This assert does NOT call the function.
18629 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18630 MOZ_KnownLive(self)(self)->PassOptionalNullableUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18631 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue"
)), 0))
) {
18632 return false;
18633 }
18634 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18634); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18634; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18635 args.rval().setUndefined();
18636 return true;
18637}
18638
18639static const JSJitInfo passOptionalNullableUTF8StringWithDefaultValue_methodinfo = {
18640 { (JSJitGetterOp)passOptionalNullableUTF8StringWithDefaultValue },
18641 { prototypes::id::TestJSImplInterface },
18642 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18643 JSJitInfo::Method,
18644 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18645 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18646 false, /* isInfallible. False in setters. */
18647 false, /* isMovable. Not relevant for setters. */
18648 false, /* isEliminatable. Not relevant for setters. */
18649 false, /* isAlwaysInSlot. Only relevant for getters. */
18650 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18651 false, /* isTypedMethod. Only relevant for methods. */
18652 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18653};
18654
18655MOZ_CAN_RUN_SCRIPT static bool
18656passVariadicUTF8String(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18657{
18658 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18661( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18659 "TestJSImplInterface", "passVariadicUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18661( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18660 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18661( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18661 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18661( cx, "TestJSImplInterface"
, "passVariadicUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18662
18663 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18664 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18665 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18666 if (objIsXray) {
18667 unwrappedObj.emplace(cx, obj);
18668 }
18669 AutoSequence<nsCString> arg0;
18670 if (args.length() > 0) {
18671 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
18672 JS_ReportOutOfMemory(cx);
18673 return false;
18674 }
18675 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
18676 // OK to do infallible append here, since we ensured capacity already.
18677 nsCString& slot = *arg0.AppendElement();
18678 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
18679 return false;
18680 }
18681 }
18682 }
18683 if (objIsXray) {
18684 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18685 // we know Xrays have no dynamic unwrap behavior.
18686 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18687 if (!unwrappedObj.ref()) {
18688 return false;
18689 }
18690 }
18691 FastErrorResult rv;
18692 // NOTE: This assert does NOT call the function.
18693 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18694 MOZ_KnownLive(self)(self)->PassVariadicUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18695 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUTF8String"
)), 0))
) {
18696 return false;
18697 }
18698 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18698); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18698; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18699 args.rval().setUndefined();
18700 return true;
18701}
18702
18703static const JSJitInfo passVariadicUTF8String_methodinfo = {
18704 { (JSJitGetterOp)passVariadicUTF8String },
18705 { prototypes::id::TestJSImplInterface },
18706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18707 JSJitInfo::Method,
18708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18709 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18710 false, /* isInfallible. False in setters. */
18711 false, /* isMovable. Not relevant for setters. */
18712 false, /* isEliminatable. Not relevant for setters. */
18713 false, /* isAlwaysInSlot. Only relevant for getters. */
18714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18715 false, /* isTypedMethod. Only relevant for methods. */
18716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18717};
18718
18719MOZ_CAN_RUN_SCRIPT static bool
18720passUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18721{
18722 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionUTF8String");
18723 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18726( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18724 "TestJSImplInterface", "passUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18726( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18725 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18726( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18726 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18726( cx, "TestJSImplInterface"
, "passUnionUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18727
18728 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18729 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionUTF8String", 1)) {
18730 return false;
18731 }
18732 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18733 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18734 if (objIsXray) {
18735 unwrappedObj.emplace(cx, obj);
18736 }
18737 UTF8StringOrLong arg0;
18738 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18739 return false;
18740 }
18741 if (objIsXray) {
18742 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18743 // we know Xrays have no dynamic unwrap behavior.
18744 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18745 if (!unwrappedObj.ref()) {
18746 return false;
18747 }
18748 }
18749 FastErrorResult rv;
18750 // NOTE: This assert does NOT call the function.
18751 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18752 MOZ_KnownLive(self)(self)->PassUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18753 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionUTF8String"
)), 0))
) {
18754 return false;
18755 }
18756 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18756); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18756; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18757 args.rval().setUndefined();
18758 return true;
18759}
18760
18761static const JSJitInfo passUnionUTF8String_methodinfo = {
18762 { (JSJitGetterOp)passUnionUTF8String },
18763 { prototypes::id::TestJSImplInterface },
18764 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18765 JSJitInfo::Method,
18766 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18767 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18768 false, /* isInfallible. False in setters. */
18769 false, /* isMovable. Not relevant for setters. */
18770 false, /* isEliminatable. Not relevant for setters. */
18771 false, /* isAlwaysInSlot. Only relevant for getters. */
18772 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18773 false, /* isTypedMethod. Only relevant for methods. */
18774 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18775};
18776
18777MOZ_CAN_RUN_SCRIPT static bool
18778passOptionalUnionUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18779{
18780 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8String");
18781 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18784( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18782 "TestJSImplInterface", "passOptionalUnionUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18784( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18783 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18784( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18784 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18784( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8String", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18785
18786 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18787 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18788 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18789 if (objIsXray) {
18790 unwrappedObj.emplace(cx, obj);
18791 }
18792 Optional<UTF8StringOrLong> arg0;
18793 if (args.hasDefined(0)) {
18794 arg0.Construct();
18795 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
18796 return false;
18797 }
18798 }
18799 if (objIsXray) {
18800 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18801 // we know Xrays have no dynamic unwrap behavior.
18802 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18803 if (!unwrappedObj.ref()) {
18804 return false;
18805 }
18806 }
18807 FastErrorResult rv;
18808 // NOTE: This assert does NOT call the function.
18809 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18810 MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18811 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8String"
)), 0))
) {
18812 return false;
18813 }
18814 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18814); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18814; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18815 args.rval().setUndefined();
18816 return true;
18817}
18818
18819static const JSJitInfo passOptionalUnionUTF8String_methodinfo = {
18820 { (JSJitGetterOp)passOptionalUnionUTF8String },
18821 { prototypes::id::TestJSImplInterface },
18822 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18823 JSJitInfo::Method,
18824 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18825 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18826 false, /* isInfallible. False in setters. */
18827 false, /* isMovable. Not relevant for setters. */
18828 false, /* isEliminatable. Not relevant for setters. */
18829 false, /* isAlwaysInSlot. Only relevant for getters. */
18830 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18831 false, /* isTypedMethod. Only relevant for methods. */
18832 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18833};
18834
18835MOZ_CAN_RUN_SCRIPT static bool
18836passOptionalUnionUTF8StringWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18837{
18838 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue");
18839 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18842( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18840 "TestJSImplInterface", "passOptionalUnionUTF8StringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18842( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18841 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18842( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
18842 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18842( cx, "TestJSImplInterface"
, "passOptionalUnionUTF8StringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
18843
18844 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18845 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18846 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18847 if (objIsXray) {
18848 unwrappedObj.emplace(cx, obj);
18849 }
18850 UTF8StringOrLong arg0;
18851 if (!(args.hasDefined(0))) {
18852 arg0.SetStringLiteral("abc");
18853 } else {
18854 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
18855 return false;
18856 }
18857 }
18858 if (objIsXray) {
18859 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18860 // we know Xrays have no dynamic unwrap behavior.
18861 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18862 if (!unwrappedObj.ref()) {
18863 return false;
18864 }
18865 }
18866 FastErrorResult rv;
18867 // NOTE: This assert does NOT call the function.
18868 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18869 MOZ_KnownLive(self)(self)->PassOptionalUnionUTF8StringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18870 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue"
)), 0))
) {
18871 return false;
18872 }
18873 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18873); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18873; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18874 args.rval().setUndefined();
18875 return true;
18876}
18877
18878static const JSJitInfo passOptionalUnionUTF8StringWithDefaultValue_methodinfo = {
18879 { (JSJitGetterOp)passOptionalUnionUTF8StringWithDefaultValue },
18880 { prototypes::id::TestJSImplInterface },
18881 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18882 JSJitInfo::Method,
18883 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18884 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18885 false, /* isInfallible. False in setters. */
18886 false, /* isMovable. Not relevant for setters. */
18887 false, /* isEliminatable. Not relevant for setters. */
18888 false, /* isAlwaysInSlot. Only relevant for getters. */
18889 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18890 false, /* isTypedMethod. Only relevant for methods. */
18891 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18892};
18893
18894MOZ_CAN_RUN_SCRIPT static bool
18895passSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18896{
18897 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18900( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18898 "TestJSImplInterface", "passSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18900( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18899 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18900( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
18900 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18900( cx, "TestJSImplInterface"
, "passSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
18901
18902 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18903 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSVS", 1)) {
18904 return false;
18905 }
18906 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18907 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18908 if (objIsXray) {
18909 unwrappedObj.emplace(cx, obj);
18910 }
18911 binding_detail::FakeString<char16_t> arg0;
18912 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
18913 return false;
18914 }
18915 if (!NormalizeUSVString(arg0)) {
18916 JS_ReportOutOfMemory(cx);
18917 return false;
18918 }
18919 if (objIsXray) {
18920 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18921 // we know Xrays have no dynamic unwrap behavior.
18922 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18923 if (!unwrappedObj.ref()) {
18924 return false;
18925 }
18926 }
18927 FastErrorResult rv;
18928 // NOTE: This assert does NOT call the function.
18929 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18930 MOZ_KnownLive(self)(self)->PassSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18931 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSVS"
)), 0))
) {
18932 return false;
18933 }
18934 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18934); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18934; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18935 args.rval().setUndefined();
18936 return true;
18937}
18938
18939static const JSJitInfo passSVS_methodinfo = {
18940 { (JSJitGetterOp)passSVS },
18941 { prototypes::id::TestJSImplInterface },
18942 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
18943 JSJitInfo::Method,
18944 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
18945 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
18946 false, /* isInfallible. False in setters. */
18947 false, /* isMovable. Not relevant for setters. */
18948 false, /* isEliminatable. Not relevant for setters. */
18949 false, /* isAlwaysInSlot. Only relevant for getters. */
18950 false, /* isLazilyCachedInSlot. Only relevant for getters. */
18951 false, /* isTypedMethod. Only relevant for methods. */
18952 0 /* Reserved slot index, if we're stored in a slot, else 0. */
18953};
18954
18955MOZ_CAN_RUN_SCRIPT static bool
18956passNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
18957{
18958 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject18961( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18959 "TestJSImplInterface", "passNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject18961( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18960 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject18961( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
18961 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject18961( cx, "TestJSImplInterface"
, "passNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
18962
18963 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
18964 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSVS", 1)) {
18965 return false;
18966 }
18967 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
18968 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
18969 if (objIsXray) {
18970 unwrappedObj.emplace(cx, obj);
18971 }
18972 binding_detail::FakeString<char16_t> arg0;
18973 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
18974 return false;
18975 }
18976 if (!NormalizeUSVString(arg0)) {
18977 JS_ReportOutOfMemory(cx);
18978 return false;
18979 }
18980 if (objIsXray) {
18981 // Since our object is an Xray, we can just CheckedUnwrapStatic:
18982 // we know Xrays have no dynamic unwrap behavior.
18983 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
18984 if (!unwrappedObj.ref()) {
18985 return false;
18986 }
18987 }
18988 FastErrorResult rv;
18989 // NOTE: This assert does NOT call the function.
18990 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
18991 MOZ_KnownLive(self)(self)->PassNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
18992 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSVS"
)), 0))
) {
18993 return false;
18994 }
18995 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 18995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 18995; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
18996 args.rval().setUndefined();
18997 return true;
18998}
18999
19000static const JSJitInfo passNullableSVS_methodinfo = {
19001 { (JSJitGetterOp)passNullableSVS },
19002 { prototypes::id::TestJSImplInterface },
19003 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19004 JSJitInfo::Method,
19005 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19006 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19007 false, /* isInfallible. False in setters. */
19008 false, /* isMovable. Not relevant for setters. */
19009 false, /* isEliminatable. Not relevant for setters. */
19010 false, /* isAlwaysInSlot. Only relevant for getters. */
19011 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19012 false, /* isTypedMethod. Only relevant for methods. */
19013 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19014};
19015
19016MOZ_CAN_RUN_SCRIPT static bool
19017passOptionalSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19018{
19019 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19022( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19020 "TestJSImplInterface", "passOptionalSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19022( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19021 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19022( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19022 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19022( cx, "TestJSImplInterface"
, "passOptionalSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19023
19024 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19025 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19026 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19027 if (objIsXray) {
19028 unwrappedObj.emplace(cx, obj);
19029 }
19030 Optional<nsAString> arg0;
19031 binding_detail::FakeString<char16_t> arg0_holder;
19032 if (args.hasDefined(0)) {
19033 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0_holder)) {
19034 return false;
19035 }
19036 if (!NormalizeUSVString(arg0_holder)) {
19037 JS_ReportOutOfMemory(cx);
19038 return false;
19039 }
19040 arg0 = &arg0_holder;
19041 }
19042 if (objIsXray) {
19043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19044 // we know Xrays have no dynamic unwrap behavior.
19045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19046 if (!unwrappedObj.ref()) {
19047 return false;
19048 }
19049 }
19050 FastErrorResult rv;
19051 // NOTE: This assert does NOT call the function.
19052 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19053 MOZ_KnownLive(self)(self)->PassOptionalSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVS"
)), 0))
) {
19055 return false;
19056 }
19057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19057; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19058 args.rval().setUndefined();
19059 return true;
19060}
19061
19062static const JSJitInfo passOptionalSVS_methodinfo = {
19063 { (JSJitGetterOp)passOptionalSVS },
19064 { prototypes::id::TestJSImplInterface },
19065 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19066 JSJitInfo::Method,
19067 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19068 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19069 false, /* isInfallible. False in setters. */
19070 false, /* isMovable. Not relevant for setters. */
19071 false, /* isEliminatable. Not relevant for setters. */
19072 false, /* isAlwaysInSlot. Only relevant for getters. */
19073 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19074 false, /* isTypedMethod. Only relevant for methods. */
19075 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19076};
19077
19078MOZ_CAN_RUN_SCRIPT static bool
19079passOptionalSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19080{
19081 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19084( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19082 "TestJSImplInterface", "passOptionalSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19084( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19083 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19084( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19084 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19084( cx, "TestJSImplInterface"
, "passOptionalSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19085
19086 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19087 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19088 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19089 if (objIsXray) {
19090 unwrappedObj.emplace(cx, obj);
19091 }
19092 binding_detail::FakeString<char16_t> arg0;
19093 if (args.hasDefined(0)) {
19094 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
19095 return false;
19096 }
19097 if (!NormalizeUSVString(arg0)) {
19098 JS_ReportOutOfMemory(cx);
19099 return false;
19100 }
19101 } else {
19102 arg0.AssignLiteral(u"abc");
19103 }
19104 if (objIsXray) {
19105 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19106 // we know Xrays have no dynamic unwrap behavior.
19107 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19108 if (!unwrappedObj.ref()) {
19109 return false;
19110 }
19111 }
19112 FastErrorResult rv;
19113 // NOTE: This assert does NOT call the function.
19114 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19115 MOZ_KnownLive(self)(self)->PassOptionalSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19116 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSVSWithDefaultValue"
)), 0))
) {
19117 return false;
19118 }
19119 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19119); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19119; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19120 args.rval().setUndefined();
19121 return true;
19122}
19123
19124static const JSJitInfo passOptionalSVSWithDefaultValue_methodinfo = {
19125 { (JSJitGetterOp)passOptionalSVSWithDefaultValue },
19126 { prototypes::id::TestJSImplInterface },
19127 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19128 JSJitInfo::Method,
19129 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19130 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19131 false, /* isInfallible. False in setters. */
19132 false, /* isMovable. Not relevant for setters. */
19133 false, /* isEliminatable. Not relevant for setters. */
19134 false, /* isAlwaysInSlot. Only relevant for getters. */
19135 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19136 false, /* isTypedMethod. Only relevant for methods. */
19137 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19138};
19139
19140MOZ_CAN_RUN_SCRIPT static bool
19141passOptionalNullableSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19142{
19143 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19146( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19144 "TestJSImplInterface", "passOptionalNullableSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19146( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19145 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19146( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19146 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19146( cx, "TestJSImplInterface"
, "passOptionalNullableSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19147
19148 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19149 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19150 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19151 if (objIsXray) {
19152 unwrappedObj.emplace(cx, obj);
19153 }
19154 Optional<nsAString> arg0;
19155 binding_detail::FakeString<char16_t> arg0_holder;
19156 if (args.hasDefined(0)) {
19157 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0_holder)) {
19158 return false;
19159 }
19160 if (!NormalizeUSVString(arg0_holder)) {
19161 JS_ReportOutOfMemory(cx);
19162 return false;
19163 }
19164 arg0 = &arg0_holder;
19165 }
19166 if (objIsXray) {
19167 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19168 // we know Xrays have no dynamic unwrap behavior.
19169 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19170 if (!unwrappedObj.ref()) {
19171 return false;
19172 }
19173 }
19174 FastErrorResult rv;
19175 // NOTE: This assert does NOT call the function.
19176 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19177 MOZ_KnownLive(self)(self)->PassOptionalNullableSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19178 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVS"
)), 0))
) {
19179 return false;
19180 }
19181 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19181); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19181; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19182 args.rval().setUndefined();
19183 return true;
19184}
19185
19186static const JSJitInfo passOptionalNullableSVS_methodinfo = {
19187 { (JSJitGetterOp)passOptionalNullableSVS },
19188 { prototypes::id::TestJSImplInterface },
19189 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19190 JSJitInfo::Method,
19191 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19192 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19193 false, /* isInfallible. False in setters. */
19194 false, /* isMovable. Not relevant for setters. */
19195 false, /* isEliminatable. Not relevant for setters. */
19196 false, /* isAlwaysInSlot. Only relevant for getters. */
19197 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19198 false, /* isTypedMethod. Only relevant for methods. */
19199 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19200};
19201
19202MOZ_CAN_RUN_SCRIPT static bool
19203passOptionalNullableSVSWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19204{
19205 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19208( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19206 "TestJSImplInterface", "passOptionalNullableSVSWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19208( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19207 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19208( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19208 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19208( cx, "TestJSImplInterface"
, "passOptionalNullableSVSWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19209
19210 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19211 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19212 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19213 if (objIsXray) {
19214 unwrappedObj.emplace(cx, obj);
19215 }
19216 binding_detail::FakeString<char16_t> arg0;
19217 if (args.hasDefined(0)) {
19218 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
19219 return false;
19220 }
19221 if (!NormalizeUSVString(arg0)) {
19222 JS_ReportOutOfMemory(cx);
19223 return false;
19224 }
19225 } else {
19226 arg0.SetIsVoid(true);
19227 }
19228 if (objIsXray) {
19229 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19230 // we know Xrays have no dynamic unwrap behavior.
19231 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19232 if (!unwrappedObj.ref()) {
19233 return false;
19234 }
19235 }
19236 FastErrorResult rv;
19237 // NOTE: This assert does NOT call the function.
19238 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19239 MOZ_KnownLive(self)(self)->PassOptionalNullableSVSWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19240 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue"
)), 0))
) {
19241 return false;
19242 }
19243 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19243); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19243; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19244 args.rval().setUndefined();
19245 return true;
19246}
19247
19248static const JSJitInfo passOptionalNullableSVSWithDefaultValue_methodinfo = {
19249 { (JSJitGetterOp)passOptionalNullableSVSWithDefaultValue },
19250 { prototypes::id::TestJSImplInterface },
19251 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19252 JSJitInfo::Method,
19253 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19254 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19255 false, /* isInfallible. False in setters. */
19256 false, /* isMovable. Not relevant for setters. */
19257 false, /* isEliminatable. Not relevant for setters. */
19258 false, /* isAlwaysInSlot. Only relevant for getters. */
19259 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19260 false, /* isTypedMethod. Only relevant for methods. */
19261 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19262};
19263
19264MOZ_CAN_RUN_SCRIPT static bool
19265passVariadicSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19266{
19267 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19270( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19268 "TestJSImplInterface", "passVariadicSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19270( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19269 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19270( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19270 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19270( cx, "TestJSImplInterface"
, "passVariadicSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19271
19272 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19273 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19274 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19275 if (objIsXray) {
19276 unwrappedObj.emplace(cx, obj);
19277 }
19278 AutoSequence<nsString> arg0;
19279 if (args.length() > 0) {
19280 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
19281 JS_ReportOutOfMemory(cx);
19282 return false;
19283 }
19284 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
19285 // OK to do infallible append here, since we ensured capacity already.
19286 nsString& slot = *arg0.AppendElement();
19287 if (!ConvertJSValueToString(cx, args[variadicArg], eStringify, eStringify, slot)) {
19288 return false;
19289 }
19290 if (!NormalizeUSVString(slot)) {
19291 JS_ReportOutOfMemory(cx);
19292 return false;
19293 }
19294 }
19295 }
19296 if (objIsXray) {
19297 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19298 // we know Xrays have no dynamic unwrap behavior.
19299 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19300 if (!unwrappedObj.ref()) {
19301 return false;
19302 }
19303 }
19304 FastErrorResult rv;
19305 // NOTE: This assert does NOT call the function.
19306 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19307 MOZ_KnownLive(self)(self)->PassVariadicSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19308 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicSVS"
)), 0))
) {
19309 return false;
19310 }
19311 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19311); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19311; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19312 args.rval().setUndefined();
19313 return true;
19314}
19315
19316static const JSJitInfo passVariadicSVS_methodinfo = {
19317 { (JSJitGetterOp)passVariadicSVS },
19318 { prototypes::id::TestJSImplInterface },
19319 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19320 JSJitInfo::Method,
19321 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19322 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19323 false, /* isInfallible. False in setters. */
19324 false, /* isMovable. Not relevant for setters. */
19325 false, /* isEliminatable. Not relevant for setters. */
19326 false, /* isAlwaysInSlot. Only relevant for getters. */
19327 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19328 false, /* isTypedMethod. Only relevant for methods. */
19329 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19330};
19331
19332MOZ_CAN_RUN_SCRIPT static bool
19333receiveSVS(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19334{
19335 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19338( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19336 "TestJSImplInterface", "receiveSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19338( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19337 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19338( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19338 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19338( cx, "TestJSImplInterface"
, "receiveSVS", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19339
19340 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19341 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19342 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19343 if (objIsXray) {
19344 unwrappedObj.emplace(cx, obj);
19345 }
19346 if (objIsXray) {
19347 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19348 // we know Xrays have no dynamic unwrap behavior.
19349 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19350 if (!unwrappedObj.ref()) {
19351 return false;
19352 }
19353 }
19354 FastErrorResult rv;
19355 DOMString result;
19356 // NOTE: This assert does NOT call the function.
19357 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveSVS(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19358 MOZ_KnownLive(self)(self)->ReceiveSVS(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19359 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveSVS"
)), 0))
) {
19360 return false;
19361 }
19362 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19362; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19363 if (!xpc::NonVoidStringToJsval(cx, result, args.rval())) {
19364 return false;
19365 }
19366 return true;
19367}
19368
19369static const JSJitInfo receiveSVS_methodinfo = {
19370 { (JSJitGetterOp)receiveSVS },
19371 { prototypes::id::TestJSImplInterface },
19372 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19373 JSJitInfo::Method,
19374 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19375 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19376 false, /* isInfallible. False in setters. */
19377 false, /* isMovable. Not relevant for setters. */
19378 false, /* isEliminatable. Not relevant for setters. */
19379 false, /* isAlwaysInSlot. Only relevant for getters. */
19380 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19381 false, /* isTypedMethod. Only relevant for methods. */
19382 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19383};
19384
19385MOZ_CAN_RUN_SCRIPT static bool
19386passJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19387{
19388 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19391( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19389 "TestJSImplInterface", "passJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19391( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19390 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19391( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19391 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19391( cx, "TestJSImplInterface"
, "passJSString", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19392
19393 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19394 if (!args.requireAtLeast(cx, "TestJSImplInterface.passJSString", 1)) {
19395 return false;
19396 }
19397 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19398 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19399 if (objIsXray) {
19400 unwrappedObj.emplace(cx, obj);
19401 }
19402 JS::Rooted<JSString*> arg0(cx);
19403 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19404 return false;
19405 }
19406 if (objIsXray) {
19407 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19408 // we know Xrays have no dynamic unwrap behavior.
19409 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19410 if (!unwrappedObj.ref()) {
19411 return false;
19412 }
19413 }
19414 FastErrorResult rv;
19415 // NOTE: This assert does NOT call the function.
19416 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassJSString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19417 MOZ_KnownLive(self)(self)->PassJSString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19418 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passJSString"
)), 0))
) {
19419 return false;
19420 }
19421 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19421); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19421; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19422 args.rval().setUndefined();
19423 return true;
19424}
19425
19426static const JSJitInfo passJSString_methodinfo = {
19427 { (JSJitGetterOp)passJSString },
19428 { prototypes::id::TestJSImplInterface },
19429 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19430 JSJitInfo::Method,
19431 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19432 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19433 false, /* isInfallible. False in setters. */
19434 false, /* isMovable. Not relevant for setters. */
19435 false, /* isEliminatable. Not relevant for setters. */
19436 false, /* isAlwaysInSlot. Only relevant for getters. */
19437 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19438 false, /* isTypedMethod. Only relevant for methods. */
19439 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19440};
19441
19442MOZ_CAN_RUN_SCRIPT static bool
19443passOptionalJSStringWithDefaultValue(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19444{
19445 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19448( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19446 "TestJSImplInterface", "passOptionalJSStringWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19448( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19447 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19448( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19448 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19448( cx, "TestJSImplInterface"
, "passOptionalJSStringWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19449
19450 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19451 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19452 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19453 if (objIsXray) {
19454 unwrappedObj.emplace(cx, obj);
19455 }
19456 JS::Rooted<JSString*> arg0(cx);
19457 if (args.hasDefined(0)) {
19458 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19459 return false;
19460 }
19461 } else {
19462 static const char data[] = { 'a', 'b', 'c', 0 };
19463 arg0 = JS_NewStringCopyN(cx, data, ArrayLength(data) - 1);
19464 if (!arg0) {
19465 return false;
19466 }
19467 }
19468 if (objIsXray) {
19469 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19470 // we know Xrays have no dynamic unwrap behavior.
19471 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19472 if (!unwrappedObj.ref()) {
19473 return false;
19474 }
19475 }
19476 FastErrorResult rv;
19477 // NOTE: This assert does NOT call the function.
19478 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19479 MOZ_KnownLive(self)(self)->PassOptionalJSStringWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19480 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalJSStringWithDefaultValue"
)), 0))
) {
19481 return false;
19482 }
19483 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19483); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19483; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19484 args.rval().setUndefined();
19485 return true;
19486}
19487
19488static const JSJitInfo passOptionalJSStringWithDefaultValue_methodinfo = {
19489 { (JSJitGetterOp)passOptionalJSStringWithDefaultValue },
19490 { prototypes::id::TestJSImplInterface },
19491 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19492 JSJitInfo::Method,
19493 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19494 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19495 false, /* isInfallible. False in setters. */
19496 false, /* isMovable. Not relevant for setters. */
19497 false, /* isEliminatable. Not relevant for setters. */
19498 false, /* isAlwaysInSlot. Only relevant for getters. */
19499 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19500 false, /* isTypedMethod. Only relevant for methods. */
19501 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19502};
19503
19504MOZ_CAN_RUN_SCRIPT static bool
19505receiveJSString(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19506{
19507 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19510( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19508 "TestJSImplInterface", "receiveJSString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19510( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19509 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19510( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19510 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19510( cx, "TestJSImplInterface"
, "receiveJSString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19511
19512 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19513 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19514 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19515 if (objIsXray) {
19516 unwrappedObj.emplace(cx, obj);
19517 }
19518 if (objIsXray) {
19519 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19520 // we know Xrays have no dynamic unwrap behavior.
19521 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19522 if (!unwrappedObj.ref()) {
19523 return false;
19524 }
19525 }
19526 FastErrorResult rv;
19527 JS::Rooted<JSString*> result(cx);
19528 // NOTE: This assert does NOT call the function.
19529 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveJSString(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19530 MOZ_KnownLive(self)(self)->ReceiveJSString(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19531 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveJSString"
)), 0))
) {
19532 return false;
19533 }
19534 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19534); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19534; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19535 args.rval().setString(result);
19536 if (!MaybeWrapStringValue(cx, args.rval())) {
19537 return false;
19538 }
19539 return true;
19540}
19541
19542static const JSJitInfo receiveJSString_methodinfo = {
19543 { (JSJitGetterOp)receiveJSString },
19544 { prototypes::id::TestJSImplInterface },
19545 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19546 JSJitInfo::Method,
19547 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19548 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19549 false, /* isInfallible. False in setters. */
19550 false, /* isMovable. Not relevant for setters. */
19551 false, /* isEliminatable. Not relevant for setters. */
19552 false, /* isAlwaysInSlot. Only relevant for getters. */
19553 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19554 false, /* isTypedMethod. Only relevant for methods. */
19555 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19556};
19557
19558MOZ_CAN_RUN_SCRIPT static bool
19559get_readonlyJSStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
19560{
19561 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19564( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19562 "TestJSImplInterface", "readonlyJSStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19564( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19563 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19564( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19564 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19564( cx, "TestJSImplInterface"
, "readonlyJSStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19565
19566 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19567 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19568 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19569 if (objIsXray) {
19570 unwrappedObj.emplace(cx, obj);
19571 }
19572 if (objIsXray) {
19573 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19574 // we know Xrays have no dynamic unwrap behavior.
19575 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19576 if (!unwrappedObj.ref()) {
19577 return false;
19578 }
19579 }
19580 FastErrorResult rv;
19581 JS::Rooted<JSString*> result(cx);
19582 // NOTE: This assert does NOT call the function.
19583 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19584 MOZ_KnownLive(self)(self)->GetReadonlyJSStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19585 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyJSStringAttr getter"
)), 0))
) {
19586 return false;
19587 }
19588 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19588; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19589 args.rval().setString(result);
19590 if (!MaybeWrapStringValue(cx, args.rval())) {
19591 return false;
19592 }
19593 return true;
19594}
19595
19596static const JSJitInfo readonlyJSStringAttr_getterinfo = {
19597 { get_readonlyJSStringAttr },
19598 { prototypes::id::TestJSImplInterface },
19599 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19600 JSJitInfo::Getter,
19601 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19602 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19603 false, /* isInfallible. False in setters. */
19604 false, /* isMovable. Not relevant for setters. */
19605 false, /* isEliminatable. Not relevant for setters. */
19606 false, /* isAlwaysInSlot. Only relevant for getters. */
19607 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19608 false, /* isTypedMethod. Only relevant for methods. */
19609 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19610};
19611
19612MOZ_CAN_RUN_SCRIPT static bool
19613get_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
19614{
19615 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19618( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19616 "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19618( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19617 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject19618( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19618 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19618( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19619
19620 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19621 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19622 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19623 if (objIsXray) {
19624 unwrappedObj.emplace(cx, obj);
19625 }
19626 if (objIsXray) {
19627 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19628 // we know Xrays have no dynamic unwrap behavior.
19629 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19630 if (!unwrappedObj.ref()) {
19631 return false;
19632 }
19633 }
19634 FastErrorResult rv;
19635 JS::Rooted<JSString*> result(cx);
19636 // NOTE: This assert does NOT call the function.
19637 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetJsStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19638 MOZ_KnownLive(self)(self)->GetJsStringAttr(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19639 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr getter"
)), 0))
) {
19640 return false;
19641 }
19642 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19642); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19642; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19643 args.rval().setString(result);
19644 if (!MaybeWrapStringValue(cx, args.rval())) {
19645 return false;
19646 }
19647 return true;
19648}
19649
19650MOZ_CAN_RUN_SCRIPT static bool
19651set_jsStringAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
19652{
19653 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19654 "TestJSImplInterface", "jsStringAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19655 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19656 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19656( cx, "TestJSImplInterface"
, "jsStringAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19657
19658 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19659 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19660 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19661 if (objIsXray) {
19662 unwrappedObj.emplace(cx, obj);
19663 }
19664 JS::Rooted<JSString*> arg0(cx);
19665 if (!(arg0 = ConvertJSValueToJSString(cx, args[0]))) {
19666 return false;
19667 }
19668 if (objIsXray) {
19669 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19670 // we know Xrays have no dynamic unwrap behavior.
19671 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19672 if (!unwrappedObj.ref()) {
19673 return false;
19674 }
19675 }
19676 FastErrorResult rv;
19677 // NOTE: This assert does NOT call the function.
19678 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetJsStringAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19679 MOZ_KnownLive(self)(self)->SetJsStringAttr(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19680 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.jsStringAttr setter"
)), 0))
) {
19681 return false;
19682 }
19683 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19683); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19683; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19684
19685 return true;
19686}
19687
19688static const JSJitInfo jsStringAttr_getterinfo = {
19689 { get_jsStringAttr },
19690 { prototypes::id::TestJSImplInterface },
19691 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19692 JSJitInfo::Getter,
19693 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19694 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
19695 false, /* isInfallible. False in setters. */
19696 false, /* isMovable. Not relevant for setters. */
19697 false, /* isEliminatable. Not relevant for setters. */
19698 false, /* isAlwaysInSlot. Only relevant for getters. */
19699 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19700 false, /* isTypedMethod. Only relevant for methods. */
19701 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19702};
19703static const JSJitInfo jsStringAttr_setterinfo = {
19704 { (JSJitGetterOp)set_jsStringAttr },
19705 { prototypes::id::TestJSImplInterface },
19706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19707 JSJitInfo::Setter,
19708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19709 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19710 false, /* isInfallible. False in setters. */
19711 false, /* isMovable. Not relevant for setters. */
19712 false, /* isEliminatable. Not relevant for setters. */
19713 false, /* isAlwaysInSlot. Only relevant for getters. */
19714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19715 false, /* isTypedMethod. Only relevant for methods. */
19716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19717};
19718
19719MOZ_CAN_RUN_SCRIPT static bool
19720passEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19721{
19722 BindingCallContext cx(cx_, "TestJSImplInterface.passEnum");
19723 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19726( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19724 "TestJSImplInterface", "passEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19726( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19725 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19726( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
19726 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19726( cx, "TestJSImplInterface"
, "passEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
19727
19728 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19729 if (!args.requireAtLeast(cx, "TestJSImplInterface.passEnum", 1)) {
19730 return false;
19731 }
19732 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19733 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19734 if (objIsXray) {
19735 unwrappedObj.emplace(cx, obj);
19736 }
19737 MyTestEnum arg0;
19738 {
19739 int index;
19740 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19741 binding_detail::EnumStrings<MyTestEnum>::Values,
19742 "MyTestEnum", "argument 1",
19743 &index)) {
19744 return false;
19745 }
19746 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 19746); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 19746; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
19747 arg0 = static_cast<MyTestEnum>(index);
19748 }
19749 if (objIsXray) {
19750 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19751 // we know Xrays have no dynamic unwrap behavior.
19752 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19753 if (!unwrappedObj.ref()) {
19754 return false;
19755 }
19756 }
19757 FastErrorResult rv;
19758 // NOTE: This assert does NOT call the function.
19759 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassEnum(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19760 MOZ_KnownLive(self)(self)->PassEnum(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19761 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnum"
)), 0))
) {
19762 return false;
19763 }
19764 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19764; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19765 args.rval().setUndefined();
19766 return true;
19767}
19768
19769static const JSJitInfo passEnum_methodinfo = {
19770 { (JSJitGetterOp)passEnum },
19771 { prototypes::id::TestJSImplInterface },
19772 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19773 JSJitInfo::Method,
19774 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19775 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19776 false, /* isInfallible. False in setters. */
19777 false, /* isMovable. Not relevant for setters. */
19778 false, /* isEliminatable. Not relevant for setters. */
19779 false, /* isAlwaysInSlot. Only relevant for getters. */
19780 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19781 false, /* isTypedMethod. Only relevant for methods. */
19782 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19783};
19784
19785MOZ_CAN_RUN_SCRIPT static bool
19786passNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19787{
19788 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableEnum");
19789 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19792( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19790 "TestJSImplInterface", "passNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19792( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19791 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19792( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19792 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19792( cx, "TestJSImplInterface"
, "passNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19793
19794 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19795 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableEnum", 1)) {
19796 return false;
19797 }
19798 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19799 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19800 if (objIsXray) {
19801 unwrappedObj.emplace(cx, obj);
19802 }
19803 Nullable<MyTestEnum> arg0;
19804 if (args[0].isNullOrUndefined()) {
19805 arg0.SetNull();
19806 } else {
19807 {
19808 int index;
19809 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19810 binding_detail::EnumStrings<MyTestEnum>::Values,
19811 "MyTestEnum", "argument 1",
19812 &index)) {
19813 return false;
19814 }
19815 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 19815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 19815; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
19816 arg0.SetValue() = static_cast<MyTestEnum>(index);
19817 }
19818 }
19819 if (objIsXray) {
19820 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19821 // we know Xrays have no dynamic unwrap behavior.
19822 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19823 if (!unwrappedObj.ref()) {
19824 return false;
19825 }
19826 }
19827 FastErrorResult rv;
19828 // NOTE: This assert does NOT call the function.
19829 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19830 MOZ_KnownLive(self)(self)->PassNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19831 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableEnum"
)), 0))
) {
19832 return false;
19833 }
19834 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19834; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19835 args.rval().setUndefined();
19836 return true;
19837}
19838
19839static const JSJitInfo passNullableEnum_methodinfo = {
19840 { (JSJitGetterOp)passNullableEnum },
19841 { prototypes::id::TestJSImplInterface },
19842 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19843 JSJitInfo::Method,
19844 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19845 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19846 false, /* isInfallible. False in setters. */
19847 false, /* isMovable. Not relevant for setters. */
19848 false, /* isEliminatable. Not relevant for setters. */
19849 false, /* isAlwaysInSlot. Only relevant for getters. */
19850 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19851 false, /* isTypedMethod. Only relevant for methods. */
19852 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19853};
19854
19855MOZ_CAN_RUN_SCRIPT static bool
19856passOptionalEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19857{
19858 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalEnum");
19859 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19862( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19860 "TestJSImplInterface", "passOptionalEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19862( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19861 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19862( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19862 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19862( cx, "TestJSImplInterface"
, "passOptionalEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19863
19864 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19865 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19866 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19867 if (objIsXray) {
19868 unwrappedObj.emplace(cx, obj);
19869 }
19870 Optional<MyTestEnum> arg0;
19871 if (args.hasDefined(0)) {
19872 arg0.Construct();
19873 {
19874 int index;
19875 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19876 binding_detail::EnumStrings<MyTestEnum>::Values,
19877 "MyTestEnum", "argument 1",
19878 &index)) {
19879 return false;
19880 }
19881 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 19881); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 19881; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
19882 arg0.Value() = static_cast<MyTestEnum>(index);
19883 }
19884 }
19885 if (objIsXray) {
19886 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19887 // we know Xrays have no dynamic unwrap behavior.
19888 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19889 if (!unwrappedObj.ref()) {
19890 return false;
19891 }
19892 }
19893 FastErrorResult rv;
19894 // NOTE: This assert does NOT call the function.
19895 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19896 MOZ_KnownLive(self)(self)->PassOptionalEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19897 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalEnum"
)), 0))
) {
19898 return false;
19899 }
19900 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19900); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19900; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19901 args.rval().setUndefined();
19902 return true;
19903}
19904
19905static const JSJitInfo passOptionalEnum_methodinfo = {
19906 { (JSJitGetterOp)passOptionalEnum },
19907 { prototypes::id::TestJSImplInterface },
19908 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19909 JSJitInfo::Method,
19910 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19911 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19912 false, /* isInfallible. False in setters. */
19913 false, /* isMovable. Not relevant for setters. */
19914 false, /* isEliminatable. Not relevant for setters. */
19915 false, /* isAlwaysInSlot. Only relevant for getters. */
19916 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19917 false, /* isTypedMethod. Only relevant for methods. */
19918 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19919};
19920
19921MOZ_CAN_RUN_SCRIPT static bool
19922passEnumWithDefault(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19923{
19924 BindingCallContext cx(cx_, "TestJSImplInterface.passEnumWithDefault");
19925 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19928( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19926 "TestJSImplInterface", "passEnumWithDefault", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19928( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19927 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19928( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
19928 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19928( cx, "TestJSImplInterface"
, "passEnumWithDefault", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
19929
19930 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19931 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19932 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
19933 if (objIsXray) {
19934 unwrappedObj.emplace(cx, obj);
19935 }
19936 MyTestEnum arg0;
19937 if (args.hasDefined(0)) {
19938 {
19939 int index;
19940 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
19941 binding_detail::EnumStrings<MyTestEnum>::Values,
19942 "MyTestEnum", "argument 1",
19943 &index)) {
19944 return false;
19945 }
19946 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 19946); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 19946; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
19947 arg0 = static_cast<MyTestEnum>(index);
19948 }
19949 } else {
19950 arg0 = MyTestEnum::A;
19951 }
19952 if (objIsXray) {
19953 // Since our object is an Xray, we can just CheckedUnwrapStatic:
19954 // we know Xrays have no dynamic unwrap behavior.
19955 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
19956 if (!unwrappedObj.ref()) {
19957 return false;
19958 }
19959 }
19960 FastErrorResult rv;
19961 // NOTE: This assert does NOT call the function.
19962 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
19963 MOZ_KnownLive(self)(self)->PassEnumWithDefault(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
19964 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passEnumWithDefault"
)), 0))
) {
19965 return false;
19966 }
19967 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 19967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 19967; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
19968 args.rval().setUndefined();
19969 return true;
19970}
19971
19972static const JSJitInfo passEnumWithDefault_methodinfo = {
19973 { (JSJitGetterOp)passEnumWithDefault },
19974 { prototypes::id::TestJSImplInterface },
19975 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
19976 JSJitInfo::Method,
19977 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
19978 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
19979 false, /* isInfallible. False in setters. */
19980 false, /* isMovable. Not relevant for setters. */
19981 false, /* isEliminatable. Not relevant for setters. */
19982 false, /* isAlwaysInSlot. Only relevant for getters. */
19983 false, /* isLazilyCachedInSlot. Only relevant for getters. */
19984 false, /* isTypedMethod. Only relevant for methods. */
19985 0 /* Reserved slot index, if we're stored in a slot, else 0. */
19986};
19987
19988MOZ_CAN_RUN_SCRIPT static bool
19989passOptionalNullableEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
19990{
19991 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnum");
19992 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject19995( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19993 "TestJSImplInterface", "passOptionalNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject19995( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19994 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject19995( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
19995 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject19995( cx, "TestJSImplInterface"
, "passOptionalNullableEnum", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
19996
19997 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
19998 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
19999 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20000 if (objIsXray) {
20001 unwrappedObj.emplace(cx, obj);
20002 }
20003 Optional<Nullable<MyTestEnum>> arg0;
20004 if (args.hasDefined(0)) {
20005 arg0.Construct();
20006 if (args[0].isNullOrUndefined()) {
20007 arg0.Value().SetNull();
20008 } else {
20009 {
20010 int index;
20011 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20012 binding_detail::EnumStrings<MyTestEnum>::Values,
20013 "MyTestEnum", "argument 1",
20014 &index)) {
20015 return false;
20016 }
20017 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 20017); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 20017; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
20018 arg0.Value().SetValue() = static_cast<MyTestEnum>(index);
20019 }
20020 }
20021 }
20022 if (objIsXray) {
20023 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20024 // we know Xrays have no dynamic unwrap behavior.
20025 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20026 if (!unwrappedObj.ref()) {
20027 return false;
20028 }
20029 }
20030 FastErrorResult rv;
20031 // NOTE: This assert does NOT call the function.
20032 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20033 MOZ_KnownLive(self)(self)->PassOptionalNullableEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20034 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnum"
)), 0))
) {
20035 return false;
20036 }
20037 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20037); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20037; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20038 args.rval().setUndefined();
20039 return true;
20040}
20041
20042static const JSJitInfo passOptionalNullableEnum_methodinfo = {
20043 { (JSJitGetterOp)passOptionalNullableEnum },
20044 { prototypes::id::TestJSImplInterface },
20045 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20046 JSJitInfo::Method,
20047 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20048 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20049 false, /* isInfallible. False in setters. */
20050 false, /* isMovable. Not relevant for setters. */
20051 false, /* isEliminatable. Not relevant for setters. */
20052 false, /* isAlwaysInSlot. Only relevant for getters. */
20053 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20054 false, /* isTypedMethod. Only relevant for methods. */
20055 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20056};
20057
20058MOZ_CAN_RUN_SCRIPT static bool
20059passOptionalNullableEnumWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20060{
20061 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue");
20062 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20065( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20063 "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20065( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20064 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20065( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20065 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20065( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20066
20067 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20068 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20069 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20070 if (objIsXray) {
20071 unwrappedObj.emplace(cx, obj);
20072 }
20073 Nullable<MyTestEnum> arg0;
20074 if (args.hasDefined(0)) {
20075 if (args[0].isNullOrUndefined()) {
20076 arg0.SetNull();
20077 } else {
20078 {
20079 int index;
20080 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20081 binding_detail::EnumStrings<MyTestEnum>::Values,
20082 "MyTestEnum", "argument 1",
20083 &index)) {
20084 return false;
20085 }
20086 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 20086); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 20086; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
20087 arg0.SetValue() = static_cast<MyTestEnum>(index);
20088 }
20089 }
20090 } else {
20091 arg0.SetNull();
20092 }
20093 if (objIsXray) {
20094 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20095 // we know Xrays have no dynamic unwrap behavior.
20096 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20097 if (!unwrappedObj.ref()) {
20098 return false;
20099 }
20100 }
20101 FastErrorResult rv;
20102 // NOTE: This assert does NOT call the function.
20103 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20104 MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20105 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue"
)), 0))
) {
20106 return false;
20107 }
20108 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20108); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20108; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20109 args.rval().setUndefined();
20110 return true;
20111}
20112
20113static const JSJitInfo passOptionalNullableEnumWithDefaultValue_methodinfo = {
20114 { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue },
20115 { prototypes::id::TestJSImplInterface },
20116 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20117 JSJitInfo::Method,
20118 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20119 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20120 false, /* isInfallible. False in setters. */
20121 false, /* isMovable. Not relevant for setters. */
20122 false, /* isEliminatable. Not relevant for setters. */
20123 false, /* isAlwaysInSlot. Only relevant for getters. */
20124 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20125 false, /* isTypedMethod. Only relevant for methods. */
20126 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20127};
20128
20129MOZ_CAN_RUN_SCRIPT static bool
20130passOptionalNullableEnumWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20131{
20132 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2");
20133 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20136( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20134 "TestJSImplInterface", "passOptionalNullableEnumWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20136( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20135 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20136( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20136 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20136( cx, "TestJSImplInterface"
, "passOptionalNullableEnumWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20137
20138 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20139 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20140 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20141 if (objIsXray) {
20142 unwrappedObj.emplace(cx, obj);
20143 }
20144 Nullable<MyTestEnum> arg0;
20145 if (args.hasDefined(0)) {
20146 if (args[0].isNullOrUndefined()) {
20147 arg0.SetNull();
20148 } else {
20149 {
20150 int index;
20151 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
20152 binding_detail::EnumStrings<MyTestEnum>::Values,
20153 "MyTestEnum", "argument 1",
20154 &index)) {
20155 return false;
20156 }
20157 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 20157); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 20157; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
20158 arg0.SetValue() = static_cast<MyTestEnum>(index);
20159 }
20160 }
20161 } else {
20162 arg0.SetValue() = MyTestEnum::A;
20163 }
20164 if (objIsXray) {
20165 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20166 // we know Xrays have no dynamic unwrap behavior.
20167 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20168 if (!unwrappedObj.ref()) {
20169 return false;
20170 }
20171 }
20172 FastErrorResult rv;
20173 // NOTE: This assert does NOT call the function.
20174 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20175 MOZ_KnownLive(self)(self)->PassOptionalNullableEnumWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20176 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2"
)), 0))
) {
20177 return false;
20178 }
20179 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20179); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20179; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20180 args.rval().setUndefined();
20181 return true;
20182}
20183
20184static const JSJitInfo passOptionalNullableEnumWithDefaultValue2_methodinfo = {
20185 { (JSJitGetterOp)passOptionalNullableEnumWithDefaultValue2 },
20186 { prototypes::id::TestJSImplInterface },
20187 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20188 JSJitInfo::Method,
20189 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20190 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20191 false, /* isInfallible. False in setters. */
20192 false, /* isMovable. Not relevant for setters. */
20193 false, /* isEliminatable. Not relevant for setters. */
20194 false, /* isAlwaysInSlot. Only relevant for getters. */
20195 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20196 false, /* isTypedMethod. Only relevant for methods. */
20197 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20198};
20199
20200MOZ_CAN_RUN_SCRIPT static bool
20201receiveEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20202{
20203 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20206( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20204 "TestJSImplInterface", "receiveEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20206( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20205 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20206( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20206 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20206( cx, "TestJSImplInterface"
, "receiveEnum", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20207
20208 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20209 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20210 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20211 if (objIsXray) {
20212 unwrappedObj.emplace(cx, obj);
20213 }
20214 if (objIsXray) {
20215 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20216 // we know Xrays have no dynamic unwrap behavior.
20217 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20218 if (!unwrappedObj.ref()) {
20219 return false;
20220 }
20221 }
20222 FastErrorResult rv;
20223 MyTestEnum result(MOZ_KnownLive(self)(self)->ReceiveEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20224 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveEnum"
)), 0))
) {
20225 return false;
20226 }
20227 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20227); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20227; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20228 if (!ToJSValue(cx, result, args.rval())) {
20229 return false;
20230 }
20231 return true;
20232}
20233
20234static const JSJitInfo receiveEnum_methodinfo = {
20235 { (JSJitGetterOp)receiveEnum },
20236 { prototypes::id::TestJSImplInterface },
20237 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20238 JSJitInfo::Method,
20239 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20240 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20241 false, /* isInfallible. False in setters. */
20242 false, /* isMovable. Not relevant for setters. */
20243 false, /* isEliminatable. Not relevant for setters. */
20244 false, /* isAlwaysInSlot. Only relevant for getters. */
20245 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20246 false, /* isTypedMethod. Only relevant for methods. */
20247 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20248};
20249
20250MOZ_CAN_RUN_SCRIPT static bool
20251receiveNullableEnum(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20252{
20253 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20256( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20254 "TestJSImplInterface", "receiveNullableEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20256( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20255 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20256( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20256 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20256( cx, "TestJSImplInterface"
, "receiveNullableEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20257
20258 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20259 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20260 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20261 if (objIsXray) {
20262 unwrappedObj.emplace(cx, obj);
20263 }
20264 if (objIsXray) {
20265 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20266 // we know Xrays have no dynamic unwrap behavior.
20267 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20268 if (!unwrappedObj.ref()) {
20269 return false;
20270 }
20271 }
20272 FastErrorResult rv;
20273 Nullable<MyTestEnum> result(MOZ_KnownLive(self)(self)->ReceiveNullableEnum(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20274 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableEnum"
)), 0))
) {
20275 return false;
20276 }
20277 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20277); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20277; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20278 if (result.IsNull()) {
20279 args.rval().setNull();
20280 return true;
20281 } else {
20282 if (!ToJSValue(cx, result.Value(), args.rval())) {
20283 return false;
20284 }
20285 return true;
20286 }
20287}
20288
20289static const JSJitInfo receiveNullableEnum_methodinfo = {
20290 { (JSJitGetterOp)receiveNullableEnum },
20291 { prototypes::id::TestJSImplInterface },
20292 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20293 JSJitInfo::Method,
20294 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20295 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
20296 false, /* isInfallible. False in setters. */
20297 false, /* isMovable. Not relevant for setters. */
20298 false, /* isEliminatable. Not relevant for setters. */
20299 false, /* isAlwaysInSlot. Only relevant for getters. */
20300 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20301 false, /* isTypedMethod. Only relevant for methods. */
20302 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20303};
20304
20305MOZ_CAN_RUN_SCRIPT static bool
20306get_enumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
20307{
20308 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20311( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20309 "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20311( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20310 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20311( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20311 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20311( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20312
20313 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20314 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20315 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20316 if (objIsXray) {
20317 unwrappedObj.emplace(cx, obj);
20318 }
20319 if (objIsXray) {
20320 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20321 // we know Xrays have no dynamic unwrap behavior.
20322 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20323 if (!unwrappedObj.ref()) {
20324 return false;
20325 }
20326 }
20327 FastErrorResult rv;
20328 MyTestEnum result(MOZ_KnownLive(self)(self)->GetEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20329 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute getter"
)), 0))
) {
20330 return false;
20331 }
20332 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20332); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20332; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20333 if (!ToJSValue(cx, result, args.rval())) {
20334 return false;
20335 }
20336 return true;
20337}
20338
20339MOZ_CAN_RUN_SCRIPT static bool
20340set_enumAttribute(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
20341{
20342 BindingCallContext cx(cx_, "TestJSImplInterface.enumAttribute setter");
20343 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20346( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20344 "TestJSImplInterface", "enumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20346( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20345 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject20346( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20346 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20346( cx, "TestJSImplInterface"
, "enumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20347
20348 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20349 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20350 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20351 if (objIsXray) {
20352 unwrappedObj.emplace(cx, obj);
20353 }
20354 MyTestEnum arg0;
20355 {
20356 int index;
20357 if (!binding_detail::FindEnumStringIndex<false>(cx, args[0],
20358 binding_detail::EnumStrings<MyTestEnum>::Values,
20359 "MyTestEnum", "value being assigned",
20360 &index)) {
20361 return false;
20362 }
20363 if (index < 0) {
20364 return true;
20365 }
20366 arg0 = static_cast<MyTestEnum>(index);
20367 }
20368 if (objIsXray) {
20369 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20370 // we know Xrays have no dynamic unwrap behavior.
20371 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20372 if (!unwrappedObj.ref()) {
20373 return false;
20374 }
20375 }
20376 FastErrorResult rv;
20377 // NOTE: This assert does NOT call the function.
20378 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20379 MOZ_KnownLive(self)(self)->SetEnumAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20380 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enumAttribute setter"
)), 0))
) {
20381 return false;
20382 }
20383 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20383); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20383; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20384
20385 return true;
20386}
20387
20388static const JSJitInfo enumAttribute_getterinfo = {
20389 { get_enumAttribute },
20390 { prototypes::id::TestJSImplInterface },
20391 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20392 JSJitInfo::Getter,
20393 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20394 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20395 false, /* isInfallible. False in setters. */
20396 false, /* isMovable. Not relevant for setters. */
20397 false, /* isEliminatable. Not relevant for setters. */
20398 false, /* isAlwaysInSlot. Only relevant for getters. */
20399 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20400 false, /* isTypedMethod. Only relevant for methods. */
20401 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20402};
20403static const JSJitInfo enumAttribute_setterinfo = {
20404 { (JSJitGetterOp)set_enumAttribute },
20405 { prototypes::id::TestJSImplInterface },
20406 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20407 JSJitInfo::Setter,
20408 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20409 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20410 false, /* isInfallible. False in setters. */
20411 false, /* isMovable. Not relevant for setters. */
20412 false, /* isEliminatable. Not relevant for setters. */
20413 false, /* isAlwaysInSlot. Only relevant for getters. */
20414 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20415 false, /* isTypedMethod. Only relevant for methods. */
20416 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20417};
20418
20419MOZ_CAN_RUN_SCRIPT static bool
20420get_readonlyEnumAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
20421{
20422 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20425( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20423 "TestJSImplInterface", "readonlyEnumAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20425( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20424 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject20425( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20425 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20425( cx, "TestJSImplInterface"
, "readonlyEnumAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20426
20427 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20428 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20429 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20430 if (objIsXray) {
20431 unwrappedObj.emplace(cx, obj);
20432 }
20433 if (objIsXray) {
20434 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20435 // we know Xrays have no dynamic unwrap behavior.
20436 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20437 if (!unwrappedObj.ref()) {
20438 return false;
20439 }
20440 }
20441 FastErrorResult rv;
20442 MyTestEnum result(MOZ_KnownLive(self)(self)->GetReadonlyEnumAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20443 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.readonlyEnumAttribute getter"
)), 0))
) {
20444 return false;
20445 }
20446 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20446; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20447 if (!ToJSValue(cx, result, args.rval())) {
20448 return false;
20449 }
20450 return true;
20451}
20452
20453static const JSJitInfo readonlyEnumAttribute_getterinfo = {
20454 { get_readonlyEnumAttribute },
20455 { prototypes::id::TestJSImplInterface },
20456 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20457 JSJitInfo::Getter,
20458 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20459 JSVAL_TYPE_STRING, /* returnType. Not relevant for setters. */
20460 false, /* isInfallible. False in setters. */
20461 false, /* isMovable. Not relevant for setters. */
20462 false, /* isEliminatable. Not relevant for setters. */
20463 false, /* isAlwaysInSlot. Only relevant for getters. */
20464 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20465 false, /* isTypedMethod. Only relevant for methods. */
20466 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20467};
20468
20469MOZ_CAN_RUN_SCRIPT static bool
20470passCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20471{
20472 BindingCallContext cx(cx_, "TestJSImplInterface.passCallback");
20473 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20476( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20474 "TestJSImplInterface", "passCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20476( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20475 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20476( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20476 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20476( cx, "TestJSImplInterface"
, "passCallback", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20477
20478 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20479 if (!args.requireAtLeast(cx, "TestJSImplInterface.passCallback", 1)) {
20480 return false;
20481 }
20482 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20483 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20484 if (objIsXray) {
20485 unwrappedObj.emplace(cx, obj);
20486 }
20487 RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx);
20488 if (args[0].isObject()) {
20489 if (JS::IsCallable(&args[0].toObject())) {
20490 { // scope for tempRoot and tempGlobalRoot if needed
20491 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20492 }
20493 } else {
20494 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20495 return false;
20496 }
20497 } else {
20498 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20499 return false;
20500 }
20501 if (objIsXray) {
20502 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20503 // we know Xrays have no dynamic unwrap behavior.
20504 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20505 if (!unwrappedObj.ref()) {
20506 return false;
20507 }
20508 }
20509 FastErrorResult rv;
20510 // NOTE: This assert does NOT call the function.
20511 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20512 MOZ_KnownLive(self)(self)->PassCallback(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20513 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passCallback"
)), 0))
) {
20514 return false;
20515 }
20516 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20516); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20516; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20517 args.rval().setUndefined();
20518 return true;
20519}
20520
20521static const JSJitInfo passCallback_methodinfo = {
20522 { (JSJitGetterOp)passCallback },
20523 { prototypes::id::TestJSImplInterface },
20524 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20525 JSJitInfo::Method,
20526 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20527 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20528 false, /* isInfallible. False in setters. */
20529 false, /* isMovable. Not relevant for setters. */
20530 false, /* isEliminatable. Not relevant for setters. */
20531 false, /* isAlwaysInSlot. Only relevant for getters. */
20532 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20533 false, /* isTypedMethod. Only relevant for methods. */
20534 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20535};
20536
20537MOZ_CAN_RUN_SCRIPT static bool
20538passNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20539{
20540 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableCallback");
20541 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20544( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20542 "TestJSImplInterface", "passNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20544( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20543 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20544( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20544 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20544( cx, "TestJSImplInterface"
, "passNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20545
20546 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20547 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableCallback", 1)) {
20548 return false;
20549 }
20550 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20551 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20552 if (objIsXray) {
20553 unwrappedObj.emplace(cx, obj);
20554 }
20555 RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx);
20556 if (args[0].isObject()) {
20557 if (JS::IsCallable(&args[0].toObject())) {
20558 { // scope for tempRoot and tempGlobalRoot if needed
20559 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20560 }
20561 } else {
20562 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20563 return false;
20564 }
20565 } else if (args[0].isNullOrUndefined()) {
20566 arg0 = nullptr;
20567 } else {
20568 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20569 return false;
20570 }
20571 if (objIsXray) {
20572 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20573 // we know Xrays have no dynamic unwrap behavior.
20574 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20575 if (!unwrappedObj.ref()) {
20576 return false;
20577 }
20578 }
20579 FastErrorResult rv;
20580 // NOTE: This assert does NOT call the function.
20581 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20582 MOZ_KnownLive(self)(self)->PassNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20583 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableCallback"
)), 0))
) {
20584 return false;
20585 }
20586 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20586); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20586; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20587 args.rval().setUndefined();
20588 return true;
20589}
20590
20591static const JSJitInfo passNullableCallback_methodinfo = {
20592 { (JSJitGetterOp)passNullableCallback },
20593 { prototypes::id::TestJSImplInterface },
20594 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20595 JSJitInfo::Method,
20596 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20597 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20598 false, /* isInfallible. False in setters. */
20599 false, /* isMovable. Not relevant for setters. */
20600 false, /* isEliminatable. Not relevant for setters. */
20601 false, /* isAlwaysInSlot. Only relevant for getters. */
20602 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20603 false, /* isTypedMethod. Only relevant for methods. */
20604 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20605};
20606
20607MOZ_CAN_RUN_SCRIPT static bool
20608passOptionalCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20609{
20610 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalCallback");
20611 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20614( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20612 "TestJSImplInterface", "passOptionalCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20614( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20613 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20614( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20614 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20614( cx, "TestJSImplInterface"
, "passOptionalCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20615
20616 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20617 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20618 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20619 if (objIsXray) {
20620 unwrappedObj.emplace(cx, obj);
20621 }
20622 Optional<OwningNonNull<MyTestCallback>> arg0;
20623 if (args.hasDefined(0)) {
20624 arg0.Construct();
20625 if (args[0].isObject()) {
20626 if (JS::IsCallable(&args[0].toObject())) {
20627 { // scope for tempRoot and tempGlobalRoot if needed
20628 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
20629 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
20630 arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
20631 }
20632 } else {
20633 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20634 return false;
20635 }
20636 } else {
20637 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20638 return false;
20639 }
20640 }
20641 if (objIsXray) {
20642 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20643 // we know Xrays have no dynamic unwrap behavior.
20644 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20645 if (!unwrappedObj.ref()) {
20646 return false;
20647 }
20648 }
20649 FastErrorResult rv;
20650 // NOTE: This assert does NOT call the function.
20651 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20652 MOZ_KnownLive(self)(self)->PassOptionalCallback(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20653 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalCallback"
)), 0))
) {
20654 return false;
20655 }
20656 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20656); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20656; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20657 args.rval().setUndefined();
20658 return true;
20659}
20660
20661static const JSJitInfo passOptionalCallback_methodinfo = {
20662 { (JSJitGetterOp)passOptionalCallback },
20663 { prototypes::id::TestJSImplInterface },
20664 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20665 JSJitInfo::Method,
20666 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20667 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20668 false, /* isInfallible. False in setters. */
20669 false, /* isMovable. Not relevant for setters. */
20670 false, /* isEliminatable. Not relevant for setters. */
20671 false, /* isAlwaysInSlot. Only relevant for getters. */
20672 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20673 false, /* isTypedMethod. Only relevant for methods. */
20674 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20675};
20676
20677MOZ_CAN_RUN_SCRIPT static bool
20678passOptionalNullableCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20679{
20680 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallback");
20681 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20684( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20682 "TestJSImplInterface", "passOptionalNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20684( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20683 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20684( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20684 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20684( cx, "TestJSImplInterface"
, "passOptionalNullableCallback", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20685
20686 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20687 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20688 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20689 if (objIsXray) {
20690 unwrappedObj.emplace(cx, obj);
20691 }
20692 Optional<RefPtr<MyTestCallback>> arg0;
20693 if (args.hasDefined(0)) {
20694 arg0.Construct();
20695 if (args[0].isObject()) {
20696 if (JS::IsCallable(&args[0].toObject())) {
20697 { // scope for tempRoot and tempGlobalRoot if needed
20698 JS::Rooted<JSObject*> tempRoot(cx, &args[0].toObject());
20699 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
20700 arg0.Value() = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
20701 }
20702 } else {
20703 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20704 return false;
20705 }
20706 } else if (args[0].isNullOrUndefined()) {
20707 arg0.Value() = nullptr;
20708 } else {
20709 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20710 return false;
20711 }
20712 }
20713 if (objIsXray) {
20714 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20715 // we know Xrays have no dynamic unwrap behavior.
20716 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20717 if (!unwrappedObj.ref()) {
20718 return false;
20719 }
20720 }
20721 FastErrorResult rv;
20722 // NOTE: This assert does NOT call the function.
20723 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20724 MOZ_KnownLive(self)(self)->PassOptionalNullableCallback(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20725 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallback"
)), 0))
) {
20726 return false;
20727 }
20728 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20728); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20728; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20729 args.rval().setUndefined();
20730 return true;
20731}
20732
20733static const JSJitInfo passOptionalNullableCallback_methodinfo = {
20734 { (JSJitGetterOp)passOptionalNullableCallback },
20735 { prototypes::id::TestJSImplInterface },
20736 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20737 JSJitInfo::Method,
20738 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20739 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20740 false, /* isInfallible. False in setters. */
20741 false, /* isMovable. Not relevant for setters. */
20742 false, /* isEliminatable. Not relevant for setters. */
20743 false, /* isAlwaysInSlot. Only relevant for getters. */
20744 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20745 false, /* isTypedMethod. Only relevant for methods. */
20746 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20747};
20748
20749MOZ_CAN_RUN_SCRIPT static bool
20750passOptionalNullableCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20751{
20752 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue");
20753 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20756( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20754 "TestJSImplInterface", "passOptionalNullableCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20756( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20755 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20756( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
20756 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20756( cx, "TestJSImplInterface"
, "passOptionalNullableCallbackWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
20757
20758 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20759 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20760 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20761 if (objIsXray) {
20762 unwrappedObj.emplace(cx, obj);
20763 }
20764 RootedCallback<RefPtr<binding_detail::FastMyTestCallback>> arg0(cx);
20765 if (args.hasDefined(0)) {
20766 if (args[0].isObject()) {
20767 if (JS::IsCallable(&args[0].toObject())) {
20768 { // scope for tempRoot and tempGlobalRoot if needed
20769 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20770 }
20771 } else {
20772 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20773 return false;
20774 }
20775 } else if (args[0].isNullOrUndefined()) {
20776 arg0 = nullptr;
20777 } else {
20778 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20779 return false;
20780 }
20781 } else {
20782 arg0 = nullptr;
20783 }
20784 if (objIsXray) {
20785 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20786 // we know Xrays have no dynamic unwrap behavior.
20787 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20788 if (!unwrappedObj.ref()) {
20789 return false;
20790 }
20791 }
20792 FastErrorResult rv;
20793 // NOTE: This assert does NOT call the function.
20794 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20795 MOZ_KnownLive(self)(self)->PassOptionalNullableCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20796 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue"
)), 0))
) {
20797 return false;
20798 }
20799 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20799); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20799; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20800 args.rval().setUndefined();
20801 return true;
20802}
20803
20804static const JSJitInfo passOptionalNullableCallbackWithDefaultValue_methodinfo = {
20805 { (JSJitGetterOp)passOptionalNullableCallbackWithDefaultValue },
20806 { prototypes::id::TestJSImplInterface },
20807 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20808 JSJitInfo::Method,
20809 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20810 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20811 false, /* isInfallible. False in setters. */
20812 false, /* isMovable. Not relevant for setters. */
20813 false, /* isEliminatable. Not relevant for setters. */
20814 false, /* isAlwaysInSlot. Only relevant for getters. */
20815 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20816 false, /* isTypedMethod. Only relevant for methods. */
20817 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20818};
20819
20820MOZ_CAN_RUN_SCRIPT static bool
20821receiveCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20822{
20823 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20826( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20824 "TestJSImplInterface", "receiveCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20826( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20825 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20826( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20826 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20826( cx, "TestJSImplInterface"
, "receiveCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20827
20828 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20829 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20830 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20831 if (objIsXray) {
20832 unwrappedObj.emplace(cx, obj);
20833 }
20834 if (objIsXray) {
20835 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20836 // we know Xrays have no dynamic unwrap behavior.
20837 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20838 if (!unwrappedObj.ref()) {
20839 return false;
20840 }
20841 }
20842 FastErrorResult rv;
20843 RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20844 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveCallback"
)), 0))
) {
20845 return false;
20846 }
20847 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20847); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20847; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20848 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
20849 if (!MaybeWrapObjectValue(cx, args.rval())) {
20850 return false;
20851 }
20852 return true;
20853}
20854
20855static const JSJitInfo receiveCallback_methodinfo = {
20856 { (JSJitGetterOp)receiveCallback },
20857 { prototypes::id::TestJSImplInterface },
20858 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20859 JSJitInfo::Method,
20860 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20861 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
20862 false, /* isInfallible. False in setters. */
20863 false, /* isMovable. Not relevant for setters. */
20864 false, /* isEliminatable. Not relevant for setters. */
20865 false, /* isAlwaysInSlot. Only relevant for getters. */
20866 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20867 false, /* isTypedMethod. Only relevant for methods. */
20868 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20869};
20870
20871MOZ_CAN_RUN_SCRIPT static bool
20872receiveNullableCallback(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20873{
20874 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20877( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20875 "TestJSImplInterface", "receiveNullableCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20877( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20876 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20877( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
20877 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20877( cx, "TestJSImplInterface"
, "receiveNullableCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
20878
20879 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20880 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20881 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20882 if (objIsXray) {
20883 unwrappedObj.emplace(cx, obj);
20884 }
20885 if (objIsXray) {
20886 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20887 // we know Xrays have no dynamic unwrap behavior.
20888 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20889 if (!unwrappedObj.ref()) {
20890 return false;
20891 }
20892 }
20893 FastErrorResult rv;
20894 RefPtr<MyTestCallback> result(MOZ_KnownLive(self)(self)->ReceiveNullableCallback(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
20895 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableCallback"
)), 0))
) {
20896 return false;
20897 }
20898 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20898); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20898; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20899 if (result) {
20900 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
20901 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
20902 return false;
20903 }
20904 return true;
20905 } else {
20906 args.rval().setNull();
20907 return true;
20908 }
20909}
20910
20911static const JSJitInfo receiveNullableCallback_methodinfo = {
20912 { (JSJitGetterOp)receiveNullableCallback },
20913 { prototypes::id::TestJSImplInterface },
20914 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20915 JSJitInfo::Method,
20916 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20917 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
20918 false, /* isInfallible. False in setters. */
20919 false, /* isMovable. Not relevant for setters. */
20920 false, /* isEliminatable. Not relevant for setters. */
20921 false, /* isAlwaysInSlot. Only relevant for getters. */
20922 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20923 false, /* isTypedMethod. Only relevant for methods. */
20924 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20925};
20926
20927MOZ_CAN_RUN_SCRIPT static bool
20928passOptionalNullableTreatAsNullCallbackWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
20929{
20930 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue");
20931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject20934( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
20932 "TestJSImplInterface", "passOptionalNullableTreatAsNullCallbackWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject20934( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
20933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject20934( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
20934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject20934( cx, "TestJSImplInterface"
, "passOptionalNullableTreatAsNullCallbackWithDefaultValue", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
20935
20936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
20937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
20938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
20939 if (objIsXray) {
20940 unwrappedObj.emplace(cx, obj);
20941 }
20942 RootedCallback<RefPtr<binding_detail::FastTestTreatAsNullCallback>> arg0(cx);
20943 if (args.hasDefined(0)) {
20944 if (args[0].isObject()) {
20945 if (JS::IsCallable(&args[0].toObject())) {
20946 { // scope for tempRoot and tempGlobalRoot if needed
20947 arg0 = new binding_detail::FastTestTreatAsNullCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
20948 }
20949 } else {
20950 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Argument 1");
20951 return false;
20952 }
20953 } else if (args[0].isNullOrUndefined()) {
20954 arg0 = nullptr;
20955 } else {
20956 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
20957 return false;
20958 }
20959 } else {
20960 arg0 = nullptr;
20961 }
20962 if (objIsXray) {
20963 // Since our object is an Xray, we can just CheckedUnwrapStatic:
20964 // we know Xrays have no dynamic unwrap behavior.
20965 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
20966 if (!unwrappedObj.ref()) {
20967 return false;
20968 }
20969 }
20970 FastErrorResult rv;
20971 // NOTE: This assert does NOT call the function.
20972 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
20973 MOZ_KnownLive(self)(self)->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
20974 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue"
)), 0))
) {
20975 return false;
20976 }
20977 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 20977); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 20977; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
20978 args.rval().setUndefined();
20979 return true;
20980}
20981
20982static const JSJitInfo passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo = {
20983 { (JSJitGetterOp)passOptionalNullableTreatAsNullCallbackWithDefaultValue },
20984 { prototypes::id::TestJSImplInterface },
20985 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
20986 JSJitInfo::Method,
20987 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
20988 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
20989 false, /* isInfallible. False in setters. */
20990 false, /* isMovable. Not relevant for setters. */
20991 false, /* isEliminatable. Not relevant for setters. */
20992 false, /* isAlwaysInSlot. Only relevant for getters. */
20993 false, /* isLazilyCachedInSlot. Only relevant for getters. */
20994 false, /* isTypedMethod. Only relevant for methods. */
20995 0 /* Reserved slot index, if we're stored in a slot, else 0. */
20996};
20997
20998MOZ_CAN_RUN_SCRIPT static bool
20999passAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21000{
21001 BindingCallContext cx(cx_, "TestJSImplInterface.passAny");
21002 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21005( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21003 "TestJSImplInterface", "passAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21005( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21004 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21005( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
21005 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21005( cx, "TestJSImplInterface"
, "passAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
21006
21007 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21008 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAny", 1)) {
21009 return false;
21010 }
21011 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21012 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21013 if (objIsXray) {
21014 unwrappedObj.emplace(cx, obj);
21015 }
21016 JS::Rooted<JS::Value> arg0(cx);
21017#ifdef __clang__1
21018#pragma clang diagnostic push
21019#pragma clang diagnostic ignored "-Wunreachable-code"
21020#pragma clang diagnostic ignored "-Wunreachable-code-return"
21021#endif // __clang__
21022 if ((true) && !CallerSubsumes(args[0])) {
21023 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21024 return false;
21025 }
21026#ifdef __clang__1
21027#pragma clang diagnostic pop
21028#endif // __clang__
21029 arg0 = args[0];
21030 if (objIsXray) {
21031 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21032 // we know Xrays have no dynamic unwrap behavior.
21033 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21034 if (!unwrappedObj.ref()) {
21035 return false;
21036 }
21037 }
21038 FastErrorResult rv;
21039 // NOTE: This assert does NOT call the function.
21040 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21041 MOZ_KnownLive(self)(self)->PassAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21042 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAny"
)), 0))
) {
21043 return false;
21044 }
21045 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21045); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21045; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21046 args.rval().setUndefined();
21047 return true;
21048}
21049
21050static const JSJitInfo passAny_methodinfo = {
21051 { (JSJitGetterOp)passAny },
21052 { prototypes::id::TestJSImplInterface },
21053 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21054 JSJitInfo::Method,
21055 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21056 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21057 false, /* isInfallible. False in setters. */
21058 false, /* isMovable. Not relevant for setters. */
21059 false, /* isEliminatable. Not relevant for setters. */
21060 false, /* isAlwaysInSlot. Only relevant for getters. */
21061 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21062 false, /* isTypedMethod. Only relevant for methods. */
21063 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21064};
21065
21066MOZ_CAN_RUN_SCRIPT static bool
21067passVariadicAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21068{
21069 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicAny");
21070 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21073( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21071 "TestJSImplInterface", "passVariadicAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21073( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21072 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21073( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21073 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21073( cx, "TestJSImplInterface"
, "passVariadicAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21074
21075 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21076 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21077 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21078 if (objIsXray) {
21079 unwrappedObj.emplace(cx, obj);
21080 }
21081 AutoSequence<JS::Value> arg0;
21082 SequenceRooter<JS::Value> arg0_holder(cx, &arg0);
21083 if (args.length() > 0) {
21084 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
21085 JS_ReportOutOfMemory(cx);
21086 return false;
21087 }
21088 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
21089 // OK to do infallible append here, since we ensured capacity already.
21090 JS::Value& slot = *arg0.AppendElement();
21091#ifdef __clang__1
21092#pragma clang diagnostic push
21093#pragma clang diagnostic ignored "-Wunreachable-code"
21094#pragma clang diagnostic ignored "-Wunreachable-code-return"
21095#endif // __clang__
21096 if ((true) && !CallerSubsumes(args[variadicArg])) {
21097 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21098 return false;
21099 }
21100#ifdef __clang__1
21101#pragma clang diagnostic pop
21102#endif // __clang__
21103 slot = args[variadicArg];
21104 }
21105 }
21106 if (objIsXray) {
21107 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21108 // we know Xrays have no dynamic unwrap behavior.
21109 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21110 if (!unwrappedObj.ref()) {
21111 return false;
21112 }
21113 }
21114 FastErrorResult rv;
21115 // NOTE: This assert does NOT call the function.
21116 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21117 MOZ_KnownLive(self)(self)->PassVariadicAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21118 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicAny"
)), 0))
) {
21119 return false;
21120 }
21121 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21121); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21121; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21122 args.rval().setUndefined();
21123 return true;
21124}
21125
21126static const JSJitInfo passVariadicAny_methodinfo = {
21127 { (JSJitGetterOp)passVariadicAny },
21128 { prototypes::id::TestJSImplInterface },
21129 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21130 JSJitInfo::Method,
21131 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21132 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21133 false, /* isInfallible. False in setters. */
21134 false, /* isMovable. Not relevant for setters. */
21135 false, /* isEliminatable. Not relevant for setters. */
21136 false, /* isAlwaysInSlot. Only relevant for getters. */
21137 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21138 false, /* isTypedMethod. Only relevant for methods. */
21139 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21140};
21141
21142MOZ_CAN_RUN_SCRIPT static bool
21143passOptionalAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21144{
21145 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalAny");
21146 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21149( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21147 "TestJSImplInterface", "passOptionalAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21149( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21148 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21149( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21149 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21149( cx, "TestJSImplInterface"
, "passOptionalAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21150
21151 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21152 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21153 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21154 if (objIsXray) {
21155 unwrappedObj.emplace(cx, obj);
21156 }
21157 JS::Rooted<JS::Value> arg0(cx);
21158 if (args.hasDefined(0)) {
21159#ifdef __clang__1
21160#pragma clang diagnostic push
21161#pragma clang diagnostic ignored "-Wunreachable-code"
21162#pragma clang diagnostic ignored "-Wunreachable-code-return"
21163#endif // __clang__
21164 if ((true) && !CallerSubsumes(args[0])) {
21165 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21166 return false;
21167 }
21168#ifdef __clang__1
21169#pragma clang diagnostic pop
21170#endif // __clang__
21171 arg0 = args[0];
21172 } else {
21173 arg0 = JS::UndefinedValue();
21174 }
21175 if (objIsXray) {
21176 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21177 // we know Xrays have no dynamic unwrap behavior.
21178 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21179 if (!unwrappedObj.ref()) {
21180 return false;
21181 }
21182 }
21183 FastErrorResult rv;
21184 // NOTE: This assert does NOT call the function.
21185 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21186 MOZ_KnownLive(self)(self)->PassOptionalAny(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21187 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalAny"
)), 0))
) {
21188 return false;
21189 }
21190 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21190; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21191 args.rval().setUndefined();
21192 return true;
21193}
21194
21195static const JSJitInfo passOptionalAny_methodinfo = {
21196 { (JSJitGetterOp)passOptionalAny },
21197 { prototypes::id::TestJSImplInterface },
21198 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21199 JSJitInfo::Method,
21200 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21201 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21202 false, /* isInfallible. False in setters. */
21203 false, /* isMovable. Not relevant for setters. */
21204 false, /* isEliminatable. Not relevant for setters. */
21205 false, /* isAlwaysInSlot. Only relevant for getters. */
21206 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21207 false, /* isTypedMethod. Only relevant for methods. */
21208 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21209};
21210
21211MOZ_CAN_RUN_SCRIPT static bool
21212passAnyDefaultNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21213{
21214 BindingCallContext cx(cx_, "TestJSImplInterface.passAnyDefaultNull");
21215 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21218( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21216 "TestJSImplInterface", "passAnyDefaultNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21218( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21217 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21218( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21218 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21218( cx, "TestJSImplInterface"
, "passAnyDefaultNull", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21219
21220 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21221 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21222 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21223 if (objIsXray) {
21224 unwrappedObj.emplace(cx, obj);
21225 }
21226 JS::Rooted<JS::Value> arg0(cx);
21227 if (args.hasDefined(0)) {
21228#ifdef __clang__1
21229#pragma clang diagnostic push
21230#pragma clang diagnostic ignored "-Wunreachable-code"
21231#pragma clang diagnostic ignored "-Wunreachable-code-return"
21232#endif // __clang__
21233 if ((true) && !CallerSubsumes(args[0])) {
21234 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
21235 return false;
21236 }
21237#ifdef __clang__1
21238#pragma clang diagnostic pop
21239#endif // __clang__
21240 arg0 = args[0];
21241 } else {
21242 arg0 = JS::NullValue();
21243 }
21244 if (objIsXray) {
21245 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21246 // we know Xrays have no dynamic unwrap behavior.
21247 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21248 if (!unwrappedObj.ref()) {
21249 return false;
21250 }
21251 }
21252 FastErrorResult rv;
21253 // NOTE: This assert does NOT call the function.
21254 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAnyDefaultNull(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21255 MOZ_KnownLive(self)(self)->PassAnyDefaultNull(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21256 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAnyDefaultNull"
)), 0))
) {
21257 return false;
21258 }
21259 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21259); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21259; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21260 args.rval().setUndefined();
21261 return true;
21262}
21263
21264static const JSJitInfo passAnyDefaultNull_methodinfo = {
21265 { (JSJitGetterOp)passAnyDefaultNull },
21266 { prototypes::id::TestJSImplInterface },
21267 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21268 JSJitInfo::Method,
21269 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21270 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21271 false, /* isInfallible. False in setters. */
21272 false, /* isMovable. Not relevant for setters. */
21273 false, /* isEliminatable. Not relevant for setters. */
21274 false, /* isAlwaysInSlot. Only relevant for getters. */
21275 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21276 false, /* isTypedMethod. Only relevant for methods. */
21277 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21278};
21279
21280MOZ_CAN_RUN_SCRIPT static bool
21281passSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21282{
21283 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfAny");
21284 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21287( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21285 "TestJSImplInterface", "passSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21287( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21286 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21287( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
21287 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21287( cx, "TestJSImplInterface"
, "passSequenceOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
21288
21289 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21290 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfAny", 1)) {
21291 return false;
21292 }
21293 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21294 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21295 if (objIsXray) {
21296 unwrappedObj.emplace(cx, obj);
21297 }
21298 binding_detail::AutoSequence<JS::Value> arg0;
21299 SequenceRooter<JS::Value> arg0_holder(cx, &arg0);
21300 if (args[0].isObject()) {
21301 JS::ForOfIterator iter(cx);
21302 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21303 return false;
21304 }
21305 if (!iter.valueIsIterable()) {
21306 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21307 return false;
21308 }
21309 binding_detail::AutoSequence<JS::Value> &arr = arg0;
21310 JS::Rooted<JS::Value> temp(cx);
21311 while (true) {
21312 bool done;
21313 if (!iter.next(&temp, &done)) {
21314 return false;
21315 }
21316 if (done) {
21317 break;
21318 }
21319 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21320 if (!slotPtr) {
21321 JS_ReportOutOfMemory(cx);
21322 return false;
21323 }
21324 JS::Value& slot = *slotPtr;
21325#ifdef __clang__1
21326#pragma clang diagnostic push
21327#pragma clang diagnostic ignored "-Wunreachable-code"
21328#pragma clang diagnostic ignored "-Wunreachable-code-return"
21329#endif // __clang__
21330 if ((true) && !CallerSubsumes(temp)) {
21331 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21332 return false;
21333 }
21334#ifdef __clang__1
21335#pragma clang diagnostic pop
21336#endif // __clang__
21337 slot = temp;
21338 }
21339 } else {
21340 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21341 return false;
21342 }
21343 if (objIsXray) {
21344 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21345 // we know Xrays have no dynamic unwrap behavior.
21346 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21347 if (!unwrappedObj.ref()) {
21348 return false;
21349 }
21350 }
21351 FastErrorResult rv;
21352 // NOTE: This assert does NOT call the function.
21353 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21354 MOZ_KnownLive(self)(self)->PassSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21355 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfAny"
)), 0))
) {
21356 return false;
21357 }
21358 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21358); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21358; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21359 args.rval().setUndefined();
21360 return true;
21361}
21362
21363static const JSJitInfo passSequenceOfAny_methodinfo = {
21364 { (JSJitGetterOp)passSequenceOfAny },
21365 { prototypes::id::TestJSImplInterface },
21366 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21367 JSJitInfo::Method,
21368 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21369 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21370 false, /* isInfallible. False in setters. */
21371 false, /* isMovable. Not relevant for setters. */
21372 false, /* isEliminatable. Not relevant for setters. */
21373 false, /* isAlwaysInSlot. Only relevant for getters. */
21374 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21375 false, /* isTypedMethod. Only relevant for methods. */
21376 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21377};
21378
21379MOZ_CAN_RUN_SCRIPT static bool
21380passNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21381{
21382 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfAny");
21383 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21386( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21384 "TestJSImplInterface", "passNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21386( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21385 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21386( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21386 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21386( cx, "TestJSImplInterface"
, "passNullableSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21387
21388 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21389 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfAny", 1)) {
21390 return false;
21391 }
21392 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21393 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21394 if (objIsXray) {
21395 unwrappedObj.emplace(cx, obj);
21396 }
21397 Nullable<Sequence<JS::Value>> arg0;
21398 SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue());
21399 if (args[0].isObject()) {
21400 JS::ForOfIterator iter(cx);
21401 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21402 return false;
21403 }
21404 if (!iter.valueIsIterable()) {
21405 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21406 return false;
21407 }
21408 Sequence<JS::Value> &arr = arg0.SetValue();
21409 JS::Rooted<JS::Value> temp(cx);
21410 while (true) {
21411 bool done;
21412 if (!iter.next(&temp, &done)) {
21413 return false;
21414 }
21415 if (done) {
21416 break;
21417 }
21418 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21419 if (!slotPtr) {
21420 JS_ReportOutOfMemory(cx);
21421 return false;
21422 }
21423 JS::Value& slot = *slotPtr;
21424#ifdef __clang__1
21425#pragma clang diagnostic push
21426#pragma clang diagnostic ignored "-Wunreachable-code"
21427#pragma clang diagnostic ignored "-Wunreachable-code-return"
21428#endif // __clang__
21429 if ((true) && !CallerSubsumes(temp)) {
21430 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21431 return false;
21432 }
21433#ifdef __clang__1
21434#pragma clang diagnostic pop
21435#endif // __clang__
21436 slot = temp;
21437 }
21438 } else if (args[0].isNullOrUndefined()) {
21439 arg0.SetNull();
21440 } else {
21441 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21442 return false;
21443 }
21444 if (objIsXray) {
21445 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21446 // we know Xrays have no dynamic unwrap behavior.
21447 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21448 if (!unwrappedObj.ref()) {
21449 return false;
21450 }
21451 }
21452 FastErrorResult rv;
21453 // NOTE: This assert does NOT call the function.
21454 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21455 MOZ_KnownLive(self)(self)->PassNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21456 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfAny"
)), 0))
) {
21457 return false;
21458 }
21459 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21459); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21459; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21460 args.rval().setUndefined();
21461 return true;
21462}
21463
21464static const JSJitInfo passNullableSequenceOfAny_methodinfo = {
21465 { (JSJitGetterOp)passNullableSequenceOfAny },
21466 { prototypes::id::TestJSImplInterface },
21467 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21468 JSJitInfo::Method,
21469 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21470 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21471 false, /* isInfallible. False in setters. */
21472 false, /* isMovable. Not relevant for setters. */
21473 false, /* isEliminatable. Not relevant for setters. */
21474 false, /* isAlwaysInSlot. Only relevant for getters. */
21475 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21476 false, /* isTypedMethod. Only relevant for methods. */
21477 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21478};
21479
21480MOZ_CAN_RUN_SCRIPT static bool
21481passOptionalSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21482{
21483 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAny");
21484 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21487( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21485 "TestJSImplInterface", "passOptionalSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21487( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21486 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21487( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21487 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21487( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21488
21489 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21490 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21491 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21492 if (objIsXray) {
21493 unwrappedObj.emplace(cx, obj);
21494 }
21495 Optional<Sequence<JS::Value>> arg0;
21496 Maybe<SequenceRooter<JS::Value>> arg0_holder;
21497 if (args.hasDefined(0)) {
21498 arg0.Construct();
21499 arg0_holder.emplace(cx, &arg0.Value());
21500 if (args[0].isObject()) {
21501 JS::ForOfIterator iter(cx);
21502 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21503 return false;
21504 }
21505 if (!iter.valueIsIterable()) {
21506 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21507 return false;
21508 }
21509 Sequence<JS::Value> &arr = arg0.Value();
21510 JS::Rooted<JS::Value> temp(cx);
21511 while (true) {
21512 bool done;
21513 if (!iter.next(&temp, &done)) {
21514 return false;
21515 }
21516 if (done) {
21517 break;
21518 }
21519 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21520 if (!slotPtr) {
21521 JS_ReportOutOfMemory(cx);
21522 return false;
21523 }
21524 JS::Value& slot = *slotPtr;
21525#ifdef __clang__1
21526#pragma clang diagnostic push
21527#pragma clang diagnostic ignored "-Wunreachable-code"
21528#pragma clang diagnostic ignored "-Wunreachable-code-return"
21529#endif // __clang__
21530 if ((true) && !CallerSubsumes(temp)) {
21531 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21532 return false;
21533 }
21534#ifdef __clang__1
21535#pragma clang diagnostic pop
21536#endif // __clang__
21537 slot = temp;
21538 }
21539 } else {
21540 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21541 return false;
21542 }
21543 }
21544 if (objIsXray) {
21545 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21546 // we know Xrays have no dynamic unwrap behavior.
21547 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21548 if (!unwrappedObj.ref()) {
21549 return false;
21550 }
21551 }
21552 FastErrorResult rv;
21553 // NOTE: This assert does NOT call the function.
21554 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21555 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21556 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAny"
)), 0))
) {
21557 return false;
21558 }
21559 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21559); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21559; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21560 args.rval().setUndefined();
21561 return true;
21562}
21563
21564static const JSJitInfo passOptionalSequenceOfAny_methodinfo = {
21565 { (JSJitGetterOp)passOptionalSequenceOfAny },
21566 { prototypes::id::TestJSImplInterface },
21567 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21568 JSJitInfo::Method,
21569 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21570 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21571 false, /* isInfallible. False in setters. */
21572 false, /* isMovable. Not relevant for setters. */
21573 false, /* isEliminatable. Not relevant for setters. */
21574 false, /* isAlwaysInSlot. Only relevant for getters. */
21575 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21576 false, /* isTypedMethod. Only relevant for methods. */
21577 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21578};
21579
21580MOZ_CAN_RUN_SCRIPT static bool
21581passOptionalNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21582{
21583 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfAny");
21584 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21587( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21585 "TestJSImplInterface", "passOptionalNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21587( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21586 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21587( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21587 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21587( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21588
21589 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21590 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21591 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21592 if (objIsXray) {
21593 unwrappedObj.emplace(cx, obj);
21594 }
21595 Optional<Nullable<Sequence<JS::Value>>> arg0;
21596 Maybe<SequenceRooter<JS::Value>> arg0_holder;
21597 if (args.hasDefined(0)) {
21598 arg0.Construct();
21599 arg0_holder.emplace(cx, &arg0.Value().SetValue());
21600 if (args[0].isObject()) {
21601 JS::ForOfIterator iter(cx);
21602 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21603 return false;
21604 }
21605 if (!iter.valueIsIterable()) {
21606 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21607 return false;
21608 }
21609 Sequence<JS::Value> &arr = arg0.Value().SetValue();
21610 JS::Rooted<JS::Value> temp(cx);
21611 while (true) {
21612 bool done;
21613 if (!iter.next(&temp, &done)) {
21614 return false;
21615 }
21616 if (done) {
21617 break;
21618 }
21619 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21620 if (!slotPtr) {
21621 JS_ReportOutOfMemory(cx);
21622 return false;
21623 }
21624 JS::Value& slot = *slotPtr;
21625#ifdef __clang__1
21626#pragma clang diagnostic push
21627#pragma clang diagnostic ignored "-Wunreachable-code"
21628#pragma clang diagnostic ignored "-Wunreachable-code-return"
21629#endif // __clang__
21630 if ((true) && !CallerSubsumes(temp)) {
21631 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21632 return false;
21633 }
21634#ifdef __clang__1
21635#pragma clang diagnostic pop
21636#endif // __clang__
21637 slot = temp;
21638 }
21639 } else if (args[0].isNullOrUndefined()) {
21640 arg0.Value().SetNull();
21641 } else {
21642 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21643 return false;
21644 }
21645 }
21646 if (objIsXray) {
21647 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21648 // we know Xrays have no dynamic unwrap behavior.
21649 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21650 if (!unwrappedObj.ref()) {
21651 return false;
21652 }
21653 }
21654 FastErrorResult rv;
21655 // NOTE: This assert does NOT call the function.
21656 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21657 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21658 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfAny"
)), 0))
) {
21659 return false;
21660 }
21661 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21661); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21661; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21662 args.rval().setUndefined();
21663 return true;
21664}
21665
21666static const JSJitInfo passOptionalNullableSequenceOfAny_methodinfo = {
21667 { (JSJitGetterOp)passOptionalNullableSequenceOfAny },
21668 { prototypes::id::TestJSImplInterface },
21669 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21670 JSJitInfo::Method,
21671 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21672 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21673 false, /* isInfallible. False in setters. */
21674 false, /* isMovable. Not relevant for setters. */
21675 false, /* isEliminatable. Not relevant for setters. */
21676 false, /* isAlwaysInSlot. Only relevant for getters. */
21677 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21678 false, /* isTypedMethod. Only relevant for methods. */
21679 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21680};
21681
21682MOZ_CAN_RUN_SCRIPT static bool
21683passOptionalSequenceOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21684{
21685 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue");
21686 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21689( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21687 "TestJSImplInterface", "passOptionalSequenceOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21689( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21688 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21689( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21689 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21689( cx, "TestJSImplInterface"
, "passOptionalSequenceOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21690
21691 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21692 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21693 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21694 if (objIsXray) {
21695 unwrappedObj.emplace(cx, obj);
21696 }
21697 Nullable<Sequence<JS::Value>> arg0;
21698 SequenceRooter<JS::Value> arg0_holder(cx, &arg0.SetValue());
21699 if (args.hasDefined(0)) {
21700 if (args[0].isObject()) {
21701 JS::ForOfIterator iter(cx);
21702 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21703 return false;
21704 }
21705 if (!iter.valueIsIterable()) {
21706 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21707 return false;
21708 }
21709 Sequence<JS::Value> &arr = arg0.SetValue();
21710 JS::Rooted<JS::Value> temp(cx);
21711 while (true) {
21712 bool done;
21713 if (!iter.next(&temp, &done)) {
21714 return false;
21715 }
21716 if (done) {
21717 break;
21718 }
21719 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
21720 if (!slotPtr) {
21721 JS_ReportOutOfMemory(cx);
21722 return false;
21723 }
21724 JS::Value& slot = *slotPtr;
21725#ifdef __clang__1
21726#pragma clang diagnostic push
21727#pragma clang diagnostic ignored "-Wunreachable-code"
21728#pragma clang diagnostic ignored "-Wunreachable-code-return"
21729#endif // __clang__
21730 if ((true) && !CallerSubsumes(temp)) {
21731 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
21732 return false;
21733 }
21734#ifdef __clang__1
21735#pragma clang diagnostic pop
21736#endif // __clang__
21737 slot = temp;
21738 }
21739 } else if (args[0].isNullOrUndefined()) {
21740 arg0.SetNull();
21741 } else {
21742 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21743 return false;
21744 }
21745 } else {
21746 arg0.SetNull();
21747 }
21748 if (objIsXray) {
21749 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21750 // we know Xrays have no dynamic unwrap behavior.
21751 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21752 if (!unwrappedObj.ref()) {
21753 return false;
21754 }
21755 }
21756 FastErrorResult rv;
21757 // NOTE: This assert does NOT call the function.
21758 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21759 MOZ_KnownLive(self)(self)->PassOptionalSequenceOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21760 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue"
)), 0))
) {
21761 return false;
21762 }
21763 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21763); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21763; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21764 args.rval().setUndefined();
21765 return true;
21766}
21767
21768static const JSJitInfo passOptionalSequenceOfAnyWithDefaultValue_methodinfo = {
21769 { (JSJitGetterOp)passOptionalSequenceOfAnyWithDefaultValue },
21770 { prototypes::id::TestJSImplInterface },
21771 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21772 JSJitInfo::Method,
21773 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21774 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21775 false, /* isInfallible. False in setters. */
21776 false, /* isMovable. Not relevant for setters. */
21777 false, /* isEliminatable. Not relevant for setters. */
21778 false, /* isAlwaysInSlot. Only relevant for getters. */
21779 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21780 false, /* isTypedMethod. Only relevant for methods. */
21781 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21782};
21783
21784MOZ_CAN_RUN_SCRIPT static bool
21785passSequenceOfSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21786{
21787 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfSequenceOfAny");
21788 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21791( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21789 "TestJSImplInterface", "passSequenceOfSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21791( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21790 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21791( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21791 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21791( cx, "TestJSImplInterface"
, "passSequenceOfSequenceOfAny", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21792
21793 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21794 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny", 1)) {
21795 return false;
21796 }
21797 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21798 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21799 if (objIsXray) {
21800 unwrappedObj.emplace(cx, obj);
21801 }
21802 binding_detail::AutoSequence<Sequence<JS::Value>> arg0;
21803 SequenceRooter<Sequence<JS::Value>> arg0_holder(cx, &arg0);
21804 if (args[0].isObject()) {
21805 JS::ForOfIterator iter(cx);
21806 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21807 return false;
21808 }
21809 if (!iter.valueIsIterable()) {
21810 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21811 return false;
21812 }
21813 binding_detail::AutoSequence<Sequence<JS::Value>> &arr = arg0;
21814 JS::Rooted<JS::Value> temp(cx);
21815 while (true) {
21816 bool done;
21817 if (!iter.next(&temp, &done)) {
21818 return false;
21819 }
21820 if (done) {
21821 break;
21822 }
21823 Sequence<JS::Value>* slotPtr = arr.AppendElement(mozilla::fallible);
21824 if (!slotPtr) {
21825 JS_ReportOutOfMemory(cx);
21826 return false;
21827 }
21828 Sequence<JS::Value>& slot = *slotPtr;
21829 if (temp.isObject()) {
21830 JS::ForOfIterator iter1(cx);
21831 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
21832 return false;
21833 }
21834 if (!iter1.valueIsIterable()) {
21835 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
21836 return false;
21837 }
21838 Sequence<JS::Value> &arr1 = slot;
21839 JS::Rooted<JS::Value> temp1(cx);
21840 while (true) {
21841 bool done1;
21842 if (!iter1.next(&temp1, &done1)) {
21843 return false;
21844 }
21845 if (done1) {
21846 break;
21847 }
21848 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
21849 if (!slotPtr1) {
21850 JS_ReportOutOfMemory(cx);
21851 return false;
21852 }
21853 JS::Value& slot1 = *slotPtr1;
21854#ifdef __clang__1
21855#pragma clang diagnostic push
21856#pragma clang diagnostic ignored "-Wunreachable-code"
21857#pragma clang diagnostic ignored "-Wunreachable-code-return"
21858#endif // __clang__
21859 if ((true) && !CallerSubsumes(temp1)) {
21860 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
21861 return false;
21862 }
21863#ifdef __clang__1
21864#pragma clang diagnostic pop
21865#endif // __clang__
21866 slot1 = temp1;
21867 }
21868 } else {
21869 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
21870 return false;
21871 }
21872 }
21873 } else {
21874 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21875 return false;
21876 }
21877 if (objIsXray) {
21878 // Since our object is an Xray, we can just CheckedUnwrapStatic:
21879 // we know Xrays have no dynamic unwrap behavior.
21880 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
21881 if (!unwrappedObj.ref()) {
21882 return false;
21883 }
21884 }
21885 FastErrorResult rv;
21886 // NOTE: This assert does NOT call the function.
21887 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
21888 MOZ_KnownLive(self)(self)->PassSequenceOfSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
21889 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfSequenceOfAny"
)), 0))
) {
21890 return false;
21891 }
21892 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 21892); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 21892; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
21893 args.rval().setUndefined();
21894 return true;
21895}
21896
21897static const JSJitInfo passSequenceOfSequenceOfAny_methodinfo = {
21898 { (JSJitGetterOp)passSequenceOfSequenceOfAny },
21899 { prototypes::id::TestJSImplInterface },
21900 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
21901 JSJitInfo::Method,
21902 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
21903 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
21904 false, /* isInfallible. False in setters. */
21905 false, /* isMovable. Not relevant for setters. */
21906 false, /* isEliminatable. Not relevant for setters. */
21907 false, /* isAlwaysInSlot. Only relevant for getters. */
21908 false, /* isLazilyCachedInSlot. Only relevant for getters. */
21909 false, /* isTypedMethod. Only relevant for methods. */
21910 0 /* Reserved slot index, if we're stored in a slot, else 0. */
21911};
21912
21913MOZ_CAN_RUN_SCRIPT static bool
21914passSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
21915{
21916 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny");
21917 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject21920( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21918 "TestJSImplInterface", "passSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject21920( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21919 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject21920( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
21920 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject21920( cx, "TestJSImplInterface"
, "passSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
21921
21922 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
21923 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", 1)) {
21924 return false;
21925 }
21926 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
21927 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
21928 if (objIsXray) {
21929 unwrappedObj.emplace(cx, obj);
21930 }
21931 binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> arg0;
21932 SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0);
21933 if (args[0].isObject()) {
21934 JS::ForOfIterator iter(cx);
21935 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
21936 return false;
21937 }
21938 if (!iter.valueIsIterable()) {
21939 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
21940 return false;
21941 }
21942 binding_detail::AutoSequence<Nullable<Sequence<JS::Value>>> &arr = arg0;
21943 JS::Rooted<JS::Value> temp(cx);
21944 while (true) {
21945 bool done;
21946 if (!iter.next(&temp, &done)) {
21947 return false;
21948 }
21949 if (done) {
21950 break;
21951 }
21952 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
21953 if (!slotPtr) {
21954 JS_ReportOutOfMemory(cx);
21955 return false;
21956 }
21957 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
21958 if (temp.isObject()) {
21959 JS::ForOfIterator iter1(cx);
21960 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
21961 return false;
21962 }
21963 if (!iter1.valueIsIterable()) {
21964 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
21965 return false;
21966 }
21967 Sequence<JS::Value> &arr1 = slot.SetValue();
21968 JS::Rooted<JS::Value> temp1(cx);
21969 while (true) {
21970 bool done1;
21971 if (!iter1.next(&temp1, &done1)) {
21972 return false;
21973 }
21974 if (done1) {
21975 break;
21976 }
21977 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
21978 if (!slotPtr1) {
21979 JS_ReportOutOfMemory(cx);
21980 return false;
21981 }
21982 JS::Value& slot1 = *slotPtr1;
21983#ifdef __clang__1
21984#pragma clang diagnostic push
21985#pragma clang diagnostic ignored "-Wunreachable-code"
21986#pragma clang diagnostic ignored "-Wunreachable-code-return"
21987#endif // __clang__
21988 if ((true) && !CallerSubsumes(temp1)) {
21989 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
21990 return false;
21991 }
21992#ifdef __clang__1
21993#pragma clang diagnostic pop
21994#endif // __clang__
21995 slot1 = temp1;
21996 }
21997 } else if (temp.isNullOrUndefined()) {
21998 slot.SetNull();
21999 } else {
22000 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22001 return false;
22002 }
22003 }
22004 } else {
22005 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22006 return false;
22007 }
22008 if (objIsXray) {
22009 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22010 // we know Xrays have no dynamic unwrap behavior.
22011 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22012 if (!unwrappedObj.ref()) {
22013 return false;
22014 }
22015 }
22016 FastErrorResult rv;
22017 // NOTE: This assert does NOT call the function.
22018 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22019 MOZ_KnownLive(self)(self)->PassSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22020 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny"
)), 0))
) {
22021 return false;
22022 }
22023 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22023); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22023; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22024 args.rval().setUndefined();
22025 return true;
22026}
22027
22028static const JSJitInfo passSequenceOfNullableSequenceOfAny_methodinfo = {
22029 { (JSJitGetterOp)passSequenceOfNullableSequenceOfAny },
22030 { prototypes::id::TestJSImplInterface },
22031 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22032 JSJitInfo::Method,
22033 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22034 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22035 false, /* isInfallible. False in setters. */
22036 false, /* isMovable. Not relevant for setters. */
22037 false, /* isEliminatable. Not relevant for setters. */
22038 false, /* isAlwaysInSlot. Only relevant for getters. */
22039 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22040 false, /* isTypedMethod. Only relevant for methods. */
22041 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22042};
22043
22044MOZ_CAN_RUN_SCRIPT static bool
22045passNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22046{
22047 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny");
22048 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22051( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22049 "TestJSImplInterface", "passNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22051( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22050 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22051( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22051 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22051( cx, "TestJSImplInterface"
, "passNullableSequenceOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22052
22053 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22054 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", 1)) {
22055 return false;
22056 }
22057 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22058 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22059 if (objIsXray) {
22060 unwrappedObj.emplace(cx, obj);
22061 }
22062 Nullable<Sequence<Nullable<Sequence<JS::Value>>>> arg0;
22063 SequenceRooter<Nullable<Sequence<JS::Value>>> arg0_holder(cx, &arg0.SetValue());
22064 if (args[0].isObject()) {
22065 JS::ForOfIterator iter(cx);
22066 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
22067 return false;
22068 }
22069 if (!iter.valueIsIterable()) {
22070 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22071 return false;
22072 }
22073 Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.SetValue();
22074 JS::Rooted<JS::Value> temp(cx);
22075 while (true) {
22076 bool done;
22077 if (!iter.next(&temp, &done)) {
22078 return false;
22079 }
22080 if (done) {
22081 break;
22082 }
22083 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
22084 if (!slotPtr) {
22085 JS_ReportOutOfMemory(cx);
22086 return false;
22087 }
22088 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
22089 if (temp.isObject()) {
22090 JS::ForOfIterator iter1(cx);
22091 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
22092 return false;
22093 }
22094 if (!iter1.valueIsIterable()) {
22095 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22096 return false;
22097 }
22098 Sequence<JS::Value> &arr1 = slot.SetValue();
22099 JS::Rooted<JS::Value> temp1(cx);
22100 while (true) {
22101 bool done1;
22102 if (!iter1.next(&temp1, &done1)) {
22103 return false;
22104 }
22105 if (done1) {
22106 break;
22107 }
22108 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
22109 if (!slotPtr1) {
22110 JS_ReportOutOfMemory(cx);
22111 return false;
22112 }
22113 JS::Value& slot1 = *slotPtr1;
22114#ifdef __clang__1
22115#pragma clang diagnostic push
22116#pragma clang diagnostic ignored "-Wunreachable-code"
22117#pragma clang diagnostic ignored "-Wunreachable-code-return"
22118#endif // __clang__
22119 if ((true) && !CallerSubsumes(temp1)) {
22120 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
22121 return false;
22122 }
22123#ifdef __clang__1
22124#pragma clang diagnostic pop
22125#endif // __clang__
22126 slot1 = temp1;
22127 }
22128 } else if (temp.isNullOrUndefined()) {
22129 slot.SetNull();
22130 } else {
22131 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22132 return false;
22133 }
22134 }
22135 } else if (args[0].isNullOrUndefined()) {
22136 arg0.SetNull();
22137 } else {
22138 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22139 return false;
22140 }
22141 if (objIsXray) {
22142 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22143 // we know Xrays have no dynamic unwrap behavior.
22144 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22145 if (!unwrappedObj.ref()) {
22146 return false;
22147 }
22148 }
22149 FastErrorResult rv;
22150 // NOTE: This assert does NOT call the function.
22151 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22152 MOZ_KnownLive(self)(self)->PassNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny"
)), 0))
) {
22154 return false;
22155 }
22156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22156; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22157 args.rval().setUndefined();
22158 return true;
22159}
22160
22161static const JSJitInfo passNullableSequenceOfNullableSequenceOfAny_methodinfo = {
22162 { (JSJitGetterOp)passNullableSequenceOfNullableSequenceOfAny },
22163 { prototypes::id::TestJSImplInterface },
22164 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22165 JSJitInfo::Method,
22166 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22167 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22168 false, /* isInfallible. False in setters. */
22169 false, /* isMovable. Not relevant for setters. */
22170 false, /* isEliminatable. Not relevant for setters. */
22171 false, /* isAlwaysInSlot. Only relevant for getters. */
22172 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22173 false, /* isTypedMethod. Only relevant for methods. */
22174 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22175};
22176
22177MOZ_CAN_RUN_SCRIPT static bool
22178passOptionalNullableSequenceOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22179{
22180 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny");
22181 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22184( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22182 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22184( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22183 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22184( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
22184 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22184( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfAny", JS::
ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame::
Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
22185
22186 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22187 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22188 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22189 if (objIsXray) {
22190 unwrappedObj.emplace(cx, obj);
22191 }
22192 Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>> arg0;
22193 Maybe<SequenceRooter<Nullable<Sequence<JS::Value>>>> arg0_holder;
22194 if (args.hasDefined(0)) {
22195 arg0.Construct();
22196 arg0_holder.emplace(cx, &arg0.Value().SetValue());
22197 if (args[0].isObject()) {
22198 JS::ForOfIterator iter(cx);
22199 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
22200 return false;
22201 }
22202 if (!iter.valueIsIterable()) {
22203 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22204 return false;
22205 }
22206 Sequence<Nullable<Sequence<JS::Value>>> &arr = arg0.Value().SetValue();
22207 JS::Rooted<JS::Value> temp(cx);
22208 while (true) {
22209 bool done;
22210 if (!iter.next(&temp, &done)) {
22211 return false;
22212 }
22213 if (done) {
22214 break;
22215 }
22216 Nullable<Sequence<JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
22217 if (!slotPtr) {
22218 JS_ReportOutOfMemory(cx);
22219 return false;
22220 }
22221 Nullable<Sequence<JS::Value>>& slot = *slotPtr;
22222 if (temp.isObject()) {
22223 JS::ForOfIterator iter1(cx);
22224 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
22225 return false;
22226 }
22227 if (!iter1.valueIsIterable()) {
22228 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22229 return false;
22230 }
22231 Sequence<JS::Value> &arr1 = slot.SetValue();
22232 JS::Rooted<JS::Value> temp1(cx);
22233 while (true) {
22234 bool done1;
22235 if (!iter1.next(&temp1, &done1)) {
22236 return false;
22237 }
22238 if (done1) {
22239 break;
22240 }
22241 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
22242 if (!slotPtr1) {
22243 JS_ReportOutOfMemory(cx);
22244 return false;
22245 }
22246 JS::Value& slot1 = *slotPtr1;
22247#ifdef __clang__1
22248#pragma clang diagnostic push
22249#pragma clang diagnostic ignored "-Wunreachable-code"
22250#pragma clang diagnostic ignored "-Wunreachable-code-return"
22251#endif // __clang__
22252 if ((true) && !CallerSubsumes(temp1)) {
22253 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
22254 return false;
22255 }
22256#ifdef __clang__1
22257#pragma clang diagnostic pop
22258#endif // __clang__
22259 slot1 = temp1;
22260 }
22261 } else if (temp.isNullOrUndefined()) {
22262 slot.SetNull();
22263 } else {
22264 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
22265 return false;
22266 }
22267 }
22268 } else if (args[0].isNullOrUndefined()) {
22269 arg0.Value().SetNull();
22270 } else {
22271 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
22272 return false;
22273 }
22274 }
22275 if (objIsXray) {
22276 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22277 // we know Xrays have no dynamic unwrap behavior.
22278 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22279 if (!unwrappedObj.ref()) {
22280 return false;
22281 }
22282 }
22283 FastErrorResult rv;
22284 // NOTE: This assert does NOT call the function.
22285 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22286 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22287 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny"
)), 0))
) {
22288 return false;
22289 }
22290 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22290); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22290; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22291 args.rval().setUndefined();
22292 return true;
22293}
22294
22295static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo = {
22296 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfAny },
22297 { prototypes::id::TestJSImplInterface },
22298 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22299 JSJitInfo::Method,
22300 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22301 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22302 false, /* isInfallible. False in setters. */
22303 false, /* isMovable. Not relevant for setters. */
22304 false, /* isEliminatable. Not relevant for setters. */
22305 false, /* isAlwaysInSlot. Only relevant for getters. */
22306 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22307 false, /* isTypedMethod. Only relevant for methods. */
22308 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22309};
22310
22311MOZ_CAN_RUN_SCRIPT static bool
22312passRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22313{
22314 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfAny");
22315 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22318( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22316 "TestJSImplInterface", "passRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22318( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22317 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22318( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22318 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22318( cx, "TestJSImplInterface"
, "passRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22319
22320 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22321 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfAny", 1)) {
22322 return false;
22323 }
22324 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22325 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22326 if (objIsXray) {
22327 unwrappedObj.emplace(cx, obj);
22328 }
22329 Record<nsString, JS::Value> arg0;
22330 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0);
22331 if (args[0].isObject()) {
22332 auto& recordEntries = arg0.Entries();
22333
22334 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22335 JS::RootedVector<jsid> ids(cx);
22336 if (!js::GetPropertyKeys(cx, recordObj,
22337 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22338 return false;
22339 }
22340 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22341 JS_ReportOutOfMemory(cx);
22342 return false;
22343 }
22344 JS::Rooted<JS::Value> propNameValue(cx);
22345 JS::Rooted<JS::Value> temp(cx);
22346 JS::Rooted<jsid> curId(cx);
22347 JS::Rooted<JS::Value> idVal(cx);
22348 // Use a hashset to keep track of ids seen, to avoid
22349 // introducing nasty O(N^2) behavior scanning for them all the
22350 // time. Ideally we'd use a data structure with O(1) lookup
22351 // _and_ ordering for the MozMap, but we don't have one lying
22352 // around.
22353 nsTHashtable<nsStringHashKey> idsSeen;
22354 for (size_t i = 0; i < ids.length(); ++i) {
22355 curId = ids[i];
22356
22357 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22358 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22359 &desc)) {
22360 return false;
22361 }
22362
22363 if (desc.isNothing() || !desc->enumerable()) {
22364 continue;
22365 }
22366
22367 idVal = js::IdToValue(curId);
22368 nsString propName;
22369 // This will just throw if idVal is a Symbol, like the spec says
22370 // to do.
22371 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22372 return false;
22373 }
22374
22375 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22376 return false;
22377 }
22378
22379 Record<nsString, JS::Value>::EntryType* entry;
22380 if (!idsSeen.EnsureInserted(propName)) {
22381 // Find the existing entry.
22382 auto idx = recordEntries.IndexOf(propName);
22383 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22384); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22384; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22384 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22384); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22384; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22385 // Now blow it away to make it look like it was just added
22386 // to the array, because it's not obvious that it's
22387 // safe to write to its already-initialized mValue via our
22388 // normal codegen conversions. For example, the value
22389 // could be a union and this would change its type, but
22390 // codegen assumes we won't do that.
22391 entry = recordEntries.ReconstructElementAt(idx);
22392 } else {
22393 // Safe to do an infallible append here, because we did a
22394 // SetCapacity above to the right capacity.
22395 entry = recordEntries.AppendElement();
22396 }
22397 entry->mKey = propName;
22398 JS::Value& slot = entry->mValue;
22399#ifdef __clang__1
22400#pragma clang diagnostic push
22401#pragma clang diagnostic ignored "-Wunreachable-code"
22402#pragma clang diagnostic ignored "-Wunreachable-code-return"
22403#endif // __clang__
22404 if ((true) && !CallerSubsumes(temp)) {
22405 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22406 return false;
22407 }
22408#ifdef __clang__1
22409#pragma clang diagnostic pop
22410#endif // __clang__
22411 slot = temp;
22412 }
22413 } else {
22414 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22415 return false;
22416 }
22417 if (objIsXray) {
22418 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22419 // we know Xrays have no dynamic unwrap behavior.
22420 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22421 if (!unwrappedObj.ref()) {
22422 return false;
22423 }
22424 }
22425 FastErrorResult rv;
22426 // NOTE: This assert does NOT call the function.
22427 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22428 MOZ_KnownLive(self)(self)->PassRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22429 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfAny"
)), 0))
) {
22430 return false;
22431 }
22432 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22432); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22432; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22433 args.rval().setUndefined();
22434 return true;
22435}
22436
22437static const JSJitInfo passRecordOfAny_methodinfo = {
22438 { (JSJitGetterOp)passRecordOfAny },
22439 { prototypes::id::TestJSImplInterface },
22440 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22441 JSJitInfo::Method,
22442 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22443 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22444 false, /* isInfallible. False in setters. */
22445 false, /* isMovable. Not relevant for setters. */
22446 false, /* isEliminatable. Not relevant for setters. */
22447 false, /* isAlwaysInSlot. Only relevant for getters. */
22448 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22449 false, /* isTypedMethod. Only relevant for methods. */
22450 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22451};
22452
22453MOZ_CAN_RUN_SCRIPT static bool
22454passNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22455{
22456 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfAny");
22457 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22460( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22458 "TestJSImplInterface", "passNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22460( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22459 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22460( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22460 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22460( cx, "TestJSImplInterface"
, "passNullableRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22461
22462 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22463 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfAny", 1)) {
22464 return false;
22465 }
22466 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22467 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22468 if (objIsXray) {
22469 unwrappedObj.emplace(cx, obj);
22470 }
22471 Nullable<Record<nsString, JS::Value>> arg0;
22472 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue());
22473 if (args[0].isObject()) {
22474 auto& recordEntries = arg0.SetValue().Entries();
22475
22476 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22477 JS::RootedVector<jsid> ids(cx);
22478 if (!js::GetPropertyKeys(cx, recordObj,
22479 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22480 return false;
22481 }
22482 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22483 JS_ReportOutOfMemory(cx);
22484 return false;
22485 }
22486 JS::Rooted<JS::Value> propNameValue(cx);
22487 JS::Rooted<JS::Value> temp(cx);
22488 JS::Rooted<jsid> curId(cx);
22489 JS::Rooted<JS::Value> idVal(cx);
22490 // Use a hashset to keep track of ids seen, to avoid
22491 // introducing nasty O(N^2) behavior scanning for them all the
22492 // time. Ideally we'd use a data structure with O(1) lookup
22493 // _and_ ordering for the MozMap, but we don't have one lying
22494 // around.
22495 nsTHashtable<nsStringHashKey> idsSeen;
22496 for (size_t i = 0; i < ids.length(); ++i) {
22497 curId = ids[i];
22498
22499 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22500 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22501 &desc)) {
22502 return false;
22503 }
22504
22505 if (desc.isNothing() || !desc->enumerable()) {
22506 continue;
22507 }
22508
22509 idVal = js::IdToValue(curId);
22510 nsString propName;
22511 // This will just throw if idVal is a Symbol, like the spec says
22512 // to do.
22513 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22514 return false;
22515 }
22516
22517 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22518 return false;
22519 }
22520
22521 Record<nsString, JS::Value>::EntryType* entry;
22522 if (!idsSeen.EnsureInserted(propName)) {
22523 // Find the existing entry.
22524 auto idx = recordEntries.IndexOf(propName);
22525 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22526); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22526; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22526 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22526); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22526; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22527 // Now blow it away to make it look like it was just added
22528 // to the array, because it's not obvious that it's
22529 // safe to write to its already-initialized mValue via our
22530 // normal codegen conversions. For example, the value
22531 // could be a union and this would change its type, but
22532 // codegen assumes we won't do that.
22533 entry = recordEntries.ReconstructElementAt(idx);
22534 } else {
22535 // Safe to do an infallible append here, because we did a
22536 // SetCapacity above to the right capacity.
22537 entry = recordEntries.AppendElement();
22538 }
22539 entry->mKey = propName;
22540 JS::Value& slot = entry->mValue;
22541#ifdef __clang__1
22542#pragma clang diagnostic push
22543#pragma clang diagnostic ignored "-Wunreachable-code"
22544#pragma clang diagnostic ignored "-Wunreachable-code-return"
22545#endif // __clang__
22546 if ((true) && !CallerSubsumes(temp)) {
22547 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22548 return false;
22549 }
22550#ifdef __clang__1
22551#pragma clang diagnostic pop
22552#endif // __clang__
22553 slot = temp;
22554 }
22555 } else if (args[0].isNullOrUndefined()) {
22556 arg0.SetNull();
22557 } else {
22558 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22559 return false;
22560 }
22561 if (objIsXray) {
22562 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22563 // we know Xrays have no dynamic unwrap behavior.
22564 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22565 if (!unwrappedObj.ref()) {
22566 return false;
22567 }
22568 }
22569 FastErrorResult rv;
22570 // NOTE: This assert does NOT call the function.
22571 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22572 MOZ_KnownLive(self)(self)->PassNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22573 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfAny"
)), 0))
) {
22574 return false;
22575 }
22576 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22576); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22576; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22577 args.rval().setUndefined();
22578 return true;
22579}
22580
22581static const JSJitInfo passNullableRecordOfAny_methodinfo = {
22582 { (JSJitGetterOp)passNullableRecordOfAny },
22583 { prototypes::id::TestJSImplInterface },
22584 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22585 JSJitInfo::Method,
22586 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22587 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22588 false, /* isInfallible. False in setters. */
22589 false, /* isMovable. Not relevant for setters. */
22590 false, /* isEliminatable. Not relevant for setters. */
22591 false, /* isAlwaysInSlot. Only relevant for getters. */
22592 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22593 false, /* isTypedMethod. Only relevant for methods. */
22594 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22595};
22596
22597MOZ_CAN_RUN_SCRIPT static bool
22598passOptionalRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22599{
22600 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAny");
22601 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22604( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22602 "TestJSImplInterface", "passOptionalRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22604( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22603 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22604( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
22604 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22604( cx, "TestJSImplInterface"
, "passOptionalRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
22605
22606 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22607 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22608 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22609 if (objIsXray) {
22610 unwrappedObj.emplace(cx, obj);
22611 }
22612 Optional<Record<nsString, JS::Value>> arg0;
22613 Maybe<RecordRooter<nsString, JS::Value>> arg0_holder;
22614 if (args.hasDefined(0)) {
22615 arg0.Construct();
22616 arg0_holder.emplace(cx, &arg0.Value());
22617 if (args[0].isObject()) {
22618 auto& recordEntries = arg0.Value().Entries();
22619
22620 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22621 JS::RootedVector<jsid> ids(cx);
22622 if (!js::GetPropertyKeys(cx, recordObj,
22623 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22624 return false;
22625 }
22626 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22627 JS_ReportOutOfMemory(cx);
22628 return false;
22629 }
22630 JS::Rooted<JS::Value> propNameValue(cx);
22631 JS::Rooted<JS::Value> temp(cx);
22632 JS::Rooted<jsid> curId(cx);
22633 JS::Rooted<JS::Value> idVal(cx);
22634 // Use a hashset to keep track of ids seen, to avoid
22635 // introducing nasty O(N^2) behavior scanning for them all the
22636 // time. Ideally we'd use a data structure with O(1) lookup
22637 // _and_ ordering for the MozMap, but we don't have one lying
22638 // around.
22639 nsTHashtable<nsStringHashKey> idsSeen;
22640 for (size_t i = 0; i < ids.length(); ++i) {
22641 curId = ids[i];
22642
22643 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22644 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22645 &desc)) {
22646 return false;
22647 }
22648
22649 if (desc.isNothing() || !desc->enumerable()) {
22650 continue;
22651 }
22652
22653 idVal = js::IdToValue(curId);
22654 nsString propName;
22655 // This will just throw if idVal is a Symbol, like the spec says
22656 // to do.
22657 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22658 return false;
22659 }
22660
22661 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22662 return false;
22663 }
22664
22665 Record<nsString, JS::Value>::EntryType* entry;
22666 if (!idsSeen.EnsureInserted(propName)) {
22667 // Find the existing entry.
22668 auto idx = recordEntries.IndexOf(propName);
22669 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22670; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22670 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22670; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22671 // Now blow it away to make it look like it was just added
22672 // to the array, because it's not obvious that it's
22673 // safe to write to its already-initialized mValue via our
22674 // normal codegen conversions. For example, the value
22675 // could be a union and this would change its type, but
22676 // codegen assumes we won't do that.
22677 entry = recordEntries.ReconstructElementAt(idx);
22678 } else {
22679 // Safe to do an infallible append here, because we did a
22680 // SetCapacity above to the right capacity.
22681 entry = recordEntries.AppendElement();
22682 }
22683 entry->mKey = propName;
22684 JS::Value& slot = entry->mValue;
22685#ifdef __clang__1
22686#pragma clang diagnostic push
22687#pragma clang diagnostic ignored "-Wunreachable-code"
22688#pragma clang diagnostic ignored "-Wunreachable-code-return"
22689#endif // __clang__
22690 if ((true) && !CallerSubsumes(temp)) {
22691 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22692 return false;
22693 }
22694#ifdef __clang__1
22695#pragma clang diagnostic pop
22696#endif // __clang__
22697 slot = temp;
22698 }
22699 } else {
22700 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22701 return false;
22702 }
22703 }
22704 if (objIsXray) {
22705 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22706 // we know Xrays have no dynamic unwrap behavior.
22707 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22708 if (!unwrappedObj.ref()) {
22709 return false;
22710 }
22711 }
22712 FastErrorResult rv;
22713 // NOTE: This assert does NOT call the function.
22714 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22715 MOZ_KnownLive(self)(self)->PassOptionalRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22716 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAny"
)), 0))
) {
22717 return false;
22718 }
22719 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22719); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22719; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22720 args.rval().setUndefined();
22721 return true;
22722}
22723
22724static const JSJitInfo passOptionalRecordOfAny_methodinfo = {
22725 { (JSJitGetterOp)passOptionalRecordOfAny },
22726 { prototypes::id::TestJSImplInterface },
22727 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22728 JSJitInfo::Method,
22729 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22730 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22731 false, /* isInfallible. False in setters. */
22732 false, /* isMovable. Not relevant for setters. */
22733 false, /* isEliminatable. Not relevant for setters. */
22734 false, /* isAlwaysInSlot. Only relevant for getters. */
22735 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22736 false, /* isTypedMethod. Only relevant for methods. */
22737 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22738};
22739
22740MOZ_CAN_RUN_SCRIPT static bool
22741passOptionalNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22742{
22743 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfAny");
22744 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22747( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22745 "TestJSImplInterface", "passOptionalNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22747( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22746 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22747( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22747 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22747( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22748
22749 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22750 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22751 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22752 if (objIsXray) {
22753 unwrappedObj.emplace(cx, obj);
22754 }
22755 Optional<Nullable<Record<nsString, JS::Value>>> arg0;
22756 Maybe<RecordRooter<nsString, JS::Value>> arg0_holder;
22757 if (args.hasDefined(0)) {
22758 arg0.Construct();
22759 arg0_holder.emplace(cx, &arg0.Value().SetValue());
22760 if (args[0].isObject()) {
22761 auto& recordEntries = arg0.Value().SetValue().Entries();
22762
22763 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22764 JS::RootedVector<jsid> ids(cx);
22765 if (!js::GetPropertyKeys(cx, recordObj,
22766 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22767 return false;
22768 }
22769 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22770 JS_ReportOutOfMemory(cx);
22771 return false;
22772 }
22773 JS::Rooted<JS::Value> propNameValue(cx);
22774 JS::Rooted<JS::Value> temp(cx);
22775 JS::Rooted<jsid> curId(cx);
22776 JS::Rooted<JS::Value> idVal(cx);
22777 // Use a hashset to keep track of ids seen, to avoid
22778 // introducing nasty O(N^2) behavior scanning for them all the
22779 // time. Ideally we'd use a data structure with O(1) lookup
22780 // _and_ ordering for the MozMap, but we don't have one lying
22781 // around.
22782 nsTHashtable<nsStringHashKey> idsSeen;
22783 for (size_t i = 0; i < ids.length(); ++i) {
22784 curId = ids[i];
22785
22786 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22787 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22788 &desc)) {
22789 return false;
22790 }
22791
22792 if (desc.isNothing() || !desc->enumerable()) {
22793 continue;
22794 }
22795
22796 idVal = js::IdToValue(curId);
22797 nsString propName;
22798 // This will just throw if idVal is a Symbol, like the spec says
22799 // to do.
22800 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22801 return false;
22802 }
22803
22804 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22805 return false;
22806 }
22807
22808 Record<nsString, JS::Value>::EntryType* entry;
22809 if (!idsSeen.EnsureInserted(propName)) {
22810 // Find the existing entry.
22811 auto idx = recordEntries.IndexOf(propName);
22812 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22813); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22813; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22813 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22813); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22813; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22814 // Now blow it away to make it look like it was just added
22815 // to the array, because it's not obvious that it's
22816 // safe to write to its already-initialized mValue via our
22817 // normal codegen conversions. For example, the value
22818 // could be a union and this would change its type, but
22819 // codegen assumes we won't do that.
22820 entry = recordEntries.ReconstructElementAt(idx);
22821 } else {
22822 // Safe to do an infallible append here, because we did a
22823 // SetCapacity above to the right capacity.
22824 entry = recordEntries.AppendElement();
22825 }
22826 entry->mKey = propName;
22827 JS::Value& slot = entry->mValue;
22828#ifdef __clang__1
22829#pragma clang diagnostic push
22830#pragma clang diagnostic ignored "-Wunreachable-code"
22831#pragma clang diagnostic ignored "-Wunreachable-code-return"
22832#endif // __clang__
22833 if ((true) && !CallerSubsumes(temp)) {
22834 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22835 return false;
22836 }
22837#ifdef __clang__1
22838#pragma clang diagnostic pop
22839#endif // __clang__
22840 slot = temp;
22841 }
22842 } else if (args[0].isNullOrUndefined()) {
22843 arg0.Value().SetNull();
22844 } else {
22845 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22846 return false;
22847 }
22848 }
22849 if (objIsXray) {
22850 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22851 // we know Xrays have no dynamic unwrap behavior.
22852 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22853 if (!unwrappedObj.ref()) {
22854 return false;
22855 }
22856 }
22857 FastErrorResult rv;
22858 // NOTE: This assert does NOT call the function.
22859 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
22860 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
22861 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfAny"
)), 0))
) {
22862 return false;
22863 }
22864 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 22864); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 22864; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
22865 args.rval().setUndefined();
22866 return true;
22867}
22868
22869static const JSJitInfo passOptionalNullableRecordOfAny_methodinfo = {
22870 { (JSJitGetterOp)passOptionalNullableRecordOfAny },
22871 { prototypes::id::TestJSImplInterface },
22872 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
22873 JSJitInfo::Method,
22874 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
22875 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
22876 false, /* isInfallible. False in setters. */
22877 false, /* isMovable. Not relevant for setters. */
22878 false, /* isEliminatable. Not relevant for setters. */
22879 false, /* isAlwaysInSlot. Only relevant for getters. */
22880 false, /* isLazilyCachedInSlot. Only relevant for getters. */
22881 false, /* isTypedMethod. Only relevant for methods. */
22882 0 /* Reserved slot index, if we're stored in a slot, else 0. */
22883};
22884
22885MOZ_CAN_RUN_SCRIPT static bool
22886passOptionalRecordOfAnyWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
22887{
22888 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue");
22889 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject22892( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22890 "TestJSImplInterface", "passOptionalRecordOfAnyWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject22892( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22891 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject22892( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
22892 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject22892( cx, "TestJSImplInterface"
, "passOptionalRecordOfAnyWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
22893
22894 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
22895 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
22896 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
22897 if (objIsXray) {
22898 unwrappedObj.emplace(cx, obj);
22899 }
22900 Nullable<Record<nsString, JS::Value>> arg0;
22901 RecordRooter<nsString, JS::Value> arg0_holder(cx, &arg0.SetValue());
22902 if (args.hasDefined(0)) {
22903 if (args[0].isObject()) {
22904 auto& recordEntries = arg0.SetValue().Entries();
22905
22906 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
22907 JS::RootedVector<jsid> ids(cx);
22908 if (!js::GetPropertyKeys(cx, recordObj,
22909 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
22910 return false;
22911 }
22912 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
22913 JS_ReportOutOfMemory(cx);
22914 return false;
22915 }
22916 JS::Rooted<JS::Value> propNameValue(cx);
22917 JS::Rooted<JS::Value> temp(cx);
22918 JS::Rooted<jsid> curId(cx);
22919 JS::Rooted<JS::Value> idVal(cx);
22920 // Use a hashset to keep track of ids seen, to avoid
22921 // introducing nasty O(N^2) behavior scanning for them all the
22922 // time. Ideally we'd use a data structure with O(1) lookup
22923 // _and_ ordering for the MozMap, but we don't have one lying
22924 // around.
22925 nsTHashtable<nsStringHashKey> idsSeen;
22926 for (size_t i = 0; i < ids.length(); ++i) {
22927 curId = ids[i];
22928
22929 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
22930 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
22931 &desc)) {
22932 return false;
22933 }
22934
22935 if (desc.isNothing() || !desc->enumerable()) {
22936 continue;
22937 }
22938
22939 idVal = js::IdToValue(curId);
22940 nsString propName;
22941 // This will just throw if idVal is a Symbol, like the spec says
22942 // to do.
22943 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
22944 return false;
22945 }
22946
22947 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
22948 return false;
22949 }
22950
22951 Record<nsString, JS::Value>::EntryType* entry;
22952 if (!idsSeen.EnsureInserted(propName)) {
22953 // Find the existing entry.
22954 auto idx = recordEntries.IndexOf(propName);
22955 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22956; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
22956 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 22956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 22956; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
22957 // Now blow it away to make it look like it was just added
22958 // to the array, because it's not obvious that it's
22959 // safe to write to its already-initialized mValue via our
22960 // normal codegen conversions. For example, the value
22961 // could be a union and this would change its type, but
22962 // codegen assumes we won't do that.
22963 entry = recordEntries.ReconstructElementAt(idx);
22964 } else {
22965 // Safe to do an infallible append here, because we did a
22966 // SetCapacity above to the right capacity.
22967 entry = recordEntries.AppendElement();
22968 }
22969 entry->mKey = propName;
22970 JS::Value& slot = entry->mValue;
22971#ifdef __clang__1
22972#pragma clang diagnostic push
22973#pragma clang diagnostic ignored "-Wunreachable-code"
22974#pragma clang diagnostic ignored "-Wunreachable-code-return"
22975#endif // __clang__
22976 if ((true) && !CallerSubsumes(temp)) {
22977 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
22978 return false;
22979 }
22980#ifdef __clang__1
22981#pragma clang diagnostic pop
22982#endif // __clang__
22983 slot = temp;
22984 }
22985 } else if (args[0].isNullOrUndefined()) {
22986 arg0.SetNull();
22987 } else {
22988 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
22989 return false;
22990 }
22991 } else {
22992 arg0.SetNull();
22993 }
22994 if (objIsXray) {
22995 // Since our object is an Xray, we can just CheckedUnwrapStatic:
22996 // we know Xrays have no dynamic unwrap behavior.
22997 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
22998 if (!unwrappedObj.ref()) {
22999 return false;
23000 }
23001 }
23002 FastErrorResult rv;
23003 // NOTE: This assert does NOT call the function.
23004 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
23005 MOZ_KnownLive(self)(self)->PassOptionalRecordOfAnyWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23006 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue"
)), 0))
) {
23007 return false;
23008 }
23009 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 23009; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
23010 args.rval().setUndefined();
23011 return true;
23012}
23013
23014static const JSJitInfo passOptionalRecordOfAnyWithDefaultValue_methodinfo = {
23015 { (JSJitGetterOp)passOptionalRecordOfAnyWithDefaultValue },
23016 { prototypes::id::TestJSImplInterface },
23017 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23018 JSJitInfo::Method,
23019 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23020 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23021 false, /* isInfallible. False in setters. */
23022 false, /* isMovable. Not relevant for setters. */
23023 false, /* isEliminatable. Not relevant for setters. */
23024 false, /* isAlwaysInSlot. Only relevant for getters. */
23025 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23026 false, /* isTypedMethod. Only relevant for methods. */
23027 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23028};
23029
23030MOZ_CAN_RUN_SCRIPT static bool
23031passRecordOfRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23032{
23033 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfRecordOfAny");
23034 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23037( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23035 "TestJSImplInterface", "passRecordOfRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23037( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23036 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23037( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
23037 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23037( cx, "TestJSImplInterface"
, "passRecordOfRecordOfAny", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
23038
23039 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23040 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfRecordOfAny", 1)) {
23041 return false;
23042 }
23043 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23044 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23045 if (objIsXray) {
23046 unwrappedObj.emplace(cx, obj);
23047 }
23048 Record<nsString, Record<nsString, JS::Value>> arg0;
23049 RecordRooter<nsString, Record<nsString, JS::Value>> arg0_holder(cx, &arg0);
23050 if (args[0].isObject()) {
23051 auto& recordEntries = arg0.Entries();
23052
23053 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23054 JS::RootedVector<jsid> ids(cx);
23055 if (!js::GetPropertyKeys(cx, recordObj,
23056 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23057 return false;
23058 }
23059 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23060 JS_ReportOutOfMemory(cx);
23061 return false;
23062 }
23063 JS::Rooted<JS::Value> propNameValue(cx);
23064 JS::Rooted<JS::Value> temp(cx);
23065 JS::Rooted<jsid> curId(cx);
23066 JS::Rooted<JS::Value> idVal(cx);
23067 // Use a hashset to keep track of ids seen, to avoid
23068 // introducing nasty O(N^2) behavior scanning for them all the
23069 // time. Ideally we'd use a data structure with O(1) lookup
23070 // _and_ ordering for the MozMap, but we don't have one lying
23071 // around.
23072 nsTHashtable<nsStringHashKey> idsSeen;
23073 for (size_t i = 0; i < ids.length(); ++i) {
23074 curId = ids[i];
23075
23076 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23077 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23078 &desc)) {
23079 return false;
23080 }
23081
23082 if (desc.isNothing() || !desc->enumerable()) {
23083 continue;
23084 }
23085
23086 idVal = js::IdToValue(curId);
23087 nsString propName;
23088 // This will just throw if idVal is a Symbol, like the spec says
23089 // to do.
23090 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23091 return false;
23092 }
23093
23094 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23095 return false;
23096 }
23097
23098 Record<nsString, Record<nsString, JS::Value>>::EntryType* entry;
23099 if (!idsSeen.EnsureInserted(propName)) {
23100 // Find the existing entry.
23101 auto idx = recordEntries.IndexOf(propName);
23102 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23103); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23103; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23103 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23103); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23103; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23104 // Now blow it away to make it look like it was just added
23105 // to the array, because it's not obvious that it's
23106 // safe to write to its already-initialized mValue via our
23107 // normal codegen conversions. For example, the value
23108 // could be a union and this would change its type, but
23109 // codegen assumes we won't do that.
23110 entry = recordEntries.ReconstructElementAt(idx);
23111 } else {
23112 // Safe to do an infallible append here, because we did a
23113 // SetCapacity above to the right capacity.
23114 entry = recordEntries.AppendElement();
23115 }
23116 entry->mKey = propName;
23117 Record<nsString, JS::Value>& slot = entry->mValue;
23118 if (temp.isObject()) {
23119 auto& recordEntries = slot.Entries();
23120
23121 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23122 JS::RootedVector<jsid> ids(cx);
23123 if (!js::GetPropertyKeys(cx, recordObj,
23124 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23125 return false;
23126 }
23127 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23128 JS_ReportOutOfMemory(cx);
23129 return false;
23130 }
23131 JS::Rooted<JS::Value> propNameValue(cx);
23132 JS::Rooted<JS::Value> temp(cx);
23133 JS::Rooted<jsid> curId(cx);
23134 JS::Rooted<JS::Value> idVal(cx);
23135 // Use a hashset to keep track of ids seen, to avoid
23136 // introducing nasty O(N^2) behavior scanning for them all the
23137 // time. Ideally we'd use a data structure with O(1) lookup
23138 // _and_ ordering for the MozMap, but we don't have one lying
23139 // around.
23140 nsTHashtable<nsStringHashKey> idsSeen;
23141 for (size_t i = 0; i < ids.length(); ++i) {
23142 curId = ids[i];
23143
23144 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23145 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23146 &desc)) {
23147 return false;
23148 }
23149
23150 if (desc.isNothing() || !desc->enumerable()) {
23151 continue;
23152 }
23153
23154 idVal = js::IdToValue(curId);
23155 nsString propName;
23156 // This will just throw if idVal is a Symbol, like the spec says
23157 // to do.
23158 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23159 return false;
23160 }
23161
23162 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23163 return false;
23164 }
23165
23166 Record<nsString, JS::Value>::EntryType* entry;
23167 if (!idsSeen.EnsureInserted(propName)) {
23168 // Find the existing entry.
23169 auto idx = recordEntries.IndexOf(propName);
23170 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23171; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23171 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23171; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23172 // Now blow it away to make it look like it was just added
23173 // to the array, because it's not obvious that it's
23174 // safe to write to its already-initialized mValue via our
23175 // normal codegen conversions. For example, the value
23176 // could be a union and this would change its type, but
23177 // codegen assumes we won't do that.
23178 entry = recordEntries.ReconstructElementAt(idx);
23179 } else {
23180 // Safe to do an infallible append here, because we did a
23181 // SetCapacity above to the right capacity.
23182 entry = recordEntries.AppendElement();
23183 }
23184 entry->mKey = propName;
23185 JS::Value& slot = entry->mValue;
23186#ifdef __clang__1
23187#pragma clang diagnostic push
23188#pragma clang diagnostic ignored "-Wunreachable-code"
23189#pragma clang diagnostic ignored "-Wunreachable-code-return"
23190#endif // __clang__
23191 if ((true) && !CallerSubsumes(temp)) {
23192 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23193 return false;
23194 }
23195#ifdef __clang__1
23196#pragma clang diagnostic pop
23197#endif // __clang__
23198 slot = temp;
23199 }
23200 } else {
23201 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23202 return false;
23203 }
23204 }
23205 } else {
23206 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23207 return false;
23208 }
23209 if (objIsXray) {
23210 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23211 // we know Xrays have no dynamic unwrap behavior.
23212 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23213 if (!unwrappedObj.ref()) {
23214 return false;
23215 }
23216 }
23217 FastErrorResult rv;
23218 // NOTE: This assert does NOT call the function.
23219 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
23220 MOZ_KnownLive(self)(self)->PassRecordOfRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23221 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfRecordOfAny"
)), 0))
) {
23222 return false;
23223 }
23224 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23224); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 23224; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
23225 args.rval().setUndefined();
23226 return true;
23227}
23228
23229static const JSJitInfo passRecordOfRecordOfAny_methodinfo = {
23230 { (JSJitGetterOp)passRecordOfRecordOfAny },
23231 { prototypes::id::TestJSImplInterface },
23232 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23233 JSJitInfo::Method,
23234 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23235 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23236 false, /* isInfallible. False in setters. */
23237 false, /* isMovable. Not relevant for setters. */
23238 false, /* isEliminatable. Not relevant for setters. */
23239 false, /* isAlwaysInSlot. Only relevant for getters. */
23240 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23241 false, /* isTypedMethod. Only relevant for methods. */
23242 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23243};
23244
23245MOZ_CAN_RUN_SCRIPT static bool
23246passRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23247{
23248 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfNullableRecordOfAny");
23249 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23252( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23250 "TestJSImplInterface", "passRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23252( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23251 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23252( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23252 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23252( cx, "TestJSImplInterface"
, "passRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23253
23254 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23255 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny", 1)) {
23256 return false;
23257 }
23258 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23259 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23260 if (objIsXray) {
23261 unwrappedObj.emplace(cx, obj);
23262 }
23263 Record<nsString, Nullable<Record<nsString, JS::Value>>> arg0;
23264 RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0);
23265 if (args[0].isObject()) {
23266 auto& recordEntries = arg0.Entries();
23267
23268 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23269 JS::RootedVector<jsid> ids(cx);
23270 if (!js::GetPropertyKeys(cx, recordObj,
23271 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23272 return false;
23273 }
23274 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23275 JS_ReportOutOfMemory(cx);
23276 return false;
23277 }
23278 JS::Rooted<JS::Value> propNameValue(cx);
23279 JS::Rooted<JS::Value> temp(cx);
23280 JS::Rooted<jsid> curId(cx);
23281 JS::Rooted<JS::Value> idVal(cx);
23282 // Use a hashset to keep track of ids seen, to avoid
23283 // introducing nasty O(N^2) behavior scanning for them all the
23284 // time. Ideally we'd use a data structure with O(1) lookup
23285 // _and_ ordering for the MozMap, but we don't have one lying
23286 // around.
23287 nsTHashtable<nsStringHashKey> idsSeen;
23288 for (size_t i = 0; i < ids.length(); ++i) {
23289 curId = ids[i];
23290
23291 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23292 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23293 &desc)) {
23294 return false;
23295 }
23296
23297 if (desc.isNothing() || !desc->enumerable()) {
23298 continue;
23299 }
23300
23301 idVal = js::IdToValue(curId);
23302 nsString propName;
23303 // This will just throw if idVal is a Symbol, like the spec says
23304 // to do.
23305 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23306 return false;
23307 }
23308
23309 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23310 return false;
23311 }
23312
23313 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23314 if (!idsSeen.EnsureInserted(propName)) {
23315 // Find the existing entry.
23316 auto idx = recordEntries.IndexOf(propName);
23317 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23318); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23318; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23318 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23318); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23318; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23319 // Now blow it away to make it look like it was just added
23320 // to the array, because it's not obvious that it's
23321 // safe to write to its already-initialized mValue via our
23322 // normal codegen conversions. For example, the value
23323 // could be a union and this would change its type, but
23324 // codegen assumes we won't do that.
23325 entry = recordEntries.ReconstructElementAt(idx);
23326 } else {
23327 // Safe to do an infallible append here, because we did a
23328 // SetCapacity above to the right capacity.
23329 entry = recordEntries.AppendElement();
23330 }
23331 entry->mKey = propName;
23332 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23333 if (temp.isObject()) {
23334 auto& recordEntries = slot.SetValue().Entries();
23335
23336 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23337 JS::RootedVector<jsid> ids(cx);
23338 if (!js::GetPropertyKeys(cx, recordObj,
23339 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23340 return false;
23341 }
23342 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23343 JS_ReportOutOfMemory(cx);
23344 return false;
23345 }
23346 JS::Rooted<JS::Value> propNameValue(cx);
23347 JS::Rooted<JS::Value> temp(cx);
23348 JS::Rooted<jsid> curId(cx);
23349 JS::Rooted<JS::Value> idVal(cx);
23350 // Use a hashset to keep track of ids seen, to avoid
23351 // introducing nasty O(N^2) behavior scanning for them all the
23352 // time. Ideally we'd use a data structure with O(1) lookup
23353 // _and_ ordering for the MozMap, but we don't have one lying
23354 // around.
23355 nsTHashtable<nsStringHashKey> idsSeen;
23356 for (size_t i = 0; i < ids.length(); ++i) {
23357 curId = ids[i];
23358
23359 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23360 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23361 &desc)) {
23362 return false;
23363 }
23364
23365 if (desc.isNothing() || !desc->enumerable()) {
23366 continue;
23367 }
23368
23369 idVal = js::IdToValue(curId);
23370 nsString propName;
23371 // This will just throw if idVal is a Symbol, like the spec says
23372 // to do.
23373 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23374 return false;
23375 }
23376
23377 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23378 return false;
23379 }
23380
23381 Record<nsString, JS::Value>::EntryType* entry;
23382 if (!idsSeen.EnsureInserted(propName)) {
23383 // Find the existing entry.
23384 auto idx = recordEntries.IndexOf(propName);
23385 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23386); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23386; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23386 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23386); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23386; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23387 // Now blow it away to make it look like it was just added
23388 // to the array, because it's not obvious that it's
23389 // safe to write to its already-initialized mValue via our
23390 // normal codegen conversions. For example, the value
23391 // could be a union and this would change its type, but
23392 // codegen assumes we won't do that.
23393 entry = recordEntries.ReconstructElementAt(idx);
23394 } else {
23395 // Safe to do an infallible append here, because we did a
23396 // SetCapacity above to the right capacity.
23397 entry = recordEntries.AppendElement();
23398 }
23399 entry->mKey = propName;
23400 JS::Value& slot = entry->mValue;
23401#ifdef __clang__1
23402#pragma clang diagnostic push
23403#pragma clang diagnostic ignored "-Wunreachable-code"
23404#pragma clang diagnostic ignored "-Wunreachable-code-return"
23405#endif // __clang__
23406 if ((true) && !CallerSubsumes(temp)) {
23407 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23408 return false;
23409 }
23410#ifdef __clang__1
23411#pragma clang diagnostic pop
23412#endif // __clang__
23413 slot = temp;
23414 }
23415 } else if (temp.isNullOrUndefined()) {
23416 slot.SetNull();
23417 } else {
23418 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23419 return false;
23420 }
23421 }
23422 } else {
23423 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23424 return false;
23425 }
23426 if (objIsXray) {
23427 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23428 // we know Xrays have no dynamic unwrap behavior.
23429 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23430 if (!unwrappedObj.ref()) {
23431 return false;
23432 }
23433 }
23434 FastErrorResult rv;
23435 // NOTE: This assert does NOT call the function.
23436 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
23437 MOZ_KnownLive(self)(self)->PassRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23438 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfNullableRecordOfAny"
)), 0))
) {
23439 return false;
23440 }
23441 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23441); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 23441; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
23442 args.rval().setUndefined();
23443 return true;
23444}
23445
23446static const JSJitInfo passRecordOfNullableRecordOfAny_methodinfo = {
23447 { (JSJitGetterOp)passRecordOfNullableRecordOfAny },
23448 { prototypes::id::TestJSImplInterface },
23449 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23450 JSJitInfo::Method,
23451 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23452 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23453 false, /* isInfallible. False in setters. */
23454 false, /* isMovable. Not relevant for setters. */
23455 false, /* isEliminatable. Not relevant for setters. */
23456 false, /* isAlwaysInSlot. Only relevant for getters. */
23457 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23458 false, /* isTypedMethod. Only relevant for methods. */
23459 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23460};
23461
23462MOZ_CAN_RUN_SCRIPT static bool
23463passNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23464{
23465 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny");
23466 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23469( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23467 "TestJSImplInterface", "passNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23469( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23468 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23469( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23469 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23469( cx, "TestJSImplInterface"
, "passNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23470
23471 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23472 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", 1)) {
23473 return false;
23474 }
23475 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23476 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23477 if (objIsXray) {
23478 unwrappedObj.emplace(cx, obj);
23479 }
23480 Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>> arg0;
23481 RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>> arg0_holder(cx, &arg0.SetValue());
23482 if (args[0].isObject()) {
23483 auto& recordEntries = arg0.SetValue().Entries();
23484
23485 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23486 JS::RootedVector<jsid> ids(cx);
23487 if (!js::GetPropertyKeys(cx, recordObj,
23488 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23489 return false;
23490 }
23491 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23492 JS_ReportOutOfMemory(cx);
23493 return false;
23494 }
23495 JS::Rooted<JS::Value> propNameValue(cx);
23496 JS::Rooted<JS::Value> temp(cx);
23497 JS::Rooted<jsid> curId(cx);
23498 JS::Rooted<JS::Value> idVal(cx);
23499 // Use a hashset to keep track of ids seen, to avoid
23500 // introducing nasty O(N^2) behavior scanning for them all the
23501 // time. Ideally we'd use a data structure with O(1) lookup
23502 // _and_ ordering for the MozMap, but we don't have one lying
23503 // around.
23504 nsTHashtable<nsStringHashKey> idsSeen;
23505 for (size_t i = 0; i < ids.length(); ++i) {
23506 curId = ids[i];
23507
23508 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23509 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23510 &desc)) {
23511 return false;
23512 }
23513
23514 if (desc.isNothing() || !desc->enumerable()) {
23515 continue;
23516 }
23517
23518 idVal = js::IdToValue(curId);
23519 nsString propName;
23520 // This will just throw if idVal is a Symbol, like the spec says
23521 // to do.
23522 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23523 return false;
23524 }
23525
23526 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23527 return false;
23528 }
23529
23530 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23531 if (!idsSeen.EnsureInserted(propName)) {
23532 // Find the existing entry.
23533 auto idx = recordEntries.IndexOf(propName);
23534 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23535); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23535; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23535 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23535); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23535; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23536 // Now blow it away to make it look like it was just added
23537 // to the array, because it's not obvious that it's
23538 // safe to write to its already-initialized mValue via our
23539 // normal codegen conversions. For example, the value
23540 // could be a union and this would change its type, but
23541 // codegen assumes we won't do that.
23542 entry = recordEntries.ReconstructElementAt(idx);
23543 } else {
23544 // Safe to do an infallible append here, because we did a
23545 // SetCapacity above to the right capacity.
23546 entry = recordEntries.AppendElement();
23547 }
23548 entry->mKey = propName;
23549 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23550 if (temp.isObject()) {
23551 auto& recordEntries = slot.SetValue().Entries();
23552
23553 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23554 JS::RootedVector<jsid> ids(cx);
23555 if (!js::GetPropertyKeys(cx, recordObj,
23556 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23557 return false;
23558 }
23559 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23560 JS_ReportOutOfMemory(cx);
23561 return false;
23562 }
23563 JS::Rooted<JS::Value> propNameValue(cx);
23564 JS::Rooted<JS::Value> temp(cx);
23565 JS::Rooted<jsid> curId(cx);
23566 JS::Rooted<JS::Value> idVal(cx);
23567 // Use a hashset to keep track of ids seen, to avoid
23568 // introducing nasty O(N^2) behavior scanning for them all the
23569 // time. Ideally we'd use a data structure with O(1) lookup
23570 // _and_ ordering for the MozMap, but we don't have one lying
23571 // around.
23572 nsTHashtable<nsStringHashKey> idsSeen;
23573 for (size_t i = 0; i < ids.length(); ++i) {
23574 curId = ids[i];
23575
23576 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23577 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23578 &desc)) {
23579 return false;
23580 }
23581
23582 if (desc.isNothing() || !desc->enumerable()) {
23583 continue;
23584 }
23585
23586 idVal = js::IdToValue(curId);
23587 nsString propName;
23588 // This will just throw if idVal is a Symbol, like the spec says
23589 // to do.
23590 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23591 return false;
23592 }
23593
23594 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23595 return false;
23596 }
23597
23598 Record<nsString, JS::Value>::EntryType* entry;
23599 if (!idsSeen.EnsureInserted(propName)) {
23600 // Find the existing entry.
23601 auto idx = recordEntries.IndexOf(propName);
23602 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23603); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23603; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23603 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23603); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23603; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23604 // Now blow it away to make it look like it was just added
23605 // to the array, because it's not obvious that it's
23606 // safe to write to its already-initialized mValue via our
23607 // normal codegen conversions. For example, the value
23608 // could be a union and this would change its type, but
23609 // codegen assumes we won't do that.
23610 entry = recordEntries.ReconstructElementAt(idx);
23611 } else {
23612 // Safe to do an infallible append here, because we did a
23613 // SetCapacity above to the right capacity.
23614 entry = recordEntries.AppendElement();
23615 }
23616 entry->mKey = propName;
23617 JS::Value& slot = entry->mValue;
23618#ifdef __clang__1
23619#pragma clang diagnostic push
23620#pragma clang diagnostic ignored "-Wunreachable-code"
23621#pragma clang diagnostic ignored "-Wunreachable-code-return"
23622#endif // __clang__
23623 if ((true) && !CallerSubsumes(temp)) {
23624 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23625 return false;
23626 }
23627#ifdef __clang__1
23628#pragma clang diagnostic pop
23629#endif // __clang__
23630 slot = temp;
23631 }
23632 } else if (temp.isNullOrUndefined()) {
23633 slot.SetNull();
23634 } else {
23635 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23636 return false;
23637 }
23638 }
23639 } else if (args[0].isNullOrUndefined()) {
23640 arg0.SetNull();
23641 } else {
23642 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23643 return false;
23644 }
23645 if (objIsXray) {
23646 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23647 // we know Xrays have no dynamic unwrap behavior.
23648 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23649 if (!unwrappedObj.ref()) {
23650 return false;
23651 }
23652 }
23653 FastErrorResult rv;
23654 // NOTE: This assert does NOT call the function.
23655 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
23656 MOZ_KnownLive(self)(self)->PassNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23657 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny"
)), 0))
) {
23658 return false;
23659 }
23660 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23660); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 23660; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
23661 args.rval().setUndefined();
23662 return true;
23663}
23664
23665static const JSJitInfo passNullableRecordOfNullableRecordOfAny_methodinfo = {
23666 { (JSJitGetterOp)passNullableRecordOfNullableRecordOfAny },
23667 { prototypes::id::TestJSImplInterface },
23668 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23669 JSJitInfo::Method,
23670 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23671 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23672 false, /* isInfallible. False in setters. */
23673 false, /* isMovable. Not relevant for setters. */
23674 false, /* isEliminatable. Not relevant for setters. */
23675 false, /* isAlwaysInSlot. Only relevant for getters. */
23676 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23677 false, /* isTypedMethod. Only relevant for methods. */
23678 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23679};
23680
23681MOZ_CAN_RUN_SCRIPT static bool
23682passOptionalNullableRecordOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23683{
23684 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny");
23685 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23688( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23686 "TestJSImplInterface", "passOptionalNullableRecordOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23688( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23687 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23688( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23688 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23688( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23689
23690 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23691 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23692 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23693 if (objIsXray) {
23694 unwrappedObj.emplace(cx, obj);
23695 }
23696 Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>> arg0;
23697 Maybe<RecordRooter<nsString, Nullable<Record<nsString, JS::Value>>>> arg0_holder;
23698 if (args.hasDefined(0)) {
23699 arg0.Construct();
23700 arg0_holder.emplace(cx, &arg0.Value().SetValue());
23701 if (args[0].isObject()) {
23702 auto& recordEntries = arg0.Value().SetValue().Entries();
23703
23704 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23705 JS::RootedVector<jsid> ids(cx);
23706 if (!js::GetPropertyKeys(cx, recordObj,
23707 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23708 return false;
23709 }
23710 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23711 JS_ReportOutOfMemory(cx);
23712 return false;
23713 }
23714 JS::Rooted<JS::Value> propNameValue(cx);
23715 JS::Rooted<JS::Value> temp(cx);
23716 JS::Rooted<jsid> curId(cx);
23717 JS::Rooted<JS::Value> idVal(cx);
23718 // Use a hashset to keep track of ids seen, to avoid
23719 // introducing nasty O(N^2) behavior scanning for them all the
23720 // time. Ideally we'd use a data structure with O(1) lookup
23721 // _and_ ordering for the MozMap, but we don't have one lying
23722 // around.
23723 nsTHashtable<nsStringHashKey> idsSeen;
23724 for (size_t i = 0; i < ids.length(); ++i) {
23725 curId = ids[i];
23726
23727 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23728 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23729 &desc)) {
23730 return false;
23731 }
23732
23733 if (desc.isNothing() || !desc->enumerable()) {
23734 continue;
23735 }
23736
23737 idVal = js::IdToValue(curId);
23738 nsString propName;
23739 // This will just throw if idVal is a Symbol, like the spec says
23740 // to do.
23741 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23742 return false;
23743 }
23744
23745 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23746 return false;
23747 }
23748
23749 Record<nsString, Nullable<Record<nsString, JS::Value>>>::EntryType* entry;
23750 if (!idsSeen.EnsureInserted(propName)) {
23751 // Find the existing entry.
23752 auto idx = recordEntries.IndexOf(propName);
23753 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23754); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23754; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23754 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23754); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23754; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23755 // Now blow it away to make it look like it was just added
23756 // to the array, because it's not obvious that it's
23757 // safe to write to its already-initialized mValue via our
23758 // normal codegen conversions. For example, the value
23759 // could be a union and this would change its type, but
23760 // codegen assumes we won't do that.
23761 entry = recordEntries.ReconstructElementAt(idx);
23762 } else {
23763 // Safe to do an infallible append here, because we did a
23764 // SetCapacity above to the right capacity.
23765 entry = recordEntries.AppendElement();
23766 }
23767 entry->mKey = propName;
23768 Nullable<Record<nsString, JS::Value>>& slot = entry->mValue;
23769 if (temp.isObject()) {
23770 auto& recordEntries = slot.SetValue().Entries();
23771
23772 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
23773 JS::RootedVector<jsid> ids(cx);
23774 if (!js::GetPropertyKeys(cx, recordObj,
23775 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23776 return false;
23777 }
23778 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23779 JS_ReportOutOfMemory(cx);
23780 return false;
23781 }
23782 JS::Rooted<JS::Value> propNameValue(cx);
23783 JS::Rooted<JS::Value> temp(cx);
23784 JS::Rooted<jsid> curId(cx);
23785 JS::Rooted<JS::Value> idVal(cx);
23786 // Use a hashset to keep track of ids seen, to avoid
23787 // introducing nasty O(N^2) behavior scanning for them all the
23788 // time. Ideally we'd use a data structure with O(1) lookup
23789 // _and_ ordering for the MozMap, but we don't have one lying
23790 // around.
23791 nsTHashtable<nsStringHashKey> idsSeen;
23792 for (size_t i = 0; i < ids.length(); ++i) {
23793 curId = ids[i];
23794
23795 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23796 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23797 &desc)) {
23798 return false;
23799 }
23800
23801 if (desc.isNothing() || !desc->enumerable()) {
23802 continue;
23803 }
23804
23805 idVal = js::IdToValue(curId);
23806 nsString propName;
23807 // This will just throw if idVal is a Symbol, like the spec says
23808 // to do.
23809 if (!ConvertJSValueToString(cx, idVal, "key of value in argument 1", propName)) {
23810 return false;
23811 }
23812
23813 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23814 return false;
23815 }
23816
23817 Record<nsString, JS::Value>::EntryType* entry;
23818 if (!idsSeen.EnsureInserted(propName)) {
23819 // Find the existing entry.
23820 auto idx = recordEntries.IndexOf(propName);
23821 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23822); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23822; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23822 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23822); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23822; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23823 // Now blow it away to make it look like it was just added
23824 // to the array, because it's not obvious that it's
23825 // safe to write to its already-initialized mValue via our
23826 // normal codegen conversions. For example, the value
23827 // could be a union and this would change its type, but
23828 // codegen assumes we won't do that.
23829 entry = recordEntries.ReconstructElementAt(idx);
23830 } else {
23831 // Safe to do an infallible append here, because we did a
23832 // SetCapacity above to the right capacity.
23833 entry = recordEntries.AppendElement();
23834 }
23835 entry->mKey = propName;
23836 JS::Value& slot = entry->mValue;
23837#ifdef __clang__1
23838#pragma clang diagnostic push
23839#pragma clang diagnostic ignored "-Wunreachable-code"
23840#pragma clang diagnostic ignored "-Wunreachable-code-return"
23841#endif // __clang__
23842 if ((true) && !CallerSubsumes(temp)) {
23843 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in value in argument 1");
23844 return false;
23845 }
23846#ifdef __clang__1
23847#pragma clang diagnostic pop
23848#endif // __clang__
23849 slot = temp;
23850 }
23851 } else if (temp.isNullOrUndefined()) {
23852 slot.SetNull();
23853 } else {
23854 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
23855 return false;
23856 }
23857 }
23858 } else if (args[0].isNullOrUndefined()) {
23859 arg0.Value().SetNull();
23860 } else {
23861 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
23862 return false;
23863 }
23864 }
23865 if (objIsXray) {
23866 // Since our object is an Xray, we can just CheckedUnwrapStatic:
23867 // we know Xrays have no dynamic unwrap behavior.
23868 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
23869 if (!unwrappedObj.ref()) {
23870 return false;
23871 }
23872 }
23873 FastErrorResult rv;
23874 // NOTE: This assert does NOT call the function.
23875 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
23876 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
23877 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny"
)), 0))
) {
23878 return false;
23879 }
23880 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 23880); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 23880; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
23881 args.rval().setUndefined();
23882 return true;
23883}
23884
23885static const JSJitInfo passOptionalNullableRecordOfNullableRecordOfAny_methodinfo = {
23886 { (JSJitGetterOp)passOptionalNullableRecordOfNullableRecordOfAny },
23887 { prototypes::id::TestJSImplInterface },
23888 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
23889 JSJitInfo::Method,
23890 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
23891 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
23892 false, /* isInfallible. False in setters. */
23893 false, /* isMovable. Not relevant for setters. */
23894 false, /* isEliminatable. Not relevant for setters. */
23895 false, /* isAlwaysInSlot. Only relevant for getters. */
23896 false, /* isLazilyCachedInSlot. Only relevant for getters. */
23897 false, /* isTypedMethod. Only relevant for methods. */
23898 0 /* Reserved slot index, if we're stored in a slot, else 0. */
23899};
23900
23901MOZ_CAN_RUN_SCRIPT static bool
23902passOptionalNullableRecordOfNullableSequenceOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
23903{
23904 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny");
23905 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject23908( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23906 "TestJSImplInterface", "passOptionalNullableRecordOfNullableSequenceOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject23908( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23907 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject23908( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
23908 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject23908( cx, "TestJSImplInterface"
, "passOptionalNullableRecordOfNullableSequenceOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
23909
23910 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
23911 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
23912 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
23913 if (objIsXray) {
23914 unwrappedObj.emplace(cx, obj);
23915 }
23916 Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>> arg0;
23917 Maybe<RecordRooter<nsString, Nullable<Sequence<JS::Value>>>> arg0_holder;
23918 if (args.hasDefined(0)) {
23919 arg0.Construct();
23920 arg0_holder.emplace(cx, &arg0.Value().SetValue());
23921 if (args[0].isObject()) {
23922 auto& recordEntries = arg0.Value().SetValue().Entries();
23923
23924 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
23925 JS::RootedVector<jsid> ids(cx);
23926 if (!js::GetPropertyKeys(cx, recordObj,
23927 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
23928 return false;
23929 }
23930 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
23931 JS_ReportOutOfMemory(cx);
23932 return false;
23933 }
23934 JS::Rooted<JS::Value> propNameValue(cx);
23935 JS::Rooted<JS::Value> temp(cx);
23936 JS::Rooted<jsid> curId(cx);
23937 JS::Rooted<JS::Value> idVal(cx);
23938 // Use a hashset to keep track of ids seen, to avoid
23939 // introducing nasty O(N^2) behavior scanning for them all the
23940 // time. Ideally we'd use a data structure with O(1) lookup
23941 // _and_ ordering for the MozMap, but we don't have one lying
23942 // around.
23943 nsTHashtable<nsStringHashKey> idsSeen;
23944 for (size_t i = 0; i < ids.length(); ++i) {
23945 curId = ids[i];
23946
23947 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
23948 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
23949 &desc)) {
23950 return false;
23951 }
23952
23953 if (desc.isNothing() || !desc->enumerable()) {
23954 continue;
23955 }
23956
23957 idVal = js::IdToValue(curId);
23958 nsString propName;
23959 // This will just throw if idVal is a Symbol, like the spec says
23960 // to do.
23961 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
23962 return false;
23963 }
23964
23965 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
23966 return false;
23967 }
23968
23969 Record<nsString, Nullable<Sequence<JS::Value>>>::EntryType* entry;
23970 if (!idsSeen.EnsureInserted(propName)) {
23971 // Find the existing entry.
23972 auto idx = recordEntries.IndexOf(propName);
23973 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23974; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
23974 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 23974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 23974; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
23975 // Now blow it away to make it look like it was just added
23976 // to the array, because it's not obvious that it's
23977 // safe to write to its already-initialized mValue via our
23978 // normal codegen conversions. For example, the value
23979 // could be a union and this would change its type, but
23980 // codegen assumes we won't do that.
23981 entry = recordEntries.ReconstructElementAt(idx);
23982 } else {
23983 // Safe to do an infallible append here, because we did a
23984 // SetCapacity above to the right capacity.
23985 entry = recordEntries.AppendElement();
23986 }
23987 entry->mKey = propName;
23988 Nullable<Sequence<JS::Value>>& slot = entry->mValue;
23989 if (temp.isObject()) {
23990 JS::ForOfIterator iter1(cx);
23991 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
23992 return false;
23993 }
23994 if (!iter1.valueIsIterable()) {
23995 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence");
23996 return false;
23997 }
23998 Sequence<JS::Value> &arr1 = slot.SetValue();
23999 JS::Rooted<JS::Value> temp1(cx);
24000 while (true) {
24001 bool done1;
24002 if (!iter1.next(&temp1, &done1)) {
24003 return false;
24004 }
24005 if (done1) {
24006 break;
24007 }
24008 JS::Value* slotPtr1 = arr1.AppendElement(mozilla::fallible);
24009 if (!slotPtr1) {
24010 JS_ReportOutOfMemory(cx);
24011 return false;
24012 }
24013 JS::Value& slot1 = *slotPtr1;
24014#ifdef __clang__1
24015#pragma clang diagnostic push
24016#pragma clang diagnostic ignored "-Wunreachable-code"
24017#pragma clang diagnostic ignored "-Wunreachable-code-return"
24018#endif // __clang__
24019 if ((true) && !CallerSubsumes(temp1)) {
24020 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of value in argument 1");
24021 return false;
24022 }
24023#ifdef __clang__1
24024#pragma clang diagnostic pop
24025#endif // __clang__
24026 slot1 = temp1;
24027 }
24028 } else if (temp.isNullOrUndefined()) {
24029 slot.SetNull();
24030 } else {
24031 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Value in argument 1", "sequence");
24032 return false;
24033 }
24034 }
24035 } else if (args[0].isNullOrUndefined()) {
24036 arg0.Value().SetNull();
24037 } else {
24038 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24039 return false;
24040 }
24041 }
24042 if (objIsXray) {
24043 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24044 // we know Xrays have no dynamic unwrap behavior.
24045 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24046 if (!unwrappedObj.ref()) {
24047 return false;
24048 }
24049 }
24050 FastErrorResult rv;
24051 // NOTE: This assert does NOT call the function.
24052 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24053 MOZ_KnownLive(self)(self)->PassOptionalNullableRecordOfNullableSequenceOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24054 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny"
)), 0))
) {
24055 return false;
24056 }
24057 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24057; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24058 args.rval().setUndefined();
24059 return true;
24060}
24061
24062static const JSJitInfo passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo = {
24063 { (JSJitGetterOp)passOptionalNullableRecordOfNullableSequenceOfAny },
24064 { prototypes::id::TestJSImplInterface },
24065 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24066 JSJitInfo::Method,
24067 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24068 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24069 false, /* isInfallible. False in setters. */
24070 false, /* isMovable. Not relevant for setters. */
24071 false, /* isEliminatable. Not relevant for setters. */
24072 false, /* isAlwaysInSlot. Only relevant for getters. */
24073 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24074 false, /* isTypedMethod. Only relevant for methods. */
24075 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24076};
24077
24078MOZ_CAN_RUN_SCRIPT static bool
24079passOptionalNullableSequenceOfNullableRecordOfAny(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24080{
24081 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny");
24082 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24085( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24083 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableRecordOfAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24085( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24084 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24085( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24085 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24085( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableRecordOfAny", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24086
24087 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24088 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24089 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24090 if (objIsXray) {
24091 unwrappedObj.emplace(cx, obj);
24092 }
24093 Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>> arg0;
24094 Maybe<SequenceRooter<Nullable<Record<nsString, JS::Value>>>> arg0_holder;
24095 if (args.hasDefined(0)) {
24096 arg0.Construct();
24097 arg0_holder.emplace(cx, &arg0.Value().SetValue());
24098 if (args[0].isObject()) {
24099 JS::ForOfIterator iter(cx);
24100 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
24101 return false;
24102 }
24103 if (!iter.valueIsIterable()) {
24104 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24105 return false;
24106 }
24107 Sequence<Nullable<Record<nsString, JS::Value>>> &arr = arg0.Value().SetValue();
24108 JS::Rooted<JS::Value> temp(cx);
24109 while (true) {
24110 bool done;
24111 if (!iter.next(&temp, &done)) {
24112 return false;
24113 }
24114 if (done) {
24115 break;
24116 }
24117 Nullable<Record<nsString, JS::Value>>* slotPtr = arr.AppendElement(mozilla::fallible);
24118 if (!slotPtr) {
24119 JS_ReportOutOfMemory(cx);
24120 return false;
24121 }
24122 Nullable<Record<nsString, JS::Value>>& slot = *slotPtr;
24123 if (temp.isObject()) {
24124 auto& recordEntries = slot.SetValue().Entries();
24125
24126 JS::Rooted<JSObject*> recordObj(cx, &temp.toObject());
24127 JS::RootedVector<jsid> ids(cx);
24128 if (!js::GetPropertyKeys(cx, recordObj,
24129 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
24130 return false;
24131 }
24132 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
24133 JS_ReportOutOfMemory(cx);
24134 return false;
24135 }
24136 JS::Rooted<JS::Value> propNameValue(cx);
24137 JS::Rooted<JS::Value> temp(cx);
24138 JS::Rooted<jsid> curId(cx);
24139 JS::Rooted<JS::Value> idVal(cx);
24140 // Use a hashset to keep track of ids seen, to avoid
24141 // introducing nasty O(N^2) behavior scanning for them all the
24142 // time. Ideally we'd use a data structure with O(1) lookup
24143 // _and_ ordering for the MozMap, but we don't have one lying
24144 // around.
24145 nsTHashtable<nsStringHashKey> idsSeen;
24146 for (size_t i = 0; i < ids.length(); ++i) {
24147 curId = ids[i];
24148
24149 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
24150 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
24151 &desc)) {
24152 return false;
24153 }
24154
24155 if (desc.isNothing() || !desc->enumerable()) {
24156 continue;
24157 }
24158
24159 idVal = js::IdToValue(curId);
24160 nsString propName;
24161 // This will just throw if idVal is a Symbol, like the spec says
24162 // to do.
24163 if (!ConvertJSValueToString(cx, idVal, "key of element of argument 1", propName)) {
24164 return false;
24165 }
24166
24167 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
24168 return false;
24169 }
24170
24171 Record<nsString, JS::Value>::EntryType* entry;
24172 if (!idsSeen.EnsureInserted(propName)) {
24173 // Find the existing entry.
24174 auto idx = recordEntries.IndexOf(propName);
24175 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 24176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 24176; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
24176 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 24176); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 24176; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
24177 // Now blow it away to make it look like it was just added
24178 // to the array, because it's not obvious that it's
24179 // safe to write to its already-initialized mValue via our
24180 // normal codegen conversions. For example, the value
24181 // could be a union and this would change its type, but
24182 // codegen assumes we won't do that.
24183 entry = recordEntries.ReconstructElementAt(idx);
24184 } else {
24185 // Safe to do an infallible append here, because we did a
24186 // SetCapacity above to the right capacity.
24187 entry = recordEntries.AppendElement();
24188 }
24189 entry->mKey = propName;
24190 JS::Value& slot = entry->mValue;
24191#ifdef __clang__1
24192#pragma clang diagnostic push
24193#pragma clang diagnostic ignored "-Wunreachable-code"
24194#pragma clang diagnostic ignored "-Wunreachable-code-return"
24195#endif // __clang__
24196 if ((true) && !CallerSubsumes(temp)) {
24197 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in element of argument 1");
24198 return false;
24199 }
24200#ifdef __clang__1
24201#pragma clang diagnostic pop
24202#endif // __clang__
24203 slot = temp;
24204 }
24205 } else if (temp.isNullOrUndefined()) {
24206 slot.SetNull();
24207 } else {
24208 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
24209 return false;
24210 }
24211 }
24212 } else if (args[0].isNullOrUndefined()) {
24213 arg0.Value().SetNull();
24214 } else {
24215 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24216 return false;
24217 }
24218 }
24219 if (objIsXray) {
24220 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24221 // we know Xrays have no dynamic unwrap behavior.
24222 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24223 if (!unwrappedObj.ref()) {
24224 return false;
24225 }
24226 }
24227 FastErrorResult rv;
24228 // NOTE: This assert does NOT call the function.
24229 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24230 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableRecordOfAny(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24231 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny"
)), 0))
) {
24232 return false;
24233 }
24234 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24234); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24234; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24235 args.rval().setUndefined();
24236 return true;
24237}
24238
24239static const JSJitInfo passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo = {
24240 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableRecordOfAny },
24241 { prototypes::id::TestJSImplInterface },
24242 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24243 JSJitInfo::Method,
24244 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24245 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24246 false, /* isInfallible. False in setters. */
24247 false, /* isMovable. Not relevant for setters. */
24248 false, /* isEliminatable. Not relevant for setters. */
24249 false, /* isAlwaysInSlot. Only relevant for getters. */
24250 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24251 false, /* isTypedMethod. Only relevant for methods. */
24252 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24253};
24254
24255MOZ_CAN_RUN_SCRIPT static bool
24256receiveAny(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24257{
24258 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24261( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24259 "TestJSImplInterface", "receiveAny", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24261( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24260 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24261( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24261 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24261( cx, "TestJSImplInterface"
, "receiveAny", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24262
24263 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24264 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24265 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24266 if (objIsXray) {
24267 unwrappedObj.emplace(cx, obj);
24268 }
24269 if (objIsXray) {
24270 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24271 // we know Xrays have no dynamic unwrap behavior.
24272 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24273 if (!unwrappedObj.ref()) {
24274 return false;
24275 }
24276 }
24277 FastErrorResult rv;
24278 JS::Rooted<JS::Value> result(cx);
24279 // NOTE: This assert does NOT call the function.
24280 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveAny(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24281 MOZ_KnownLive(self)(self)->ReceiveAny(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24282 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAny"
)), 0))
) {
24283 return false;
24284 }
24285 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24285); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24285; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24286 JS::ExposeValueToActiveJS(result);
24287 args.rval().set(result);
24288 if (!MaybeWrapValue(cx, args.rval())) {
24289 return false;
24290 }
24291 return true;
24292}
24293
24294static const JSJitInfo receiveAny_methodinfo = {
24295 { (JSJitGetterOp)receiveAny },
24296 { prototypes::id::TestJSImplInterface },
24297 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24298 JSJitInfo::Method,
24299 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24300 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
24301 false, /* isInfallible. False in setters. */
24302 false, /* isMovable. Not relevant for setters. */
24303 false, /* isEliminatable. Not relevant for setters. */
24304 false, /* isAlwaysInSlot. Only relevant for getters. */
24305 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24306 false, /* isTypedMethod. Only relevant for methods. */
24307 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24308};
24309
24310MOZ_CAN_RUN_SCRIPT static bool
24311passObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24312{
24313 BindingCallContext cx(cx_, "TestJSImplInterface.passObject");
24314 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24317( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24315 "TestJSImplInterface", "passObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24317( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24316 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24317( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24317 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24317( cx, "TestJSImplInterface"
, "passObject", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24318
24319 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24320 if (!args.requireAtLeast(cx, "TestJSImplInterface.passObject", 1)) {
24321 return false;
24322 }
24323 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24324 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24325 if (objIsXray) {
24326 unwrappedObj.emplace(cx, obj);
24327 }
24328 JS::Rooted<JSObject*> arg0(cx);
24329 if (args[0].isObject()) {
24330#ifdef __clang__1
24331#pragma clang diagnostic push
24332#pragma clang diagnostic ignored "-Wunreachable-code"
24333#pragma clang diagnostic ignored "-Wunreachable-code-return"
24334#endif // __clang__
24335 if ((true) && !CallerSubsumes(args[0])) {
24336 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24337 return false;
24338 }
24339#ifdef __clang__1
24340#pragma clang diagnostic pop
24341#endif // __clang__
24342 arg0 = &args[0].toObject();
24343 } else {
24344 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24345 return false;
24346 }
24347 if (objIsXray) {
24348 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24349 // we know Xrays have no dynamic unwrap behavior.
24350 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24351 if (!unwrappedObj.ref()) {
24352 return false;
24353 }
24354 }
24355 FastErrorResult rv;
24356 // NOTE: This assert does NOT call the function.
24357 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24358 MOZ_KnownLive(self)(self)->PassObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24359 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passObject"
)), 0))
) {
24360 return false;
24361 }
24362 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24362; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24363 args.rval().setUndefined();
24364 return true;
24365}
24366
24367static const JSJitInfo passObject_methodinfo = {
24368 { (JSJitGetterOp)passObject },
24369 { prototypes::id::TestJSImplInterface },
24370 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24371 JSJitInfo::Method,
24372 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24373 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24374 false, /* isInfallible. False in setters. */
24375 false, /* isMovable. Not relevant for setters. */
24376 false, /* isEliminatable. Not relevant for setters. */
24377 false, /* isAlwaysInSlot. Only relevant for getters. */
24378 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24379 false, /* isTypedMethod. Only relevant for methods. */
24380 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24381};
24382
24383MOZ_CAN_RUN_SCRIPT static bool
24384passVariadicObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24385{
24386 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicObject");
24387 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24390( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24388 "TestJSImplInterface", "passVariadicObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24390( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24389 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24390( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24390 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24390( cx, "TestJSImplInterface"
, "passVariadicObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24391
24392 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24393 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24394 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24395 if (objIsXray) {
24396 unwrappedObj.emplace(cx, obj);
24397 }
24398 AutoSequence<JSObject*> arg0;
24399 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24400 if (args.length() > 0) {
24401 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
24402 JS_ReportOutOfMemory(cx);
24403 return false;
24404 }
24405 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
24406 // OK to do infallible append here, since we ensured capacity already.
24407 JSObject*& slot = *arg0.AppendElement(nullptr);
24408 if (args[variadicArg].isObject()) {
24409#ifdef __clang__1
24410#pragma clang diagnostic push
24411#pragma clang diagnostic ignored "-Wunreachable-code"
24412#pragma clang diagnostic ignored "-Wunreachable-code-return"
24413#endif // __clang__
24414 if ((true) && !CallerSubsumes(args[variadicArg])) {
24415 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24416 return false;
24417 }
24418#ifdef __clang__1
24419#pragma clang diagnostic pop
24420#endif // __clang__
24421 slot = &args[variadicArg].toObject();
24422 } else {
24423 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24424 return false;
24425 }
24426 }
24427 }
24428 if (objIsXray) {
24429 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24430 // we know Xrays have no dynamic unwrap behavior.
24431 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24432 if (!unwrappedObj.ref()) {
24433 return false;
24434 }
24435 }
24436 FastErrorResult rv;
24437 // NOTE: This assert does NOT call the function.
24438 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24439 MOZ_KnownLive(self)(self)->PassVariadicObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24440 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicObject"
)), 0))
) {
24441 return false;
24442 }
24443 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24443); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24443; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24444 args.rval().setUndefined();
24445 return true;
24446}
24447
24448static const JSJitInfo passVariadicObject_methodinfo = {
24449 { (JSJitGetterOp)passVariadicObject },
24450 { prototypes::id::TestJSImplInterface },
24451 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24452 JSJitInfo::Method,
24453 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24454 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24455 false, /* isInfallible. False in setters. */
24456 false, /* isMovable. Not relevant for setters. */
24457 false, /* isEliminatable. Not relevant for setters. */
24458 false, /* isAlwaysInSlot. Only relevant for getters. */
24459 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24460 false, /* isTypedMethod. Only relevant for methods. */
24461 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24462};
24463
24464MOZ_CAN_RUN_SCRIPT static bool
24465passNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24466{
24467 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableObject");
24468 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24471( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24469 "TestJSImplInterface", "passNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24471( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24470 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24471( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24471 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24471( cx, "TestJSImplInterface"
, "passNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24472
24473 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24474 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableObject", 1)) {
24475 return false;
24476 }
24477 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24478 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24479 if (objIsXray) {
24480 unwrappedObj.emplace(cx, obj);
24481 }
24482 JS::Rooted<JSObject*> arg0(cx);
24483 if (args[0].isObject()) {
24484#ifdef __clang__1
24485#pragma clang diagnostic push
24486#pragma clang diagnostic ignored "-Wunreachable-code"
24487#pragma clang diagnostic ignored "-Wunreachable-code-return"
24488#endif // __clang__
24489 if ((true) && !CallerSubsumes(args[0])) {
24490 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24491 return false;
24492 }
24493#ifdef __clang__1
24494#pragma clang diagnostic pop
24495#endif // __clang__
24496 arg0 = &args[0].toObject();
24497 } else if (args[0].isNullOrUndefined()) {
24498 arg0 = nullptr;
24499 } else {
24500 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24501 return false;
24502 }
24503 if (objIsXray) {
24504 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24505 // we know Xrays have no dynamic unwrap behavior.
24506 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24507 if (!unwrappedObj.ref()) {
24508 return false;
24509 }
24510 }
24511 FastErrorResult rv;
24512 // NOTE: This assert does NOT call the function.
24513 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24514 MOZ_KnownLive(self)(self)->PassNullableObject(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24515 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableObject"
)), 0))
) {
24516 return false;
24517 }
24518 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24518; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24519 args.rval().setUndefined();
24520 return true;
24521}
24522
24523static const JSJitInfo passNullableObject_methodinfo = {
24524 { (JSJitGetterOp)passNullableObject },
24525 { prototypes::id::TestJSImplInterface },
24526 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24527 JSJitInfo::Method,
24528 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24529 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24530 false, /* isInfallible. False in setters. */
24531 false, /* isMovable. Not relevant for setters. */
24532 false, /* isEliminatable. Not relevant for setters. */
24533 false, /* isAlwaysInSlot. Only relevant for getters. */
24534 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24535 false, /* isTypedMethod. Only relevant for methods. */
24536 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24537};
24538
24539MOZ_CAN_RUN_SCRIPT static bool
24540passVariadicNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24541{
24542 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableObject");
24543 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24546( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24544 "TestJSImplInterface", "passVariadicNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24546( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24545 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24546( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24546 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24546( cx, "TestJSImplInterface"
, "passVariadicNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24547
24548 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24549 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24550 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24551 if (objIsXray) {
24552 unwrappedObj.emplace(cx, obj);
24553 }
24554 AutoSequence<JSObject*> arg0;
24555 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24556 if (args.length() > 0) {
24557 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
24558 JS_ReportOutOfMemory(cx);
24559 return false;
24560 }
24561 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
24562 // OK to do infallible append here, since we ensured capacity already.
24563 JSObject*& slot = *arg0.AppendElement(nullptr);
24564 if (args[variadicArg].isObject()) {
24565#ifdef __clang__1
24566#pragma clang diagnostic push
24567#pragma clang diagnostic ignored "-Wunreachable-code"
24568#pragma clang diagnostic ignored "-Wunreachable-code-return"
24569#endif // __clang__
24570 if ((true) && !CallerSubsumes(args[variadicArg])) {
24571 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24572 return false;
24573 }
24574#ifdef __clang__1
24575#pragma clang diagnostic pop
24576#endif // __clang__
24577 slot = &args[variadicArg].toObject();
24578 } else {
24579 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24580 return false;
24581 }
24582 }
24583 }
24584 if (objIsXray) {
24585 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24586 // we know Xrays have no dynamic unwrap behavior.
24587 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24588 if (!unwrappedObj.ref()) {
24589 return false;
24590 }
24591 }
24592 FastErrorResult rv;
24593 // NOTE: This assert does NOT call the function.
24594 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24595 MOZ_KnownLive(self)(self)->PassVariadicNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24596 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableObject"
)), 0))
) {
24597 return false;
24598 }
24599 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24599); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24599; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24600 args.rval().setUndefined();
24601 return true;
24602}
24603
24604static const JSJitInfo passVariadicNullableObject_methodinfo = {
24605 { (JSJitGetterOp)passVariadicNullableObject },
24606 { prototypes::id::TestJSImplInterface },
24607 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24608 JSJitInfo::Method,
24609 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24610 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24611 false, /* isInfallible. False in setters. */
24612 false, /* isMovable. Not relevant for setters. */
24613 false, /* isEliminatable. Not relevant for setters. */
24614 false, /* isAlwaysInSlot. Only relevant for getters. */
24615 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24616 false, /* isTypedMethod. Only relevant for methods. */
24617 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24618};
24619
24620MOZ_CAN_RUN_SCRIPT static bool
24621passOptionalObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24622{
24623 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalObject");
24624 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24627( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24625 "TestJSImplInterface", "passOptionalObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24627( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24626 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24627( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24627 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24627( cx, "TestJSImplInterface"
, "passOptionalObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24628
24629 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24630 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24631 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24632 if (objIsXray) {
24633 unwrappedObj.emplace(cx, obj);
24634 }
24635 Optional<JS::Handle<JSObject*>> arg0;
24636 if (args.hasDefined(0)) {
24637 arg0.Construct(cx);
24638 if (args[0].isObject()) {
24639#ifdef __clang__1
24640#pragma clang diagnostic push
24641#pragma clang diagnostic ignored "-Wunreachable-code"
24642#pragma clang diagnostic ignored "-Wunreachable-code-return"
24643#endif // __clang__
24644 if ((true) && !CallerSubsumes(args[0])) {
24645 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24646 return false;
24647 }
24648#ifdef __clang__1
24649#pragma clang diagnostic pop
24650#endif // __clang__
24651 arg0.Value() = &args[0].toObject();
24652 } else {
24653 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24654 return false;
24655 }
24656 }
24657 if (objIsXray) {
24658 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24659 // we know Xrays have no dynamic unwrap behavior.
24660 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24661 if (!unwrappedObj.ref()) {
24662 return false;
24663 }
24664 }
24665 FastErrorResult rv;
24666 // NOTE: This assert does NOT call the function.
24667 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24668 MOZ_KnownLive(self)(self)->PassOptionalObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24669 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalObject"
)), 0))
) {
24670 return false;
24671 }
24672 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24672; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24673 args.rval().setUndefined();
24674 return true;
24675}
24676
24677static const JSJitInfo passOptionalObject_methodinfo = {
24678 { (JSJitGetterOp)passOptionalObject },
24679 { prototypes::id::TestJSImplInterface },
24680 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24681 JSJitInfo::Method,
24682 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24683 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24684 false, /* isInfallible. False in setters. */
24685 false, /* isMovable. Not relevant for setters. */
24686 false, /* isEliminatable. Not relevant for setters. */
24687 false, /* isAlwaysInSlot. Only relevant for getters. */
24688 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24689 false, /* isTypedMethod. Only relevant for methods. */
24690 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24691};
24692
24693MOZ_CAN_RUN_SCRIPT static bool
24694passOptionalNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24695{
24696 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObject");
24697 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24700( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24698 "TestJSImplInterface", "passOptionalNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24700( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24699 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24700( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24700 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24700( cx, "TestJSImplInterface"
, "passOptionalNullableObject", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24701
24702 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24703 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24704 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24705 if (objIsXray) {
24706 unwrappedObj.emplace(cx, obj);
24707 }
24708 Optional<JS::Handle<JSObject*>> arg0;
24709 if (args.hasDefined(0)) {
24710 arg0.Construct(cx);
24711 if (args[0].isObject()) {
24712#ifdef __clang__1
24713#pragma clang diagnostic push
24714#pragma clang diagnostic ignored "-Wunreachable-code"
24715#pragma clang diagnostic ignored "-Wunreachable-code-return"
24716#endif // __clang__
24717 if ((true) && !CallerSubsumes(args[0])) {
24718 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24719 return false;
24720 }
24721#ifdef __clang__1
24722#pragma clang diagnostic pop
24723#endif // __clang__
24724 arg0.Value() = &args[0].toObject();
24725 } else if (args[0].isNullOrUndefined()) {
24726 arg0.Value() = nullptr;
24727 } else {
24728 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24729 return false;
24730 }
24731 }
24732 if (objIsXray) {
24733 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24734 // we know Xrays have no dynamic unwrap behavior.
24735 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24736 if (!unwrappedObj.ref()) {
24737 return false;
24738 }
24739 }
24740 FastErrorResult rv;
24741 // NOTE: This assert does NOT call the function.
24742 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24743 MOZ_KnownLive(self)(self)->PassOptionalNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24744 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObject"
)), 0))
) {
24745 return false;
24746 }
24747 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24747); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24747; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24748 args.rval().setUndefined();
24749 return true;
24750}
24751
24752static const JSJitInfo passOptionalNullableObject_methodinfo = {
24753 { (JSJitGetterOp)passOptionalNullableObject },
24754 { prototypes::id::TestJSImplInterface },
24755 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24756 JSJitInfo::Method,
24757 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24758 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24759 false, /* isInfallible. False in setters. */
24760 false, /* isMovable. Not relevant for setters. */
24761 false, /* isEliminatable. Not relevant for setters. */
24762 false, /* isAlwaysInSlot. Only relevant for getters. */
24763 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24764 false, /* isTypedMethod. Only relevant for methods. */
24765 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24766};
24767
24768MOZ_CAN_RUN_SCRIPT static bool
24769passOptionalNullableObjectWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24770{
24771 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue");
24772 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24775( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24773 "TestJSImplInterface", "passOptionalNullableObjectWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24775( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24774 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24775( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24775 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24775( cx, "TestJSImplInterface"
, "passOptionalNullableObjectWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24776
24777 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24778 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24779 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24780 if (objIsXray) {
24781 unwrappedObj.emplace(cx, obj);
24782 }
24783 JS::Rooted<JSObject*> arg0(cx);
24784 if (args.hasDefined(0)) {
24785 if (args[0].isObject()) {
24786#ifdef __clang__1
24787#pragma clang diagnostic push
24788#pragma clang diagnostic ignored "-Wunreachable-code"
24789#pragma clang diagnostic ignored "-Wunreachable-code-return"
24790#endif // __clang__
24791 if ((true) && !CallerSubsumes(args[0])) {
24792 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
24793 return false;
24794 }
24795#ifdef __clang__1
24796#pragma clang diagnostic pop
24797#endif // __clang__
24798 arg0 = &args[0].toObject();
24799 } else if (args[0].isNullOrUndefined()) {
24800 arg0 = nullptr;
24801 } else {
24802 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
24803 return false;
24804 }
24805 } else {
24806 arg0 = nullptr;
24807 }
24808 if (objIsXray) {
24809 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24810 // we know Xrays have no dynamic unwrap behavior.
24811 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24812 if (!unwrappedObj.ref()) {
24813 return false;
24814 }
24815 }
24816 FastErrorResult rv;
24817 // NOTE: This assert does NOT call the function.
24818 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24819 MOZ_KnownLive(self)(self)->PassOptionalNullableObjectWithDefaultValue(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24820 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue"
)), 0))
) {
24821 return false;
24822 }
24823 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24823); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24823; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24824 args.rval().setUndefined();
24825 return true;
24826}
24827
24828static const JSJitInfo passOptionalNullableObjectWithDefaultValue_methodinfo = {
24829 { (JSJitGetterOp)passOptionalNullableObjectWithDefaultValue },
24830 { prototypes::id::TestJSImplInterface },
24831 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24832 JSJitInfo::Method,
24833 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24834 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24835 false, /* isInfallible. False in setters. */
24836 false, /* isMovable. Not relevant for setters. */
24837 false, /* isEliminatable. Not relevant for setters. */
24838 false, /* isAlwaysInSlot. Only relevant for getters. */
24839 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24840 false, /* isTypedMethod. Only relevant for methods. */
24841 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24842};
24843
24844MOZ_CAN_RUN_SCRIPT static bool
24845passSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24846{
24847 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfObject");
24848 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24851( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24849 "TestJSImplInterface", "passSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24851( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24850 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24851( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
24851 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24851( cx, "TestJSImplInterface"
, "passSequenceOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
24852
24853 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24854 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfObject", 1)) {
24855 return false;
24856 }
24857 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24858 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24859 if (objIsXray) {
24860 unwrappedObj.emplace(cx, obj);
24861 }
24862 binding_detail::AutoSequence<JSObject*> arg0;
24863 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24864 if (args[0].isObject()) {
24865 JS::ForOfIterator iter(cx);
24866 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
24867 return false;
24868 }
24869 if (!iter.valueIsIterable()) {
24870 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24871 return false;
24872 }
24873 binding_detail::AutoSequence<JSObject*> &arr = arg0;
24874 JS::Rooted<JS::Value> temp(cx);
24875 while (true) {
24876 bool done;
24877 if (!iter.next(&temp, &done)) {
24878 return false;
24879 }
24880 if (done) {
24881 break;
24882 }
24883 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
24884 if (!slotPtr) {
24885 JS_ReportOutOfMemory(cx);
24886 return false;
24887 }
24888 JSObject*& slot = *slotPtr;
24889 if (temp.isObject()) {
24890#ifdef __clang__1
24891#pragma clang diagnostic push
24892#pragma clang diagnostic ignored "-Wunreachable-code"
24893#pragma clang diagnostic ignored "-Wunreachable-code-return"
24894#endif // __clang__
24895 if ((true) && !CallerSubsumes(temp)) {
24896 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
24897 return false;
24898 }
24899#ifdef __clang__1
24900#pragma clang diagnostic pop
24901#endif // __clang__
24902 slot = &temp.toObject();
24903 } else {
24904 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
24905 return false;
24906 }
24907 }
24908 } else {
24909 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24910 return false;
24911 }
24912 if (objIsXray) {
24913 // Since our object is an Xray, we can just CheckedUnwrapStatic:
24914 // we know Xrays have no dynamic unwrap behavior.
24915 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
24916 if (!unwrappedObj.ref()) {
24917 return false;
24918 }
24919 }
24920 FastErrorResult rv;
24921 // NOTE: This assert does NOT call the function.
24922 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
24923 MOZ_KnownLive(self)(self)->PassSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
24924 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfObject"
)), 0))
) {
24925 return false;
24926 }
24927 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 24927); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 24927; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
24928 args.rval().setUndefined();
24929 return true;
24930}
24931
24932static const JSJitInfo passSequenceOfObject_methodinfo = {
24933 { (JSJitGetterOp)passSequenceOfObject },
24934 { prototypes::id::TestJSImplInterface },
24935 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
24936 JSJitInfo::Method,
24937 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
24938 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
24939 false, /* isInfallible. False in setters. */
24940 false, /* isMovable. Not relevant for setters. */
24941 false, /* isEliminatable. Not relevant for setters. */
24942 false, /* isAlwaysInSlot. Only relevant for getters. */
24943 false, /* isLazilyCachedInSlot. Only relevant for getters. */
24944 false, /* isTypedMethod. Only relevant for methods. */
24945 0 /* Reserved slot index, if we're stored in a slot, else 0. */
24946};
24947
24948MOZ_CAN_RUN_SCRIPT static bool
24949passSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
24950{
24951 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableObject");
24952 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject24955( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24953 "TestJSImplInterface", "passSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject24955( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24954 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject24955( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
24955 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject24955( cx, "TestJSImplInterface"
, "passSequenceOfNullableObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
24956
24957 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
24958 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableObject", 1)) {
24959 return false;
24960 }
24961 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
24962 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
24963 if (objIsXray) {
24964 unwrappedObj.emplace(cx, obj);
24965 }
24966 binding_detail::AutoSequence<JSObject*> arg0;
24967 SequenceRooter<JSObject*> arg0_holder(cx, &arg0);
24968 if (args[0].isObject()) {
24969 JS::ForOfIterator iter(cx);
24970 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
24971 return false;
24972 }
24973 if (!iter.valueIsIterable()) {
24974 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
24975 return false;
24976 }
24977 binding_detail::AutoSequence<JSObject*> &arr = arg0;
24978 JS::Rooted<JS::Value> temp(cx);
24979 while (true) {
24980 bool done;
24981 if (!iter.next(&temp, &done)) {
24982 return false;
24983 }
24984 if (done) {
24985 break;
24986 }
24987 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
24988 if (!slotPtr) {
24989 JS_ReportOutOfMemory(cx);
24990 return false;
24991 }
24992 JSObject*& slot = *slotPtr;
24993 if (temp.isObject()) {
24994#ifdef __clang__1
24995#pragma clang diagnostic push
24996#pragma clang diagnostic ignored "-Wunreachable-code"
24997#pragma clang diagnostic ignored "-Wunreachable-code-return"
24998#endif // __clang__
24999 if ((true) && !CallerSubsumes(temp)) {
25000 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
25001 return false;
25002 }
25003#ifdef __clang__1
25004#pragma clang diagnostic pop
25005#endif // __clang__
25006 slot = &temp.toObject();
25007 } else if (temp.isNullOrUndefined()) {
25008 slot = nullptr;
25009 } else {
25010 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
25011 return false;
25012 }
25013 }
25014 } else {
25015 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25016 return false;
25017 }
25018 if (objIsXray) {
25019 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25020 // we know Xrays have no dynamic unwrap behavior.
25021 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25022 if (!unwrappedObj.ref()) {
25023 return false;
25024 }
25025 }
25026 FastErrorResult rv;
25027 // NOTE: This assert does NOT call the function.
25028 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25029 MOZ_KnownLive(self)(self)->PassSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25030 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableObject"
)), 0))
) {
25031 return false;
25032 }
25033 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25033); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25033; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25034 args.rval().setUndefined();
25035 return true;
25036}
25037
25038static const JSJitInfo passSequenceOfNullableObject_methodinfo = {
25039 { (JSJitGetterOp)passSequenceOfNullableObject },
25040 { prototypes::id::TestJSImplInterface },
25041 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25042 JSJitInfo::Method,
25043 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25044 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25045 false, /* isInfallible. False in setters. */
25046 false, /* isMovable. Not relevant for setters. */
25047 false, /* isEliminatable. Not relevant for setters. */
25048 false, /* isAlwaysInSlot. Only relevant for getters. */
25049 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25050 false, /* isTypedMethod. Only relevant for methods. */
25051 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25052};
25053
25054MOZ_CAN_RUN_SCRIPT static bool
25055passNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25056{
25057 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableSequenceOfObject");
25058 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25061( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25059 "TestJSImplInterface", "passNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25061( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25060 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25061( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
25061 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25061( cx, "TestJSImplInterface"
, "passNullableSequenceOfObject", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
25062
25063 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25064 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableSequenceOfObject", 1)) {
25065 return false;
25066 }
25067 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25068 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25069 if (objIsXray) {
25070 unwrappedObj.emplace(cx, obj);
25071 }
25072 Nullable<Sequence<JSObject*>> arg0;
25073 SequenceRooter<JSObject*> arg0_holder(cx, &arg0.SetValue());
25074 if (args[0].isObject()) {
25075 JS::ForOfIterator iter(cx);
25076 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25077 return false;
25078 }
25079 if (!iter.valueIsIterable()) {
25080 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25081 return false;
25082 }
25083 Sequence<JSObject*> &arr = arg0.SetValue();
25084 JS::Rooted<JS::Value> temp(cx);
25085 while (true) {
25086 bool done;
25087 if (!iter.next(&temp, &done)) {
25088 return false;
25089 }
25090 if (done) {
25091 break;
25092 }
25093 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
25094 if (!slotPtr) {
25095 JS_ReportOutOfMemory(cx);
25096 return false;
25097 }
25098 JSObject*& slot = *slotPtr;
25099 if (temp.isObject()) {
25100#ifdef __clang__1
25101#pragma clang diagnostic push
25102#pragma clang diagnostic ignored "-Wunreachable-code"
25103#pragma clang diagnostic ignored "-Wunreachable-code-return"
25104#endif // __clang__
25105 if ((true) && !CallerSubsumes(temp)) {
25106 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of argument 1");
25107 return false;
25108 }
25109#ifdef __clang__1
25110#pragma clang diagnostic pop
25111#endif // __clang__
25112 slot = &temp.toObject();
25113 } else {
25114 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of argument 1");
25115 return false;
25116 }
25117 }
25118 } else if (args[0].isNullOrUndefined()) {
25119 arg0.SetNull();
25120 } else {
25121 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25122 return false;
25123 }
25124 if (objIsXray) {
25125 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25126 // we know Xrays have no dynamic unwrap behavior.
25127 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25128 if (!unwrappedObj.ref()) {
25129 return false;
25130 }
25131 }
25132 FastErrorResult rv;
25133 // NOTE: This assert does NOT call the function.
25134 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25135 MOZ_KnownLive(self)(self)->PassNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25136 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableSequenceOfObject"
)), 0))
) {
25137 return false;
25138 }
25139 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25139); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25139; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25140 args.rval().setUndefined();
25141 return true;
25142}
25143
25144static const JSJitInfo passNullableSequenceOfObject_methodinfo = {
25145 { (JSJitGetterOp)passNullableSequenceOfObject },
25146 { prototypes::id::TestJSImplInterface },
25147 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25148 JSJitInfo::Method,
25149 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25150 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25151 false, /* isInfallible. False in setters. */
25152 false, /* isMovable. Not relevant for setters. */
25153 false, /* isEliminatable. Not relevant for setters. */
25154 false, /* isAlwaysInSlot. Only relevant for getters. */
25155 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25156 false, /* isTypedMethod. Only relevant for methods. */
25157 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25158};
25159
25160MOZ_CAN_RUN_SCRIPT static bool
25161passOptionalNullableSequenceOfNullableSequenceOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25162{
25163 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject");
25164 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25167( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25165 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25167( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25166 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25167( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25167 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25167( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfObject", JS
::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25168
25169 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25170 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25171 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25172 if (objIsXray) {
25173 unwrappedObj.emplace(cx, obj);
25174 }
25175 Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0;
25176 Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder;
25177 if (args.hasDefined(0)) {
25178 arg0.Construct();
25179 arg0_holder.emplace(cx, &arg0.Value().SetValue());
25180 if (args[0].isObject()) {
25181 JS::ForOfIterator iter(cx);
25182 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25183 return false;
25184 }
25185 if (!iter.valueIsIterable()) {
25186 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25187 return false;
25188 }
25189 Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue();
25190 JS::Rooted<JS::Value> temp(cx);
25191 while (true) {
25192 bool done;
25193 if (!iter.next(&temp, &done)) {
25194 return false;
25195 }
25196 if (done) {
25197 break;
25198 }
25199 Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible);
25200 if (!slotPtr) {
25201 JS_ReportOutOfMemory(cx);
25202 return false;
25203 }
25204 Nullable<Sequence<JSObject*>>& slot = *slotPtr;
25205 if (temp.isObject()) {
25206 JS::ForOfIterator iter1(cx);
25207 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
25208 return false;
25209 }
25210 if (!iter1.valueIsIterable()) {
25211 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25212 return false;
25213 }
25214 Sequence<JSObject*> &arr1 = slot.SetValue();
25215 JS::Rooted<JS::Value> temp1(cx);
25216 while (true) {
25217 bool done1;
25218 if (!iter1.next(&temp1, &done1)) {
25219 return false;
25220 }
25221 if (done1) {
25222 break;
25223 }
25224 JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible);
25225 if (!slotPtr1) {
25226 JS_ReportOutOfMemory(cx);
25227 return false;
25228 }
25229 JSObject*& slot1 = *slotPtr1;
25230 if (temp1.isObject()) {
25231#ifdef __clang__1
25232#pragma clang diagnostic push
25233#pragma clang diagnostic ignored "-Wunreachable-code"
25234#pragma clang diagnostic ignored "-Wunreachable-code-return"
25235#endif // __clang__
25236 if ((true) && !CallerSubsumes(temp1)) {
25237 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
25238 return false;
25239 }
25240#ifdef __clang__1
25241#pragma clang diagnostic pop
25242#endif // __clang__
25243 slot1 = &temp1.toObject();
25244 } else {
25245 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1");
25246 return false;
25247 }
25248 }
25249 } else if (temp.isNullOrUndefined()) {
25250 slot.SetNull();
25251 } else {
25252 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25253 return false;
25254 }
25255 }
25256 } else if (args[0].isNullOrUndefined()) {
25257 arg0.Value().SetNull();
25258 } else {
25259 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25260 return false;
25261 }
25262 }
25263 if (objIsXray) {
25264 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25265 // we know Xrays have no dynamic unwrap behavior.
25266 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25267 if (!unwrappedObj.ref()) {
25268 return false;
25269 }
25270 }
25271 FastErrorResult rv;
25272 // NOTE: This assert does NOT call the function.
25273 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25274 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25275 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject"
)), 0))
) {
25276 return false;
25277 }
25278 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25278); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25278; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25279 args.rval().setUndefined();
25280 return true;
25281}
25282
25283static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo = {
25284 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfObject },
25285 { prototypes::id::TestJSImplInterface },
25286 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25287 JSJitInfo::Method,
25288 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25289 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25290 false, /* isInfallible. False in setters. */
25291 false, /* isMovable. Not relevant for setters. */
25292 false, /* isEliminatable. Not relevant for setters. */
25293 false, /* isAlwaysInSlot. Only relevant for getters. */
25294 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25295 false, /* isTypedMethod. Only relevant for methods. */
25296 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25297};
25298
25299MOZ_CAN_RUN_SCRIPT static bool
25300passOptionalNullableSequenceOfNullableSequenceOfNullableObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25301{
25302 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject");
25303 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25306( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25304 "TestJSImplInterface", "passOptionalNullableSequenceOfNullableSequenceOfNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25306( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25305 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25306( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25306 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25306( cx, "TestJSImplInterface"
, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
, JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25307
25308 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25309 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25310 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25311 if (objIsXray) {
25312 unwrappedObj.emplace(cx, obj);
25313 }
25314 Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>> arg0;
25315 Maybe<SequenceRooter<Nullable<Sequence<JSObject*>>>> arg0_holder;
25316 if (args.hasDefined(0)) {
25317 arg0.Construct();
25318 arg0_holder.emplace(cx, &arg0.Value().SetValue());
25319 if (args[0].isObject()) {
25320 JS::ForOfIterator iter(cx);
25321 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
25322 return false;
25323 }
25324 if (!iter.valueIsIterable()) {
25325 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25326 return false;
25327 }
25328 Sequence<Nullable<Sequence<JSObject*>>> &arr = arg0.Value().SetValue();
25329 JS::Rooted<JS::Value> temp(cx);
25330 while (true) {
25331 bool done;
25332 if (!iter.next(&temp, &done)) {
25333 return false;
25334 }
25335 if (done) {
25336 break;
25337 }
25338 Nullable<Sequence<JSObject*>>* slotPtr = arr.AppendElement(mozilla::fallible);
25339 if (!slotPtr) {
25340 JS_ReportOutOfMemory(cx);
25341 return false;
25342 }
25343 Nullable<Sequence<JSObject*>>& slot = *slotPtr;
25344 if (temp.isObject()) {
25345 JS::ForOfIterator iter1(cx);
25346 if (!iter1.init(temp, JS::ForOfIterator::AllowNonIterable)) {
25347 return false;
25348 }
25349 if (!iter1.valueIsIterable()) {
25350 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25351 return false;
25352 }
25353 Sequence<JSObject*> &arr1 = slot.SetValue();
25354 JS::Rooted<JS::Value> temp1(cx);
25355 while (true) {
25356 bool done1;
25357 if (!iter1.next(&temp1, &done1)) {
25358 return false;
25359 }
25360 if (done1) {
25361 break;
25362 }
25363 JSObject** slotPtr1 = arr1.AppendElement(nullptr, mozilla::fallible);
25364 if (!slotPtr1) {
25365 JS_ReportOutOfMemory(cx);
25366 return false;
25367 }
25368 JSObject*& slot1 = *slotPtr1;
25369 if (temp1.isObject()) {
25370#ifdef __clang__1
25371#pragma clang diagnostic push
25372#pragma clang diagnostic ignored "-Wunreachable-code"
25373#pragma clang diagnostic ignored "-Wunreachable-code-return"
25374#endif // __clang__
25375 if ((true) && !CallerSubsumes(temp1)) {
25376 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of element of argument 1");
25377 return false;
25378 }
25379#ifdef __clang__1
25380#pragma clang diagnostic pop
25381#endif // __clang__
25382 slot1 = &temp1.toObject();
25383 } else if (temp1.isNullOrUndefined()) {
25384 slot1 = nullptr;
25385 } else {
25386 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of element of argument 1");
25387 return false;
25388 }
25389 }
25390 } else if (temp.isNullOrUndefined()) {
25391 slot.SetNull();
25392 } else {
25393 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Element of argument 1", "sequence");
25394 return false;
25395 }
25396 }
25397 } else if (args[0].isNullOrUndefined()) {
25398 arg0.Value().SetNull();
25399 } else {
25400 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
25401 return false;
25402 }
25403 }
25404 if (objIsXray) {
25405 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25406 // we know Xrays have no dynamic unwrap behavior.
25407 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25408 if (!unwrappedObj.ref()) {
25409 return false;
25410 }
25411 }
25412 FastErrorResult rv;
25413 // NOTE: This assert does NOT call the function.
25414 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25415 MOZ_KnownLive(self)(self)->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25416 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
)), 0))
) {
25417 return false;
25418 }
25419 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25419; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25420 args.rval().setUndefined();
25421 return true;
25422}
25423
25424static const JSJitInfo passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo = {
25425 { (JSJitGetterOp)passOptionalNullableSequenceOfNullableSequenceOfNullableObject },
25426 { prototypes::id::TestJSImplInterface },
25427 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25428 JSJitInfo::Method,
25429 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25430 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25431 false, /* isInfallible. False in setters. */
25432 false, /* isMovable. Not relevant for setters. */
25433 false, /* isEliminatable. Not relevant for setters. */
25434 false, /* isAlwaysInSlot. Only relevant for getters. */
25435 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25436 false, /* isTypedMethod. Only relevant for methods. */
25437 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25438};
25439
25440MOZ_CAN_RUN_SCRIPT static bool
25441passRecordOfObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25442{
25443 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfObject");
25444 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25447( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25445 "TestJSImplInterface", "passRecordOfObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25447( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25446 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25447( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25447 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25447( cx, "TestJSImplInterface"
, "passRecordOfObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25448
25449 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25450 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfObject", 1)) {
25451 return false;
25452 }
25453 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25454 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25455 if (objIsXray) {
25456 unwrappedObj.emplace(cx, obj);
25457 }
25458 Record<nsString, JSObject*> arg0;
25459 RecordRooter<nsString, JSObject*> arg0_holder(cx, &arg0);
25460 if (args[0].isObject()) {
25461 auto& recordEntries = arg0.Entries();
25462
25463 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
25464 JS::RootedVector<jsid> ids(cx);
25465 if (!js::GetPropertyKeys(cx, recordObj,
25466 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
25467 return false;
25468 }
25469 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
25470 JS_ReportOutOfMemory(cx);
25471 return false;
25472 }
25473 JS::Rooted<JS::Value> propNameValue(cx);
25474 JS::Rooted<JS::Value> temp(cx);
25475 JS::Rooted<jsid> curId(cx);
25476 JS::Rooted<JS::Value> idVal(cx);
25477 // Use a hashset to keep track of ids seen, to avoid
25478 // introducing nasty O(N^2) behavior scanning for them all the
25479 // time. Ideally we'd use a data structure with O(1) lookup
25480 // _and_ ordering for the MozMap, but we don't have one lying
25481 // around.
25482 nsTHashtable<nsStringHashKey> idsSeen;
25483 for (size_t i = 0; i < ids.length(); ++i) {
25484 curId = ids[i];
25485
25486 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
25487 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
25488 &desc)) {
25489 return false;
25490 }
25491
25492 if (desc.isNothing() || !desc->enumerable()) {
25493 continue;
25494 }
25495
25496 idVal = js::IdToValue(curId);
25497 nsString propName;
25498 // This will just throw if idVal is a Symbol, like the spec says
25499 // to do.
25500 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
25501 return false;
25502 }
25503
25504 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
25505 return false;
25506 }
25507
25508 Record<nsString, JSObject*>::EntryType* entry;
25509 if (!idsSeen.EnsureInserted(propName)) {
25510 // Find the existing entry.
25511 auto idx = recordEntries.IndexOf(propName);
25512 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 25513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 25513; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
25513 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 25513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 25513; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
25514 // Now blow it away to make it look like it was just added
25515 // to the array, because it's not obvious that it's
25516 // safe to write to its already-initialized mValue via our
25517 // normal codegen conversions. For example, the value
25518 // could be a union and this would change its type, but
25519 // codegen assumes we won't do that.
25520 entry = recordEntries.ReconstructElementAt(idx);
25521 } else {
25522 // Safe to do an infallible append here, because we did a
25523 // SetCapacity above to the right capacity.
25524 entry = recordEntries.AppendElement();
25525 }
25526 entry->mKey = propName;
25527 JSObject*& slot = entry->mValue;
25528 if (temp.isObject()) {
25529#ifdef __clang__1
25530#pragma clang diagnostic push
25531#pragma clang diagnostic ignored "-Wunreachable-code"
25532#pragma clang diagnostic ignored "-Wunreachable-code-return"
25533#endif // __clang__
25534 if ((true) && !CallerSubsumes(temp)) {
25535 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in argument 1");
25536 return false;
25537 }
25538#ifdef __clang__1
25539#pragma clang diagnostic pop
25540#endif // __clang__
25541 slot = &temp.toObject();
25542 } else {
25543 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value in argument 1");
25544 return false;
25545 }
25546 }
25547 } else {
25548 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
25549 return false;
25550 }
25551 if (objIsXray) {
25552 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25553 // we know Xrays have no dynamic unwrap behavior.
25554 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25555 if (!unwrappedObj.ref()) {
25556 return false;
25557 }
25558 }
25559 FastErrorResult rv;
25560 // NOTE: This assert does NOT call the function.
25561 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25562 MOZ_KnownLive(self)(self)->PassRecordOfObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25563 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfObject"
)), 0))
) {
25564 return false;
25565 }
25566 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25566); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25566; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25567 args.rval().setUndefined();
25568 return true;
25569}
25570
25571static const JSJitInfo passRecordOfObject_methodinfo = {
25572 { (JSJitGetterOp)passRecordOfObject },
25573 { prototypes::id::TestJSImplInterface },
25574 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25575 JSJitInfo::Method,
25576 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25577 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25578 false, /* isInfallible. False in setters. */
25579 false, /* isMovable. Not relevant for setters. */
25580 false, /* isEliminatable. Not relevant for setters. */
25581 false, /* isAlwaysInSlot. Only relevant for getters. */
25582 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25583 false, /* isTypedMethod. Only relevant for methods. */
25584 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25585};
25586
25587MOZ_CAN_RUN_SCRIPT static bool
25588receiveObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25589{
25590 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25593( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25591 "TestJSImplInterface", "receiveObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25593( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25592 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25593( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25593 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25593( cx, "TestJSImplInterface"
, "receiveObject", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25594
25595 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25596 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25597 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25598 if (objIsXray) {
25599 unwrappedObj.emplace(cx, obj);
25600 }
25601 if (objIsXray) {
25602 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25603 // we know Xrays have no dynamic unwrap behavior.
25604 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25605 if (!unwrappedObj.ref()) {
25606 return false;
25607 }
25608 }
25609 FastErrorResult rv;
25610 JS::Rooted<JSObject*> result(cx);
25611 // NOTE: This assert does NOT call the function.
25612 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25613 MOZ_KnownLive(self)(self)->ReceiveObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25614 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveObject"
)), 0))
) {
25615 return false;
25616 }
25617 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25617); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25617; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25618 JS::ExposeObjectToActiveJS(result);
25619 args.rval().setObject(*result);
25620 if (!MaybeWrapObjectValue(cx, args.rval())) {
25621 return false;
25622 }
25623 return true;
25624}
25625
25626static const JSJitInfo receiveObject_methodinfo = {
25627 { (JSJitGetterOp)receiveObject },
25628 { prototypes::id::TestJSImplInterface },
25629 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25630 JSJitInfo::Method,
25631 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25632 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
25633 false, /* isInfallible. False in setters. */
25634 false, /* isMovable. Not relevant for setters. */
25635 false, /* isEliminatable. Not relevant for setters. */
25636 false, /* isAlwaysInSlot. Only relevant for getters. */
25637 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25638 false, /* isTypedMethod. Only relevant for methods. */
25639 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25640};
25641
25642MOZ_CAN_RUN_SCRIPT static bool
25643receiveNullableObject(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25644{
25645 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25648( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25646 "TestJSImplInterface", "receiveNullableObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25648( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25647 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25648( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25648 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25648( cx, "TestJSImplInterface"
, "receiveNullableObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25649
25650 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25651 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25652 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25653 if (objIsXray) {
25654 unwrappedObj.emplace(cx, obj);
25655 }
25656 if (objIsXray) {
25657 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25658 // we know Xrays have no dynamic unwrap behavior.
25659 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25660 if (!unwrappedObj.ref()) {
25661 return false;
25662 }
25663 }
25664 FastErrorResult rv;
25665 JS::Rooted<JSObject*> result(cx);
25666 // NOTE: This assert does NOT call the function.
25667 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25668 MOZ_KnownLive(self)(self)->ReceiveNullableObject(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25669 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableObject"
)), 0))
) {
25670 return false;
25671 }
25672 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25672; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25673 if (result) {
25674 JS::ExposeObjectToActiveJS(result);
25675 }
25676 args.rval().setObjectOrNull(result);
25677 if (!MaybeWrapObjectOrNullValue(cx, args.rval())) {
25678 return false;
25679 }
25680 return true;
25681}
25682
25683static const JSJitInfo receiveNullableObject_methodinfo = {
25684 { (JSJitGetterOp)receiveNullableObject },
25685 { prototypes::id::TestJSImplInterface },
25686 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25687 JSJitInfo::Method,
25688 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25689 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
25690 false, /* isInfallible. False in setters. */
25691 false, /* isMovable. Not relevant for setters. */
25692 false, /* isEliminatable. Not relevant for setters. */
25693 false, /* isAlwaysInSlot. Only relevant for getters. */
25694 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25695 false, /* isTypedMethod. Only relevant for methods. */
25696 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25697};
25698
25699MOZ_CAN_RUN_SCRIPT static bool
25700passUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25701{
25702 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion");
25703 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25706( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25704 "TestJSImplInterface", "passUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25706( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25705 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25706( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
25706 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25706( cx, "TestJSImplInterface"
, "passUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
25707
25708 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25709 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion", 1)) {
25710 return false;
25711 }
25712 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25713 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25714 if (objIsXray) {
25715 unwrappedObj.emplace(cx, obj);
25716 }
25717 ObjectOrLong arg0;
25718 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25719 return false;
25720 }
25721 if (objIsXray) {
25722 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25723 // we know Xrays have no dynamic unwrap behavior.
25724 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25725 if (!unwrappedObj.ref()) {
25726 return false;
25727 }
25728 }
25729 FastErrorResult rv;
25730 // NOTE: This assert does NOT call the function.
25731 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25732 MOZ_KnownLive(self)(self)->PassUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25733 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion"
)), 0))
) {
25734 return false;
25735 }
25736 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25736); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25736; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25737 args.rval().setUndefined();
25738 return true;
25739}
25740
25741static const JSJitInfo passUnion_methodinfo = {
25742 { (JSJitGetterOp)passUnion },
25743 { prototypes::id::TestJSImplInterface },
25744 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25745 JSJitInfo::Method,
25746 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25747 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25748 false, /* isInfallible. False in setters. */
25749 false, /* isMovable. Not relevant for setters. */
25750 false, /* isEliminatable. Not relevant for setters. */
25751 false, /* isAlwaysInSlot. Only relevant for getters. */
25752 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25753 false, /* isTypedMethod. Only relevant for methods. */
25754 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25755};
25756
25757MOZ_CAN_RUN_SCRIPT static bool
25758passUnion2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25759{
25760 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion2");
25761 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25764( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25762 "TestJSImplInterface", "passUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25764( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25763 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25764( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25764 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25764( cx, "TestJSImplInterface"
, "passUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25765
25766 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25767 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion2", 1)) {
25768 return false;
25769 }
25770 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25771 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25772 if (objIsXray) {
25773 unwrappedObj.emplace(cx, obj);
25774 }
25775 LongOrBoolean arg0;
25776 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25777 return false;
25778 }
25779 if (objIsXray) {
25780 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25781 // we know Xrays have no dynamic unwrap behavior.
25782 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25783 if (!unwrappedObj.ref()) {
25784 return false;
25785 }
25786 }
25787 FastErrorResult rv;
25788 // NOTE: This assert does NOT call the function.
25789 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25790 MOZ_KnownLive(self)(self)->PassUnion2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25791 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion2"
)), 0))
) {
25792 return false;
25793 }
25794 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25794); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25794; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25795 args.rval().setUndefined();
25796 return true;
25797}
25798
25799static const JSJitInfo passUnion2_methodinfo = {
25800 { (JSJitGetterOp)passUnion2 },
25801 { prototypes::id::TestJSImplInterface },
25802 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25803 JSJitInfo::Method,
25804 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25805 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25806 false, /* isInfallible. False in setters. */
25807 false, /* isMovable. Not relevant for setters. */
25808 false, /* isEliminatable. Not relevant for setters. */
25809 false, /* isAlwaysInSlot. Only relevant for getters. */
25810 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25811 false, /* isTypedMethod. Only relevant for methods. */
25812 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25813};
25814
25815MOZ_CAN_RUN_SCRIPT static bool
25816passUnion3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25817{
25818 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion3");
25819 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25822( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25820 "TestJSImplInterface", "passUnion3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25822( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25821 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25822( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25822 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25822( cx, "TestJSImplInterface"
, "passUnion3", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25823
25824 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25825 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion3", 1)) {
25826 return false;
25827 }
25828 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25829 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25830 if (objIsXray) {
25831 unwrappedObj.emplace(cx, obj);
25832 }
25833 ObjectOrLongOrBoolean arg0;
25834 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25835 return false;
25836 }
25837 if (objIsXray) {
25838 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25839 // we know Xrays have no dynamic unwrap behavior.
25840 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25841 if (!unwrappedObj.ref()) {
25842 return false;
25843 }
25844 }
25845 FastErrorResult rv;
25846 // NOTE: This assert does NOT call the function.
25847 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25848 MOZ_KnownLive(self)(self)->PassUnion3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25849 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion3"
)), 0))
) {
25850 return false;
25851 }
25852 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25852); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25852; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25853 args.rval().setUndefined();
25854 return true;
25855}
25856
25857static const JSJitInfo passUnion3_methodinfo = {
25858 { (JSJitGetterOp)passUnion3 },
25859 { prototypes::id::TestJSImplInterface },
25860 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25861 JSJitInfo::Method,
25862 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25863 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25864 false, /* isInfallible. False in setters. */
25865 false, /* isMovable. Not relevant for setters. */
25866 false, /* isEliminatable. Not relevant for setters. */
25867 false, /* isAlwaysInSlot. Only relevant for getters. */
25868 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25869 false, /* isTypedMethod. Only relevant for methods. */
25870 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25871};
25872
25873MOZ_CAN_RUN_SCRIPT static bool
25874passUnion4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25875{
25876 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion4");
25877 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25880( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25878 "TestJSImplInterface", "passUnion4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25880( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25879 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25880( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25880 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25880( cx, "TestJSImplInterface"
, "passUnion4", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25881
25882 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25883 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion4", 1)) {
25884 return false;
25885 }
25886 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25887 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25888 if (objIsXray) {
25889 unwrappedObj.emplace(cx, obj);
25890 }
25891 NodeOrLongOrBoolean arg0;
25892 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25893 return false;
25894 }
25895 if (objIsXray) {
25896 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25897 // we know Xrays have no dynamic unwrap behavior.
25898 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25899 if (!unwrappedObj.ref()) {
25900 return false;
25901 }
25902 }
25903 FastErrorResult rv;
25904 // NOTE: This assert does NOT call the function.
25905 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25906 MOZ_KnownLive(self)(self)->PassUnion4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25907 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion4"
)), 0))
) {
25908 return false;
25909 }
25910 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25910); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25910; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25911 args.rval().setUndefined();
25912 return true;
25913}
25914
25915static const JSJitInfo passUnion4_methodinfo = {
25916 { (JSJitGetterOp)passUnion4 },
25917 { prototypes::id::TestJSImplInterface },
25918 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25919 JSJitInfo::Method,
25920 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25921 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25922 false, /* isInfallible. False in setters. */
25923 false, /* isMovable. Not relevant for setters. */
25924 false, /* isEliminatable. Not relevant for setters. */
25925 false, /* isAlwaysInSlot. Only relevant for getters. */
25926 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25927 false, /* isTypedMethod. Only relevant for methods. */
25928 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25929};
25930
25931MOZ_CAN_RUN_SCRIPT static bool
25932passUnion5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25933{
25934 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion5");
25935 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25938( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25936 "TestJSImplInterface", "passUnion5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25938( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25937 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25938( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25938 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25938( cx, "TestJSImplInterface"
, "passUnion5", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25939
25940 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25941 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion5", 1)) {
25942 return false;
25943 }
25944 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
25945 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
25946 if (objIsXray) {
25947 unwrappedObj.emplace(cx, obj);
25948 }
25949 ObjectOrBoolean arg0;
25950 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
25951 return false;
25952 }
25953 if (objIsXray) {
25954 // Since our object is an Xray, we can just CheckedUnwrapStatic:
25955 // we know Xrays have no dynamic unwrap behavior.
25956 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
25957 if (!unwrappedObj.ref()) {
25958 return false;
25959 }
25960 }
25961 FastErrorResult rv;
25962 // NOTE: This assert does NOT call the function.
25963 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
25964 MOZ_KnownLive(self)(self)->PassUnion5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
25965 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion5"
)), 0))
) {
25966 return false;
25967 }
25968 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 25968); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 25968; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
25969 args.rval().setUndefined();
25970 return true;
25971}
25972
25973static const JSJitInfo passUnion5_methodinfo = {
25974 { (JSJitGetterOp)passUnion5 },
25975 { prototypes::id::TestJSImplInterface },
25976 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
25977 JSJitInfo::Method,
25978 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
25979 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
25980 false, /* isInfallible. False in setters. */
25981 false, /* isMovable. Not relevant for setters. */
25982 false, /* isEliminatable. Not relevant for setters. */
25983 false, /* isAlwaysInSlot. Only relevant for getters. */
25984 false, /* isLazilyCachedInSlot. Only relevant for getters. */
25985 false, /* isTypedMethod. Only relevant for methods. */
25986 0 /* Reserved slot index, if we're stored in a slot, else 0. */
25987};
25988
25989MOZ_CAN_RUN_SCRIPT static bool
25990passUnion6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
25991{
25992 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion6");
25993 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject25996( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25994 "TestJSImplInterface", "passUnion6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject25996( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25995 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject25996( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
25996 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject25996( cx, "TestJSImplInterface"
, "passUnion6", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
25997
25998 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
25999 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion6", 1)) {
26000 return false;
26001 }
26002 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26003 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26004 if (objIsXray) {
26005 unwrappedObj.emplace(cx, obj);
26006 }
26007 ObjectOrString arg0;
26008 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26009 return false;
26010 }
26011 if (objIsXray) {
26012 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26013 // we know Xrays have no dynamic unwrap behavior.
26014 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26015 if (!unwrappedObj.ref()) {
26016 return false;
26017 }
26018 }
26019 FastErrorResult rv;
26020 // NOTE: This assert does NOT call the function.
26021 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26022 MOZ_KnownLive(self)(self)->PassUnion6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26023 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion6"
)), 0))
) {
26024 return false;
26025 }
26026 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26026; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26027 args.rval().setUndefined();
26028 return true;
26029}
26030
26031static const JSJitInfo passUnion6_methodinfo = {
26032 { (JSJitGetterOp)passUnion6 },
26033 { prototypes::id::TestJSImplInterface },
26034 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26035 JSJitInfo::Method,
26036 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26037 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26038 false, /* isInfallible. False in setters. */
26039 false, /* isMovable. Not relevant for setters. */
26040 false, /* isEliminatable. Not relevant for setters. */
26041 false, /* isAlwaysInSlot. Only relevant for getters. */
26042 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26043 false, /* isTypedMethod. Only relevant for methods. */
26044 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26045};
26046
26047MOZ_CAN_RUN_SCRIPT static bool
26048passUnion7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26049{
26050 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion7");
26051 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26054( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26052 "TestJSImplInterface", "passUnion7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26054( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26053 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26054( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26054 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26054( cx, "TestJSImplInterface"
, "passUnion7", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26055
26056 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26057 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion7", 1)) {
26058 return false;
26059 }
26060 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26061 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26062 if (objIsXray) {
26063 unwrappedObj.emplace(cx, obj);
26064 }
26065 ObjectOrStringOrLong arg0;
26066 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26067 return false;
26068 }
26069 if (objIsXray) {
26070 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26071 // we know Xrays have no dynamic unwrap behavior.
26072 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26073 if (!unwrappedObj.ref()) {
26074 return false;
26075 }
26076 }
26077 FastErrorResult rv;
26078 // NOTE: This assert does NOT call the function.
26079 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26080 MOZ_KnownLive(self)(self)->PassUnion7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26081 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion7"
)), 0))
) {
26082 return false;
26083 }
26084 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26084); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26084; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26085 args.rval().setUndefined();
26086 return true;
26087}
26088
26089static const JSJitInfo passUnion7_methodinfo = {
26090 { (JSJitGetterOp)passUnion7 },
26091 { prototypes::id::TestJSImplInterface },
26092 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26093 JSJitInfo::Method,
26094 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26095 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26096 false, /* isInfallible. False in setters. */
26097 false, /* isMovable. Not relevant for setters. */
26098 false, /* isEliminatable. Not relevant for setters. */
26099 false, /* isAlwaysInSlot. Only relevant for getters. */
26100 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26101 false, /* isTypedMethod. Only relevant for methods. */
26102 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26103};
26104
26105MOZ_CAN_RUN_SCRIPT static bool
26106passUnion8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26107{
26108 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion8");
26109 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26112( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26110 "TestJSImplInterface", "passUnion8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26112( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26111 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26112( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26112 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26112( cx, "TestJSImplInterface"
, "passUnion8", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26113
26114 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26115 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion8", 1)) {
26116 return false;
26117 }
26118 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26119 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26120 if (objIsXray) {
26121 unwrappedObj.emplace(cx, obj);
26122 }
26123 ObjectOrStringOrBoolean arg0;
26124 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26125 return false;
26126 }
26127 if (objIsXray) {
26128 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26129 // we know Xrays have no dynamic unwrap behavior.
26130 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26131 if (!unwrappedObj.ref()) {
26132 return false;
26133 }
26134 }
26135 FastErrorResult rv;
26136 // NOTE: This assert does NOT call the function.
26137 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26138 MOZ_KnownLive(self)(self)->PassUnion8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26139 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion8"
)), 0))
) {
26140 return false;
26141 }
26142 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26142; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26143 args.rval().setUndefined();
26144 return true;
26145}
26146
26147static const JSJitInfo passUnion8_methodinfo = {
26148 { (JSJitGetterOp)passUnion8 },
26149 { prototypes::id::TestJSImplInterface },
26150 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26151 JSJitInfo::Method,
26152 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26153 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26154 false, /* isInfallible. False in setters. */
26155 false, /* isMovable. Not relevant for setters. */
26156 false, /* isEliminatable. Not relevant for setters. */
26157 false, /* isAlwaysInSlot. Only relevant for getters. */
26158 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26159 false, /* isTypedMethod. Only relevant for methods. */
26160 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26161};
26162
26163MOZ_CAN_RUN_SCRIPT static bool
26164passUnion9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26165{
26166 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion9");
26167 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26170( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26168 "TestJSImplInterface", "passUnion9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26170( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26169 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26170( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26170 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26170( cx, "TestJSImplInterface"
, "passUnion9", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26171
26172 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26173 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion9", 1)) {
26174 return false;
26175 }
26176 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26177 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26178 if (objIsXray) {
26179 unwrappedObj.emplace(cx, obj);
26180 }
26181 ObjectOrStringOrLongOrBoolean arg0;
26182 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26183 return false;
26184 }
26185 if (objIsXray) {
26186 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26187 // we know Xrays have no dynamic unwrap behavior.
26188 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26189 if (!unwrappedObj.ref()) {
26190 return false;
26191 }
26192 }
26193 FastErrorResult rv;
26194 // NOTE: This assert does NOT call the function.
26195 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26196 MOZ_KnownLive(self)(self)->PassUnion9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26197 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion9"
)), 0))
) {
26198 return false;
26199 }
26200 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26200); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26200; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26201 args.rval().setUndefined();
26202 return true;
26203}
26204
26205static const JSJitInfo passUnion9_methodinfo = {
26206 { (JSJitGetterOp)passUnion9 },
26207 { prototypes::id::TestJSImplInterface },
26208 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26209 JSJitInfo::Method,
26210 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26211 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26212 false, /* isInfallible. False in setters. */
26213 false, /* isMovable. Not relevant for setters. */
26214 false, /* isEliminatable. Not relevant for setters. */
26215 false, /* isAlwaysInSlot. Only relevant for getters. */
26216 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26217 false, /* isTypedMethod. Only relevant for methods. */
26218 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26219};
26220
26221MOZ_CAN_RUN_SCRIPT static bool
26222passUnion10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26223{
26224 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion10");
26225 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26228( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26226 "TestJSImplInterface", "passUnion10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26228( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26227 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26228( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26228 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26228( cx, "TestJSImplInterface"
, "passUnion10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26229
26230 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26231 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26232 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26233 if (objIsXray) {
26234 unwrappedObj.emplace(cx, obj);
26235 }
26236 EventInitOrLong arg0;
26237 if (!(args.hasDefined(0))) {
26238 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or long)")) {
26239 return false;
26240 }
26241 } else {
26242 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26243 return false;
26244 }
26245 }
26246 if (objIsXray) {
26247 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26248 // we know Xrays have no dynamic unwrap behavior.
26249 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26250 if (!unwrappedObj.ref()) {
26251 return false;
26252 }
26253 }
26254 FastErrorResult rv;
26255 // NOTE: This assert does NOT call the function.
26256 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26257 MOZ_KnownLive(self)(self)->PassUnion10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26258 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion10"
)), 0))
) {
26259 return false;
26260 }
26261 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26261); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26261; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26262 args.rval().setUndefined();
26263 return true;
26264}
26265
26266static const JSJitInfo passUnion10_methodinfo = {
26267 { (JSJitGetterOp)passUnion10 },
26268 { prototypes::id::TestJSImplInterface },
26269 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26270 JSJitInfo::Method,
26271 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26272 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26273 false, /* isInfallible. False in setters. */
26274 false, /* isMovable. Not relevant for setters. */
26275 false, /* isEliminatable. Not relevant for setters. */
26276 false, /* isAlwaysInSlot. Only relevant for getters. */
26277 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26278 false, /* isTypedMethod. Only relevant for methods. */
26279 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26280};
26281
26282MOZ_CAN_RUN_SCRIPT static bool
26283passUnion11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26284{
26285 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion11");
26286 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26289( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26287 "TestJSImplInterface", "passUnion11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26289( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26288 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26289( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26289 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26289( cx, "TestJSImplInterface"
, "passUnion11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26290
26291 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26292 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26293 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26294 if (objIsXray) {
26295 unwrappedObj.emplace(cx, obj);
26296 }
26297 CustomEventInitOrLong arg0;
26298 if (!(args.hasDefined(0))) {
26299 if (!arg0.RawSetAsCustomEventInit(cx).Init(cx, JS::NullHandleValue, "Member of (CustomEventInit or long)")) {
26300 return false;
26301 }
26302 } else {
26303 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26304 return false;
26305 }
26306 }
26307 if (objIsXray) {
26308 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26309 // we know Xrays have no dynamic unwrap behavior.
26310 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26311 if (!unwrappedObj.ref()) {
26312 return false;
26313 }
26314 }
26315 FastErrorResult rv;
26316 // NOTE: This assert does NOT call the function.
26317 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26318 MOZ_KnownLive(self)(self)->PassUnion11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26319 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion11"
)), 0))
) {
26320 return false;
26321 }
26322 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26322); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26322; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26323 args.rval().setUndefined();
26324 return true;
26325}
26326
26327static const JSJitInfo passUnion11_methodinfo = {
26328 { (JSJitGetterOp)passUnion11 },
26329 { prototypes::id::TestJSImplInterface },
26330 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26331 JSJitInfo::Method,
26332 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26333 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26334 false, /* isInfallible. False in setters. */
26335 false, /* isMovable. Not relevant for setters. */
26336 false, /* isEliminatable. Not relevant for setters. */
26337 false, /* isAlwaysInSlot. Only relevant for getters. */
26338 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26339 false, /* isTypedMethod. Only relevant for methods. */
26340 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26341};
26342
26343MOZ_CAN_RUN_SCRIPT static bool
26344passUnion12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26345{
26346 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion12");
26347 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26350( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26348 "TestJSImplInterface", "passUnion12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26350( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26349 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26350( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26350 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26350( cx, "TestJSImplInterface"
, "passUnion12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26351
26352 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26353 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26354 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26355 if (objIsXray) {
26356 unwrappedObj.emplace(cx, obj);
26357 }
26358 EventInitOrLong arg0;
26359 if (!(args.hasDefined(0))) {
26360 arg0.RawSetAsLong() = 5;
26361 } else {
26362 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26363 return false;
26364 }
26365 }
26366 if (objIsXray) {
26367 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26368 // we know Xrays have no dynamic unwrap behavior.
26369 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26370 if (!unwrappedObj.ref()) {
26371 return false;
26372 }
26373 }
26374 FastErrorResult rv;
26375 // NOTE: This assert does NOT call the function.
26376 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26377 MOZ_KnownLive(self)(self)->PassUnion12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26378 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion12"
)), 0))
) {
26379 return false;
26380 }
26381 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26381); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26381; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26382 args.rval().setUndefined();
26383 return true;
26384}
26385
26386static const JSJitInfo passUnion12_methodinfo = {
26387 { (JSJitGetterOp)passUnion12 },
26388 { prototypes::id::TestJSImplInterface },
26389 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26390 JSJitInfo::Method,
26391 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26392 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26393 false, /* isInfallible. False in setters. */
26394 false, /* isMovable. Not relevant for setters. */
26395 false, /* isEliminatable. Not relevant for setters. */
26396 false, /* isAlwaysInSlot. Only relevant for getters. */
26397 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26398 false, /* isTypedMethod. Only relevant for methods. */
26399 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26400};
26401
26402MOZ_CAN_RUN_SCRIPT static bool
26403passUnion13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26404{
26405 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion13");
26406 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26409( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26407 "TestJSImplInterface", "passUnion13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26409( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26408 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26409( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26409 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26409( cx, "TestJSImplInterface"
, "passUnion13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26410
26411 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26412 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26413 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26414 if (objIsXray) {
26415 unwrappedObj.emplace(cx, obj);
26416 }
26417 ObjectOrLongOrNull arg0;
26418 if (!(args.hasDefined(0))) {
26419 arg0.SetNull();
26420 } else {
26421 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26422 return false;
26423 }
26424 }
26425 if (objIsXray) {
26426 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26427 // we know Xrays have no dynamic unwrap behavior.
26428 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26429 if (!unwrappedObj.ref()) {
26430 return false;
26431 }
26432 }
26433 FastErrorResult rv;
26434 // NOTE: This assert does NOT call the function.
26435 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26436 MOZ_KnownLive(self)(self)->PassUnion13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26437 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion13"
)), 0))
) {
26438 return false;
26439 }
26440 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26440); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26440; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26441 args.rval().setUndefined();
26442 return true;
26443}
26444
26445static const JSJitInfo passUnion13_methodinfo = {
26446 { (JSJitGetterOp)passUnion13 },
26447 { prototypes::id::TestJSImplInterface },
26448 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26449 JSJitInfo::Method,
26450 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26451 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26452 false, /* isInfallible. False in setters. */
26453 false, /* isMovable. Not relevant for setters. */
26454 false, /* isEliminatable. Not relevant for setters. */
26455 false, /* isAlwaysInSlot. Only relevant for getters. */
26456 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26457 false, /* isTypedMethod. Only relevant for methods. */
26458 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26459};
26460
26461MOZ_CAN_RUN_SCRIPT static bool
26462passUnion14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26463{
26464 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion14");
26465 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26468( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26466 "TestJSImplInterface", "passUnion14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26468( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26467 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26468( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26468 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26468( cx, "TestJSImplInterface"
, "passUnion14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26469
26470 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26471 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26472 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26473 if (objIsXray) {
26474 unwrappedObj.emplace(cx, obj);
26475 }
26476 ObjectOrLongOrNull arg0;
26477 if (!(args.hasDefined(0))) {
26478 arg0.RawSetAsLong() = 5;
26479 } else {
26480 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26481 return false;
26482 }
26483 }
26484 if (objIsXray) {
26485 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26486 // we know Xrays have no dynamic unwrap behavior.
26487 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26488 if (!unwrappedObj.ref()) {
26489 return false;
26490 }
26491 }
26492 FastErrorResult rv;
26493 // NOTE: This assert does NOT call the function.
26494 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26495 MOZ_KnownLive(self)(self)->PassUnion14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26496 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion14"
)), 0))
) {
26497 return false;
26498 }
26499 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26499); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26499; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26500 args.rval().setUndefined();
26501 return true;
26502}
26503
26504static const JSJitInfo passUnion14_methodinfo = {
26505 { (JSJitGetterOp)passUnion14 },
26506 { prototypes::id::TestJSImplInterface },
26507 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26508 JSJitInfo::Method,
26509 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26510 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26511 false, /* isInfallible. False in setters. */
26512 false, /* isMovable. Not relevant for setters. */
26513 false, /* isEliminatable. Not relevant for setters. */
26514 false, /* isAlwaysInSlot. Only relevant for getters. */
26515 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26516 false, /* isTypedMethod. Only relevant for methods. */
26517 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26518};
26519
26520MOZ_CAN_RUN_SCRIPT static bool
26521passUnion15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26522{
26523 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion15");
26524 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26527( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26525 "TestJSImplInterface", "passUnion15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26527( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26526 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26527( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26527 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26527( cx, "TestJSImplInterface"
, "passUnion15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26528
26529 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26530 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion15", 1)) {
26531 return false;
26532 }
26533 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26534 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26535 if (objIsXray) {
26536 unwrappedObj.emplace(cx, obj);
26537 }
26538 LongSequenceOrLong arg0;
26539 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26540 return false;
26541 }
26542 if (objIsXray) {
26543 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26544 // we know Xrays have no dynamic unwrap behavior.
26545 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26546 if (!unwrappedObj.ref()) {
26547 return false;
26548 }
26549 }
26550 FastErrorResult rv;
26551 // NOTE: This assert does NOT call the function.
26552 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26553 MOZ_KnownLive(self)(self)->PassUnion15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26554 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion15"
)), 0))
) {
26555 return false;
26556 }
26557 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26557); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26557; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26558 args.rval().setUndefined();
26559 return true;
26560}
26561
26562static const JSJitInfo passUnion15_methodinfo = {
26563 { (JSJitGetterOp)passUnion15 },
26564 { prototypes::id::TestJSImplInterface },
26565 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26566 JSJitInfo::Method,
26567 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26568 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26569 false, /* isInfallible. False in setters. */
26570 false, /* isMovable. Not relevant for setters. */
26571 false, /* isEliminatable. Not relevant for setters. */
26572 false, /* isAlwaysInSlot. Only relevant for getters. */
26573 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26574 false, /* isTypedMethod. Only relevant for methods. */
26575 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26576};
26577
26578MOZ_CAN_RUN_SCRIPT static bool
26579passUnion16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26580{
26581 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion16");
26582 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26585( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26583 "TestJSImplInterface", "passUnion16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26585( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26584 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26585( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26585 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26585( cx, "TestJSImplInterface"
, "passUnion16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26586
26587 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26588 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26589 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26590 if (objIsXray) {
26591 unwrappedObj.emplace(cx, obj);
26592 }
26593 Optional<LongSequenceOrLong> arg0;
26594 if (args.hasDefined(0)) {
26595 arg0.Construct();
26596 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
26597 return false;
26598 }
26599 }
26600 if (objIsXray) {
26601 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26602 // we know Xrays have no dynamic unwrap behavior.
26603 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26604 if (!unwrappedObj.ref()) {
26605 return false;
26606 }
26607 }
26608 FastErrorResult rv;
26609 // NOTE: This assert does NOT call the function.
26610 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26611 MOZ_KnownLive(self)(self)->PassUnion16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26612 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion16"
)), 0))
) {
26613 return false;
26614 }
26615 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26615); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26615; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26616 args.rval().setUndefined();
26617 return true;
26618}
26619
26620static const JSJitInfo passUnion16_methodinfo = {
26621 { (JSJitGetterOp)passUnion16 },
26622 { prototypes::id::TestJSImplInterface },
26623 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26624 JSJitInfo::Method,
26625 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26626 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26627 false, /* isInfallible. False in setters. */
26628 false, /* isMovable. Not relevant for setters. */
26629 false, /* isEliminatable. Not relevant for setters. */
26630 false, /* isAlwaysInSlot. Only relevant for getters. */
26631 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26632 false, /* isTypedMethod. Only relevant for methods. */
26633 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26634};
26635
26636MOZ_CAN_RUN_SCRIPT static bool
26637passUnion17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26638{
26639 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion17");
26640 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26643( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26641 "TestJSImplInterface", "passUnion17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26643( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26642 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26643( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26643 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26643( cx, "TestJSImplInterface"
, "passUnion17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26644
26645 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26646 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26647 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26648 if (objIsXray) {
26649 unwrappedObj.emplace(cx, obj);
26650 }
26651 LongSequenceOrNullOrLong arg0;
26652 if (!(args.hasDefined(0))) {
26653 arg0.RawSetAsLong() = 5;
26654 } else {
26655 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26656 return false;
26657 }
26658 }
26659 if (objIsXray) {
26660 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26661 // we know Xrays have no dynamic unwrap behavior.
26662 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26663 if (!unwrappedObj.ref()) {
26664 return false;
26665 }
26666 }
26667 FastErrorResult rv;
26668 // NOTE: This assert does NOT call the function.
26669 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26670 MOZ_KnownLive(self)(self)->PassUnion17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26671 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion17"
)), 0))
) {
26672 return false;
26673 }
26674 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26674); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26674; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26675 args.rval().setUndefined();
26676 return true;
26677}
26678
26679static const JSJitInfo passUnion17_methodinfo = {
26680 { (JSJitGetterOp)passUnion17 },
26681 { prototypes::id::TestJSImplInterface },
26682 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26683 JSJitInfo::Method,
26684 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26685 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26686 false, /* isInfallible. False in setters. */
26687 false, /* isMovable. Not relevant for setters. */
26688 false, /* isEliminatable. Not relevant for setters. */
26689 false, /* isAlwaysInSlot. Only relevant for getters. */
26690 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26691 false, /* isTypedMethod. Only relevant for methods. */
26692 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26693};
26694
26695MOZ_CAN_RUN_SCRIPT static bool
26696passUnion18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26697{
26698 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion18");
26699 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26702( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26700 "TestJSImplInterface", "passUnion18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26702( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26701 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26702( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26702 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26702( cx, "TestJSImplInterface"
, "passUnion18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26703
26704 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26705 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion18", 1)) {
26706 return false;
26707 }
26708 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26709 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26710 if (objIsXray) {
26711 unwrappedObj.emplace(cx, obj);
26712 }
26713 ObjectSequenceOrLong arg0;
26714 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26715 return false;
26716 }
26717 if (objIsXray) {
26718 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26719 // we know Xrays have no dynamic unwrap behavior.
26720 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26721 if (!unwrappedObj.ref()) {
26722 return false;
26723 }
26724 }
26725 FastErrorResult rv;
26726 // NOTE: This assert does NOT call the function.
26727 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26728 MOZ_KnownLive(self)(self)->PassUnion18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26729 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion18"
)), 0))
) {
26730 return false;
26731 }
26732 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26732); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26732; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26733 args.rval().setUndefined();
26734 return true;
26735}
26736
26737static const JSJitInfo passUnion18_methodinfo = {
26738 { (JSJitGetterOp)passUnion18 },
26739 { prototypes::id::TestJSImplInterface },
26740 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26741 JSJitInfo::Method,
26742 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26743 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26744 false, /* isInfallible. False in setters. */
26745 false, /* isMovable. Not relevant for setters. */
26746 false, /* isEliminatable. Not relevant for setters. */
26747 false, /* isAlwaysInSlot. Only relevant for getters. */
26748 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26749 false, /* isTypedMethod. Only relevant for methods. */
26750 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26751};
26752
26753MOZ_CAN_RUN_SCRIPT static bool
26754passUnion19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26755{
26756 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion19");
26757 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26760( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26758 "TestJSImplInterface", "passUnion19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26760( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26759 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26760( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26760 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26760( cx, "TestJSImplInterface"
, "passUnion19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26761
26762 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26763 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26764 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26765 if (objIsXray) {
26766 unwrappedObj.emplace(cx, obj);
26767 }
26768 Optional<ObjectSequenceOrLong> arg0;
26769 if (args.hasDefined(0)) {
26770 arg0.Construct();
26771 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
26772 return false;
26773 }
26774 }
26775 if (objIsXray) {
26776 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26777 // we know Xrays have no dynamic unwrap behavior.
26778 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26779 if (!unwrappedObj.ref()) {
26780 return false;
26781 }
26782 }
26783 FastErrorResult rv;
26784 // NOTE: This assert does NOT call the function.
26785 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26786 MOZ_KnownLive(self)(self)->PassUnion19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26787 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion19"
)), 0))
) {
26788 return false;
26789 }
26790 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26790); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26790; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26791 args.rval().setUndefined();
26792 return true;
26793}
26794
26795static const JSJitInfo passUnion19_methodinfo = {
26796 { (JSJitGetterOp)passUnion19 },
26797 { prototypes::id::TestJSImplInterface },
26798 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26799 JSJitInfo::Method,
26800 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26801 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26802 false, /* isInfallible. False in setters. */
26803 false, /* isMovable. Not relevant for setters. */
26804 false, /* isEliminatable. Not relevant for setters. */
26805 false, /* isAlwaysInSlot. Only relevant for getters. */
26806 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26807 false, /* isTypedMethod. Only relevant for methods. */
26808 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26809};
26810
26811MOZ_CAN_RUN_SCRIPT static bool
26812passUnion20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26813{
26814 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion20");
26815 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26818( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26816 "TestJSImplInterface", "passUnion20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26818( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26817 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26818( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26818 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26818( cx, "TestJSImplInterface"
, "passUnion20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26819
26820 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26821 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26822 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26823 if (objIsXray) {
26824 unwrappedObj.emplace(cx, obj);
26825 }
26826 ObjectSequenceOrLong arg0;
26827 if (!(args.hasDefined(0))) {
26828 Unused << arg0.RawSetAsObjectSequence(cx);
26829 } else {
26830 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26831 return false;
26832 }
26833 }
26834 if (objIsXray) {
26835 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26836 // we know Xrays have no dynamic unwrap behavior.
26837 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26838 if (!unwrappedObj.ref()) {
26839 return false;
26840 }
26841 }
26842 FastErrorResult rv;
26843 // NOTE: This assert does NOT call the function.
26844 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26845 MOZ_KnownLive(self)(self)->PassUnion20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26846 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion20"
)), 0))
) {
26847 return false;
26848 }
26849 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26849); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26849; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26850 args.rval().setUndefined();
26851 return true;
26852}
26853
26854static const JSJitInfo passUnion20_methodinfo = {
26855 { (JSJitGetterOp)passUnion20 },
26856 { prototypes::id::TestJSImplInterface },
26857 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26858 JSJitInfo::Method,
26859 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26860 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26861 false, /* isInfallible. False in setters. */
26862 false, /* isMovable. Not relevant for setters. */
26863 false, /* isEliminatable. Not relevant for setters. */
26864 false, /* isAlwaysInSlot. Only relevant for getters. */
26865 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26866 false, /* isTypedMethod. Only relevant for methods. */
26867 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26868};
26869
26870MOZ_CAN_RUN_SCRIPT static bool
26871passUnion21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26872{
26873 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion21");
26874 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26877( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26875 "TestJSImplInterface", "passUnion21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26877( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26876 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26877( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26877 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26877( cx, "TestJSImplInterface"
, "passUnion21", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26878
26879 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26880 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion21", 1)) {
26881 return false;
26882 }
26883 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26884 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26885 if (objIsXray) {
26886 unwrappedObj.emplace(cx, obj);
26887 }
26888 StringLongRecordOrLong arg0;
26889 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26890 return false;
26891 }
26892 if (objIsXray) {
26893 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26894 // we know Xrays have no dynamic unwrap behavior.
26895 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26896 if (!unwrappedObj.ref()) {
26897 return false;
26898 }
26899 }
26900 FastErrorResult rv;
26901 // NOTE: This assert does NOT call the function.
26902 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26903 MOZ_KnownLive(self)(self)->PassUnion21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26904 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion21"
)), 0))
) {
26905 return false;
26906 }
26907 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26907); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26907; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26908 args.rval().setUndefined();
26909 return true;
26910}
26911
26912static const JSJitInfo passUnion21_methodinfo = {
26913 { (JSJitGetterOp)passUnion21 },
26914 { prototypes::id::TestJSImplInterface },
26915 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26916 JSJitInfo::Method,
26917 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26918 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26919 false, /* isInfallible. False in setters. */
26920 false, /* isMovable. Not relevant for setters. */
26921 false, /* isEliminatable. Not relevant for setters. */
26922 false, /* isAlwaysInSlot. Only relevant for getters. */
26923 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26924 false, /* isTypedMethod. Only relevant for methods. */
26925 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26926};
26927
26928MOZ_CAN_RUN_SCRIPT static bool
26929passUnion22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26930{
26931 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion22");
26932 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26935( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26933 "TestJSImplInterface", "passUnion22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26935( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26934 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26935( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26935 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26935( cx, "TestJSImplInterface"
, "passUnion22", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26936
26937 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26938 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion22", 1)) {
26939 return false;
26940 }
26941 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
26942 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
26943 if (objIsXray) {
26944 unwrappedObj.emplace(cx, obj);
26945 }
26946 StringObjectRecordOrLong arg0;
26947 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
26948 return false;
26949 }
26950 if (objIsXray) {
26951 // Since our object is an Xray, we can just CheckedUnwrapStatic:
26952 // we know Xrays have no dynamic unwrap behavior.
26953 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
26954 if (!unwrappedObj.ref()) {
26955 return false;
26956 }
26957 }
26958 FastErrorResult rv;
26959 // NOTE: This assert does NOT call the function.
26960 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
26961 MOZ_KnownLive(self)(self)->PassUnion22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
26962 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion22"
)), 0))
) {
26963 return false;
26964 }
26965 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 26965); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 26965; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
26966 args.rval().setUndefined();
26967 return true;
26968}
26969
26970static const JSJitInfo passUnion22_methodinfo = {
26971 { (JSJitGetterOp)passUnion22 },
26972 { prototypes::id::TestJSImplInterface },
26973 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
26974 JSJitInfo::Method,
26975 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
26976 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
26977 false, /* isInfallible. False in setters. */
26978 false, /* isMovable. Not relevant for setters. */
26979 false, /* isEliminatable. Not relevant for setters. */
26980 false, /* isAlwaysInSlot. Only relevant for getters. */
26981 false, /* isLazilyCachedInSlot. Only relevant for getters. */
26982 false, /* isTypedMethod. Only relevant for methods. */
26983 0 /* Reserved slot index, if we're stored in a slot, else 0. */
26984};
26985
26986MOZ_CAN_RUN_SCRIPT static bool
26987passUnion23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
26988{
26989 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion23");
26990 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject26993( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26991 "TestJSImplInterface", "passUnion23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject26993( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26992 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject26993( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
26993 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject26993( cx, "TestJSImplInterface"
, "passUnion23", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
26994
26995 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
26996 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion23", 1)) {
26997 return false;
26998 }
26999 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27000 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27001 if (objIsXray) {
27002 unwrappedObj.emplace(cx, obj);
27003 }
27004 ImageDataSequenceOrLong arg0;
27005 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27006 return false;
27007 }
27008 if (objIsXray) {
27009 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27010 // we know Xrays have no dynamic unwrap behavior.
27011 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27012 if (!unwrappedObj.ref()) {
27013 return false;
27014 }
27015 }
27016 FastErrorResult rv;
27017 // NOTE: This assert does NOT call the function.
27018 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27019 MOZ_KnownLive(self)(self)->PassUnion23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27020 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion23"
)), 0))
) {
27021 return false;
27022 }
27023 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27023); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27023; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27024 args.rval().setUndefined();
27025 return true;
27026}
27027
27028static const JSJitInfo passUnion23_methodinfo = {
27029 { (JSJitGetterOp)passUnion23 },
27030 { prototypes::id::TestJSImplInterface },
27031 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27032 JSJitInfo::Method,
27033 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27034 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27035 false, /* isInfallible. False in setters. */
27036 false, /* isMovable. Not relevant for setters. */
27037 false, /* isEliminatable. Not relevant for setters. */
27038 false, /* isAlwaysInSlot. Only relevant for getters. */
27039 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27040 false, /* isTypedMethod. Only relevant for methods. */
27041 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27042};
27043
27044MOZ_CAN_RUN_SCRIPT static bool
27045passUnion24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27046{
27047 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion24");
27048 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27051( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27049 "TestJSImplInterface", "passUnion24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27051( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27050 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27051( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27051 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27051( cx, "TestJSImplInterface"
, "passUnion24", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27052
27053 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27054 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion24", 1)) {
27055 return false;
27056 }
27057 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27058 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27059 if (objIsXray) {
27060 unwrappedObj.emplace(cx, obj);
27061 }
27062 ImageDataOrNullSequenceOrLong arg0;
27063 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27064 return false;
27065 }
27066 if (objIsXray) {
27067 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27068 // we know Xrays have no dynamic unwrap behavior.
27069 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27070 if (!unwrappedObj.ref()) {
27071 return false;
27072 }
27073 }
27074 FastErrorResult rv;
27075 // NOTE: This assert does NOT call the function.
27076 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27077 MOZ_KnownLive(self)(self)->PassUnion24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27078 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion24"
)), 0))
) {
27079 return false;
27080 }
27081 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27081); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27081; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27082 args.rval().setUndefined();
27083 return true;
27084}
27085
27086static const JSJitInfo passUnion24_methodinfo = {
27087 { (JSJitGetterOp)passUnion24 },
27088 { prototypes::id::TestJSImplInterface },
27089 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27090 JSJitInfo::Method,
27091 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27092 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27093 false, /* isInfallible. False in setters. */
27094 false, /* isMovable. Not relevant for setters. */
27095 false, /* isEliminatable. Not relevant for setters. */
27096 false, /* isAlwaysInSlot. Only relevant for getters. */
27097 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27098 false, /* isTypedMethod. Only relevant for methods. */
27099 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27100};
27101
27102MOZ_CAN_RUN_SCRIPT static bool
27103passUnion25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27104{
27105 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion25");
27106 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27109( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27107 "TestJSImplInterface", "passUnion25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27109( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27108 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27109( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27109 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27109( cx, "TestJSImplInterface"
, "passUnion25", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27110
27111 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27112 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion25", 1)) {
27113 return false;
27114 }
27115 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27116 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27117 if (objIsXray) {
27118 unwrappedObj.emplace(cx, obj);
27119 }
27120 ImageDataSequenceSequenceOrLong arg0;
27121 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27122 return false;
27123 }
27124 if (objIsXray) {
27125 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27126 // we know Xrays have no dynamic unwrap behavior.
27127 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27128 if (!unwrappedObj.ref()) {
27129 return false;
27130 }
27131 }
27132 FastErrorResult rv;
27133 // NOTE: This assert does NOT call the function.
27134 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27135 MOZ_KnownLive(self)(self)->PassUnion25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27136 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion25"
)), 0))
) {
27137 return false;
27138 }
27139 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27139); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27139; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27140 args.rval().setUndefined();
27141 return true;
27142}
27143
27144static const JSJitInfo passUnion25_methodinfo = {
27145 { (JSJitGetterOp)passUnion25 },
27146 { prototypes::id::TestJSImplInterface },
27147 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27148 JSJitInfo::Method,
27149 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27150 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27151 false, /* isInfallible. False in setters. */
27152 false, /* isMovable. Not relevant for setters. */
27153 false, /* isEliminatable. Not relevant for setters. */
27154 false, /* isAlwaysInSlot. Only relevant for getters. */
27155 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27156 false, /* isTypedMethod. Only relevant for methods. */
27157 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27158};
27159
27160MOZ_CAN_RUN_SCRIPT static bool
27161passUnion26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27162{
27163 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion26");
27164 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27167( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27165 "TestJSImplInterface", "passUnion26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27167( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27166 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27167( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27167 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27167( cx, "TestJSImplInterface"
, "passUnion26", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27168
27169 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27170 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnion26", 1)) {
27171 return false;
27172 }
27173 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27174 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27175 if (objIsXray) {
27176 unwrappedObj.emplace(cx, obj);
27177 }
27178 ImageDataOrNullSequenceSequenceOrLong arg0;
27179 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27180 return false;
27181 }
27182 if (objIsXray) {
27183 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27184 // we know Xrays have no dynamic unwrap behavior.
27185 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27186 if (!unwrappedObj.ref()) {
27187 return false;
27188 }
27189 }
27190 FastErrorResult rv;
27191 // NOTE: This assert does NOT call the function.
27192 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27193 MOZ_KnownLive(self)(self)->PassUnion26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27194 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion26"
)), 0))
) {
27195 return false;
27196 }
27197 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27197); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27197; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27198 args.rval().setUndefined();
27199 return true;
27200}
27201
27202static const JSJitInfo passUnion26_methodinfo = {
27203 { (JSJitGetterOp)passUnion26 },
27204 { prototypes::id::TestJSImplInterface },
27205 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27206 JSJitInfo::Method,
27207 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27208 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27209 false, /* isInfallible. False in setters. */
27210 false, /* isMovable. Not relevant for setters. */
27211 false, /* isEliminatable. Not relevant for setters. */
27212 false, /* isAlwaysInSlot. Only relevant for getters. */
27213 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27214 false, /* isTypedMethod. Only relevant for methods. */
27215 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27216};
27217
27218MOZ_CAN_RUN_SCRIPT static bool
27219passUnion27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27220{
27221 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion27");
27222 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27225( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27223 "TestJSImplInterface", "passUnion27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27225( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27224 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27225( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27225 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27225( cx, "TestJSImplInterface"
, "passUnion27", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27226
27227 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27228 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27229 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27230 if (objIsXray) {
27231 unwrappedObj.emplace(cx, obj);
27232 }
27233 StringSequenceOrEventInit arg0;
27234 if (!(args.hasDefined(0))) {
27235 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (sequence<DOMString> or EventInit)")) {
27236 return false;
27237 }
27238 } else {
27239 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27240 return false;
27241 }
27242 }
27243 if (objIsXray) {
27244 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27245 // we know Xrays have no dynamic unwrap behavior.
27246 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27247 if (!unwrappedObj.ref()) {
27248 return false;
27249 }
27250 }
27251 FastErrorResult rv;
27252 // NOTE: This assert does NOT call the function.
27253 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27254 MOZ_KnownLive(self)(self)->PassUnion27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27255 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion27"
)), 0))
) {
27256 return false;
27257 }
27258 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27258); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27258; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27259 args.rval().setUndefined();
27260 return true;
27261}
27262
27263static const JSJitInfo passUnion27_methodinfo = {
27264 { (JSJitGetterOp)passUnion27 },
27265 { prototypes::id::TestJSImplInterface },
27266 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27267 JSJitInfo::Method,
27268 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27269 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27270 false, /* isInfallible. False in setters. */
27271 false, /* isMovable. Not relevant for setters. */
27272 false, /* isEliminatable. Not relevant for setters. */
27273 false, /* isAlwaysInSlot. Only relevant for getters. */
27274 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27275 false, /* isTypedMethod. Only relevant for methods. */
27276 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27277};
27278
27279MOZ_CAN_RUN_SCRIPT static bool
27280passUnion28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27281{
27282 BindingCallContext cx(cx_, "TestJSImplInterface.passUnion28");
27283 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27286( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27284 "TestJSImplInterface", "passUnion28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27286( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27285 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27286( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27286 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27286( cx, "TestJSImplInterface"
, "passUnion28", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27287
27288 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27289 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27290 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27291 if (objIsXray) {
27292 unwrappedObj.emplace(cx, obj);
27293 }
27294 EventInitOrStringSequence arg0;
27295 if (!(args.hasDefined(0))) {
27296 if (!arg0.RawSetAsEventInit().Init(cx, JS::NullHandleValue, "Member of (EventInit or sequence<DOMString>)")) {
27297 return false;
27298 }
27299 } else {
27300 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27301 return false;
27302 }
27303 }
27304 if (objIsXray) {
27305 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27306 // we know Xrays have no dynamic unwrap behavior.
27307 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27308 if (!unwrappedObj.ref()) {
27309 return false;
27310 }
27311 }
27312 FastErrorResult rv;
27313 // NOTE: This assert does NOT call the function.
27314 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27315 MOZ_KnownLive(self)(self)->PassUnion28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnion28"
)), 0))
) {
27317 return false;
27318 }
27319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27319; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27320 args.rval().setUndefined();
27321 return true;
27322}
27323
27324static const JSJitInfo passUnion28_methodinfo = {
27325 { (JSJitGetterOp)passUnion28 },
27326 { prototypes::id::TestJSImplInterface },
27327 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27328 JSJitInfo::Method,
27329 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27330 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27331 false, /* isInfallible. False in setters. */
27332 false, /* isMovable. Not relevant for setters. */
27333 false, /* isEliminatable. Not relevant for setters. */
27334 false, /* isAlwaysInSlot. Only relevant for getters. */
27335 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27336 false, /* isTypedMethod. Only relevant for methods. */
27337 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27338};
27339
27340MOZ_CAN_RUN_SCRIPT static bool
27341passUnionWithCallback(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27342{
27343 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithCallback");
27344 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27347( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27345 "TestJSImplInterface", "passUnionWithCallback", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27347( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27346 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27347( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27347 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27347( cx, "TestJSImplInterface"
, "passUnionWithCallback", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27348
27349 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27350 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithCallback", 1)) {
27351 return false;
27352 }
27353 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27354 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27355 if (objIsXray) {
27356 unwrappedObj.emplace(cx, obj);
27357 }
27358 EventHandlerNonNullOrNullOrLong arg0;
27359 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27360 return false;
27361 }
27362 if (objIsXray) {
27363 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27364 // we know Xrays have no dynamic unwrap behavior.
27365 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27366 if (!unwrappedObj.ref()) {
27367 return false;
27368 }
27369 }
27370 FastErrorResult rv;
27371 // NOTE: This assert does NOT call the function.
27372 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27373 MOZ_KnownLive(self)(self)->PassUnionWithCallback(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27374 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithCallback"
)), 0))
) {
27375 return false;
27376 }
27377 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27377); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27377; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27378 args.rval().setUndefined();
27379 return true;
27380}
27381
27382static const JSJitInfo passUnionWithCallback_methodinfo = {
27383 { (JSJitGetterOp)passUnionWithCallback },
27384 { prototypes::id::TestJSImplInterface },
27385 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27386 JSJitInfo::Method,
27387 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27388 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27389 false, /* isInfallible. False in setters. */
27390 false, /* isMovable. Not relevant for setters. */
27391 false, /* isEliminatable. Not relevant for setters. */
27392 false, /* isAlwaysInSlot. Only relevant for getters. */
27393 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27394 false, /* isTypedMethod. Only relevant for methods. */
27395 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27396};
27397
27398MOZ_CAN_RUN_SCRIPT static bool
27399passUnionWithByteString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27400{
27401 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithByteString");
27402 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27405( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27403 "TestJSImplInterface", "passUnionWithByteString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27405( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27404 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27405( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27405 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27405( cx, "TestJSImplInterface"
, "passUnionWithByteString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27406
27407 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27408 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithByteString", 1)) {
27409 return false;
27410 }
27411 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27412 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27413 if (objIsXray) {
27414 unwrappedObj.emplace(cx, obj);
27415 }
27416 ByteStringOrLong arg0;
27417 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27418 return false;
27419 }
27420 if (objIsXray) {
27421 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27422 // we know Xrays have no dynamic unwrap behavior.
27423 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27424 if (!unwrappedObj.ref()) {
27425 return false;
27426 }
27427 }
27428 FastErrorResult rv;
27429 // NOTE: This assert does NOT call the function.
27430 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27431 MOZ_KnownLive(self)(self)->PassUnionWithByteString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27432 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithByteString"
)), 0))
) {
27433 return false;
27434 }
27435 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27435); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27435; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27436 args.rval().setUndefined();
27437 return true;
27438}
27439
27440static const JSJitInfo passUnionWithByteString_methodinfo = {
27441 { (JSJitGetterOp)passUnionWithByteString },
27442 { prototypes::id::TestJSImplInterface },
27443 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27444 JSJitInfo::Method,
27445 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27446 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27447 false, /* isInfallible. False in setters. */
27448 false, /* isMovable. Not relevant for setters. */
27449 false, /* isEliminatable. Not relevant for setters. */
27450 false, /* isAlwaysInSlot. Only relevant for getters. */
27451 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27452 false, /* isTypedMethod. Only relevant for methods. */
27453 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27454};
27455
27456MOZ_CAN_RUN_SCRIPT static bool
27457passUnionWithUTF8String(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27458{
27459 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithUTF8String");
27460 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27463( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27461 "TestJSImplInterface", "passUnionWithUTF8String", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27463( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27462 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27463( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27463 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27463( cx, "TestJSImplInterface"
, "passUnionWithUTF8String", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27464
27465 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27466 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithUTF8String", 1)) {
27467 return false;
27468 }
27469 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27470 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27471 if (objIsXray) {
27472 unwrappedObj.emplace(cx, obj);
27473 }
27474 UTF8StringOrLong arg0;
27475 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27476 return false;
27477 }
27478 if (objIsXray) {
27479 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27480 // we know Xrays have no dynamic unwrap behavior.
27481 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27482 if (!unwrappedObj.ref()) {
27483 return false;
27484 }
27485 }
27486 FastErrorResult rv;
27487 // NOTE: This assert does NOT call the function.
27488 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27489 MOZ_KnownLive(self)(self)->PassUnionWithUTF8String(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27490 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithUTF8String"
)), 0))
) {
27491 return false;
27492 }
27493 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27493; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27494 args.rval().setUndefined();
27495 return true;
27496}
27497
27498static const JSJitInfo passUnionWithUTF8String_methodinfo = {
27499 { (JSJitGetterOp)passUnionWithUTF8String },
27500 { prototypes::id::TestJSImplInterface },
27501 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27502 JSJitInfo::Method,
27503 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27504 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27505 false, /* isInfallible. False in setters. */
27506 false, /* isMovable. Not relevant for setters. */
27507 false, /* isEliminatable. Not relevant for setters. */
27508 false, /* isAlwaysInSlot. Only relevant for getters. */
27509 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27510 false, /* isTypedMethod. Only relevant for methods. */
27511 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27512};
27513
27514MOZ_CAN_RUN_SCRIPT static bool
27515passUnionWithRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27516{
27517 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecord");
27518 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27521( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27519 "TestJSImplInterface", "passUnionWithRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27521( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27520 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27521( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27521 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27521( cx, "TestJSImplInterface"
, "passUnionWithRecord", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27522
27523 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27524 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecord", 1)) {
27525 return false;
27526 }
27527 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27528 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27529 if (objIsXray) {
27530 unwrappedObj.emplace(cx, obj);
27531 }
27532 StringStringRecordOrString arg0;
27533 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27534 return false;
27535 }
27536 if (objIsXray) {
27537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27538 // we know Xrays have no dynamic unwrap behavior.
27539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27540 if (!unwrappedObj.ref()) {
27541 return false;
27542 }
27543 }
27544 FastErrorResult rv;
27545 // NOTE: This assert does NOT call the function.
27546 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27547 MOZ_KnownLive(self)(self)->PassUnionWithRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecord"
)), 0))
) {
27549 return false;
27550 }
27551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27551; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27552 args.rval().setUndefined();
27553 return true;
27554}
27555
27556static const JSJitInfo passUnionWithRecord_methodinfo = {
27557 { (JSJitGetterOp)passUnionWithRecord },
27558 { prototypes::id::TestJSImplInterface },
27559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27560 JSJitInfo::Method,
27561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27563 false, /* isInfallible. False in setters. */
27564 false, /* isMovable. Not relevant for setters. */
27565 false, /* isEliminatable. Not relevant for setters. */
27566 false, /* isAlwaysInSlot. Only relevant for getters. */
27567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27568 false, /* isTypedMethod. Only relevant for methods. */
27569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27570};
27571
27572MOZ_CAN_RUN_SCRIPT static bool
27573passUnionWithRecordAndSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27574{
27575 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithRecordAndSequence");
27576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27579( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27577 "TestJSImplInterface", "passUnionWithRecordAndSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27579( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27579( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27579( cx, "TestJSImplInterface"
, "passUnionWithRecordAndSequence", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27580
27581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27582 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithRecordAndSequence", 1)) {
27583 return false;
27584 }
27585 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27586 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27587 if (objIsXray) {
27588 unwrappedObj.emplace(cx, obj);
27589 }
27590 StringStringRecordOrStringSequence arg0;
27591 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27592 return false;
27593 }
27594 if (objIsXray) {
27595 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27596 // we know Xrays have no dynamic unwrap behavior.
27597 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27598 if (!unwrappedObj.ref()) {
27599 return false;
27600 }
27601 }
27602 FastErrorResult rv;
27603 // NOTE: This assert does NOT call the function.
27604 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27605 MOZ_KnownLive(self)(self)->PassUnionWithRecordAndSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27606 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithRecordAndSequence"
)), 0))
) {
27607 return false;
27608 }
27609 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27609); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27609; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27610 args.rval().setUndefined();
27611 return true;
27612}
27613
27614static const JSJitInfo passUnionWithRecordAndSequence_methodinfo = {
27615 { (JSJitGetterOp)passUnionWithRecordAndSequence },
27616 { prototypes::id::TestJSImplInterface },
27617 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27618 JSJitInfo::Method,
27619 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27620 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27621 false, /* isInfallible. False in setters. */
27622 false, /* isMovable. Not relevant for setters. */
27623 false, /* isEliminatable. Not relevant for setters. */
27624 false, /* isAlwaysInSlot. Only relevant for getters. */
27625 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27626 false, /* isTypedMethod. Only relevant for methods. */
27627 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27628};
27629
27630MOZ_CAN_RUN_SCRIPT static bool
27631passUnionWithSequenceAndRecord(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27632{
27633 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSequenceAndRecord");
27634 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27637( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27635 "TestJSImplInterface", "passUnionWithSequenceAndRecord", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27637( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27636 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27637( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27637 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27637( cx, "TestJSImplInterface"
, "passUnionWithSequenceAndRecord", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27638
27639 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27640 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord", 1)) {
27641 return false;
27642 }
27643 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27644 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27645 if (objIsXray) {
27646 unwrappedObj.emplace(cx, obj);
27647 }
27648 StringSequenceOrStringStringRecord arg0;
27649 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27650 return false;
27651 }
27652 if (objIsXray) {
27653 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27654 // we know Xrays have no dynamic unwrap behavior.
27655 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27656 if (!unwrappedObj.ref()) {
27657 return false;
27658 }
27659 }
27660 FastErrorResult rv;
27661 // NOTE: This assert does NOT call the function.
27662 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27663 MOZ_KnownLive(self)(self)->PassUnionWithSequenceAndRecord(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27664 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSequenceAndRecord"
)), 0))
) {
27665 return false;
27666 }
27667 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27667); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27667; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27668 args.rval().setUndefined();
27669 return true;
27670}
27671
27672static const JSJitInfo passUnionWithSequenceAndRecord_methodinfo = {
27673 { (JSJitGetterOp)passUnionWithSequenceAndRecord },
27674 { prototypes::id::TestJSImplInterface },
27675 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27676 JSJitInfo::Method,
27677 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27678 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27679 false, /* isInfallible. False in setters. */
27680 false, /* isMovable. Not relevant for setters. */
27681 false, /* isEliminatable. Not relevant for setters. */
27682 false, /* isAlwaysInSlot. Only relevant for getters. */
27683 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27684 false, /* isTypedMethod. Only relevant for methods. */
27685 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27686};
27687
27688MOZ_CAN_RUN_SCRIPT static bool
27689passUnionWithSVS(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27690{
27691 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithSVS");
27692 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27695( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27693 "TestJSImplInterface", "passUnionWithSVS", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27695( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27694 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27695( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27695 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27695( cx, "TestJSImplInterface"
, "passUnionWithSVS", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27696
27697 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27698 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithSVS", 1)) {
27699 return false;
27700 }
27701 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27702 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27703 if (objIsXray) {
27704 unwrappedObj.emplace(cx, obj);
27705 }
27706 USVStringOrLong arg0;
27707 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27708 return false;
27709 }
27710 if (objIsXray) {
27711 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27712 // we know Xrays have no dynamic unwrap behavior.
27713 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27714 if (!unwrappedObj.ref()) {
27715 return false;
27716 }
27717 }
27718 FastErrorResult rv;
27719 // NOTE: This assert does NOT call the function.
27720 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27721 MOZ_KnownLive(self)(self)->PassUnionWithSVS(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27722 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithSVS"
)), 0))
) {
27723 return false;
27724 }
27725 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27725); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27725; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27726 args.rval().setUndefined();
27727 return true;
27728}
27729
27730static const JSJitInfo passUnionWithSVS_methodinfo = {
27731 { (JSJitGetterOp)passUnionWithSVS },
27732 { prototypes::id::TestJSImplInterface },
27733 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27734 JSJitInfo::Method,
27735 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27736 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27737 false, /* isInfallible. False in setters. */
27738 false, /* isMovable. Not relevant for setters. */
27739 false, /* isEliminatable. Not relevant for setters. */
27740 false, /* isAlwaysInSlot. Only relevant for getters. */
27741 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27742 false, /* isTypedMethod. Only relevant for methods. */
27743 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27744};
27745
27746MOZ_CAN_RUN_SCRIPT static bool
27747passUnionWithNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27748{
27749 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithNullable");
27750 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27753( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27751 "TestJSImplInterface", "passUnionWithNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27753( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27752 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27753( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27753 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27753( cx, "TestJSImplInterface"
, "passUnionWithNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27754
27755 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27756 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithNullable", 1)) {
27757 return false;
27758 }
27759 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27760 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27761 if (objIsXray) {
27762 unwrappedObj.emplace(cx, obj);
27763 }
27764 ObjectOrNullOrLong arg0;
27765 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
27766 return false;
27767 }
27768 if (objIsXray) {
27769 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27770 // we know Xrays have no dynamic unwrap behavior.
27771 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27772 if (!unwrappedObj.ref()) {
27773 return false;
27774 }
27775 }
27776 FastErrorResult rv;
27777 // NOTE: This assert does NOT call the function.
27778 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27779 MOZ_KnownLive(self)(self)->PassUnionWithNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27780 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithNullable"
)), 0))
) {
27781 return false;
27782 }
27783 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27783); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27783; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27784 args.rval().setUndefined();
27785 return true;
27786}
27787
27788static const JSJitInfo passUnionWithNullable_methodinfo = {
27789 { (JSJitGetterOp)passUnionWithNullable },
27790 { prototypes::id::TestJSImplInterface },
27791 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27792 JSJitInfo::Method,
27793 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27794 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27795 false, /* isInfallible. False in setters. */
27796 false, /* isMovable. Not relevant for setters. */
27797 false, /* isEliminatable. Not relevant for setters. */
27798 false, /* isAlwaysInSlot. Only relevant for getters. */
27799 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27800 false, /* isTypedMethod. Only relevant for methods. */
27801 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27802};
27803
27804MOZ_CAN_RUN_SCRIPT static bool
27805passNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27806{
27807 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnion");
27808 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27811( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27809 "TestJSImplInterface", "passNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27811( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27810 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27811( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27811 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27811( cx, "TestJSImplInterface"
, "passNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27812
27813 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27814 if (!args.requireAtLeast(cx, "TestJSImplInterface.passNullableUnion", 1)) {
27815 return false;
27816 }
27817 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27818 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27819 if (objIsXray) {
27820 unwrappedObj.emplace(cx, obj);
27821 }
27822 Nullable<ObjectOrLong > arg0;
27823 if (args[0].isNullOrUndefined()) {
27824 arg0.SetNull();
27825 } else {
27826 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
27827 return false;
27828 }
27829 }
27830 if (objIsXray) {
27831 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27832 // we know Xrays have no dynamic unwrap behavior.
27833 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27834 if (!unwrappedObj.ref()) {
27835 return false;
27836 }
27837 }
27838 FastErrorResult rv;
27839 // NOTE: This assert does NOT call the function.
27840 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27841 MOZ_KnownLive(self)(self)->PassNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27842 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnion"
)), 0))
) {
27843 return false;
27844 }
27845 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27845); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27845; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27846 args.rval().setUndefined();
27847 return true;
27848}
27849
27850static const JSJitInfo passNullableUnion_methodinfo = {
27851 { (JSJitGetterOp)passNullableUnion },
27852 { prototypes::id::TestJSImplInterface },
27853 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27854 JSJitInfo::Method,
27855 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27856 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27857 false, /* isInfallible. False in setters. */
27858 false, /* isMovable. Not relevant for setters. */
27859 false, /* isEliminatable. Not relevant for setters. */
27860 false, /* isAlwaysInSlot. Only relevant for getters. */
27861 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27862 false, /* isTypedMethod. Only relevant for methods. */
27863 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27864};
27865
27866MOZ_CAN_RUN_SCRIPT static bool
27867passOptionalUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27868{
27869 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalUnion");
27870 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27873( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27871 "TestJSImplInterface", "passOptionalUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27873( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27872 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27873( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
27873 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27873( cx, "TestJSImplInterface"
, "passOptionalUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
27874
27875 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27876 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27877 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27878 if (objIsXray) {
27879 unwrappedObj.emplace(cx, obj);
27880 }
27881 Optional<ObjectOrLong> arg0;
27882 if (args.hasDefined(0)) {
27883 arg0.Construct();
27884 if (!arg0.Value().Init(cx, args[0], "Argument 1", true)) {
27885 return false;
27886 }
27887 }
27888 if (objIsXray) {
27889 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27890 // we know Xrays have no dynamic unwrap behavior.
27891 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27892 if (!unwrappedObj.ref()) {
27893 return false;
27894 }
27895 }
27896 FastErrorResult rv;
27897 // NOTE: This assert does NOT call the function.
27898 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27899 MOZ_KnownLive(self)(self)->PassOptionalUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27900 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalUnion"
)), 0))
) {
27901 return false;
27902 }
27903 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27903); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27903; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27904 args.rval().setUndefined();
27905 return true;
27906}
27907
27908static const JSJitInfo passOptionalUnion_methodinfo = {
27909 { (JSJitGetterOp)passOptionalUnion },
27910 { prototypes::id::TestJSImplInterface },
27911 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27912 JSJitInfo::Method,
27913 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27914 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27915 false, /* isInfallible. False in setters. */
27916 false, /* isMovable. Not relevant for setters. */
27917 false, /* isEliminatable. Not relevant for setters. */
27918 false, /* isAlwaysInSlot. Only relevant for getters. */
27919 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27920 false, /* isTypedMethod. Only relevant for methods. */
27921 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27922};
27923
27924MOZ_CAN_RUN_SCRIPT static bool
27925passOptionalNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27926{
27927 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnion");
27928 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27931( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27929 "TestJSImplInterface", "passOptionalNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27931( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27930 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27931( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27931 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27931( cx, "TestJSImplInterface"
, "passOptionalNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27932
27933 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27934 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27935 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27936 if (objIsXray) {
27937 unwrappedObj.emplace(cx, obj);
27938 }
27939 Optional<Nullable<ObjectOrLong >> arg0;
27940 if (args.hasDefined(0)) {
27941 arg0.Construct();
27942 if (args[0].isNullOrUndefined()) {
27943 arg0.Value().SetNull();
27944 } else {
27945 if (!arg0.Value().SetValue().Init(cx, args[0], "Argument 1", true)) {
27946 return false;
27947 }
27948 }
27949 }
27950 if (objIsXray) {
27951 // Since our object is an Xray, we can just CheckedUnwrapStatic:
27952 // we know Xrays have no dynamic unwrap behavior.
27953 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
27954 if (!unwrappedObj.ref()) {
27955 return false;
27956 }
27957 }
27958 FastErrorResult rv;
27959 // NOTE: This assert does NOT call the function.
27960 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
27961 MOZ_KnownLive(self)(self)->PassOptionalNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
27962 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnion"
)), 0))
) {
27963 return false;
27964 }
27965 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 27965); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 27965; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
27966 args.rval().setUndefined();
27967 return true;
27968}
27969
27970static const JSJitInfo passOptionalNullableUnion_methodinfo = {
27971 { (JSJitGetterOp)passOptionalNullableUnion },
27972 { prototypes::id::TestJSImplInterface },
27973 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
27974 JSJitInfo::Method,
27975 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
27976 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
27977 false, /* isInfallible. False in setters. */
27978 false, /* isMovable. Not relevant for setters. */
27979 false, /* isEliminatable. Not relevant for setters. */
27980 false, /* isAlwaysInSlot. Only relevant for getters. */
27981 false, /* isLazilyCachedInSlot. Only relevant for getters. */
27982 false, /* isTypedMethod. Only relevant for methods. */
27983 0 /* Reserved slot index, if we're stored in a slot, else 0. */
27984};
27985
27986MOZ_CAN_RUN_SCRIPT static bool
27987passOptionalNullableUnionWithDefaultValue(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
27988{
27989 BindingCallContext cx(cx_, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue");
27990 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject27993( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27991 "TestJSImplInterface", "passOptionalNullableUnionWithDefaultValue", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject27993( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27992 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject27993( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
27993 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject27993( cx, "TestJSImplInterface"
, "passOptionalNullableUnionWithDefaultValue", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
27994
27995 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
27996 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
27997 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
27998 if (objIsXray) {
27999 unwrappedObj.emplace(cx, obj);
28000 }
28001 Nullable<ObjectOrLong > arg0;
28002 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
28003 arg0.SetNull();
28004 } else {
28005 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
28006 return false;
28007 }
28008 }
28009 if (objIsXray) {
28010 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28011 // we know Xrays have no dynamic unwrap behavior.
28012 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28013 if (!unwrappedObj.ref()) {
28014 return false;
28015 }
28016 }
28017 FastErrorResult rv;
28018 // NOTE: This assert does NOT call the function.
28019 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28020 MOZ_KnownLive(self)(self)->PassOptionalNullableUnionWithDefaultValue(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28021 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue"
)), 0))
) {
28022 return false;
28023 }
28024 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28024); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28024; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28025 args.rval().setUndefined();
28026 return true;
28027}
28028
28029static const JSJitInfo passOptionalNullableUnionWithDefaultValue_methodinfo = {
28030 { (JSJitGetterOp)passOptionalNullableUnionWithDefaultValue },
28031 { prototypes::id::TestJSImplInterface },
28032 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28033 JSJitInfo::Method,
28034 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28035 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28036 false, /* isInfallible. False in setters. */
28037 false, /* isMovable. Not relevant for setters. */
28038 false, /* isEliminatable. Not relevant for setters. */
28039 false, /* isAlwaysInSlot. Only relevant for getters. */
28040 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28041 false, /* isTypedMethod. Only relevant for methods. */
28042 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28043};
28044
28045MOZ_CAN_RUN_SCRIPT static bool
28046passUnionWithArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28047{
28048 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBuffer");
28049 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28052( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28050 "TestJSImplInterface", "passUnionWithArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28052( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28051 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28052( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28052 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28052( cx, "TestJSImplInterface"
, "passUnionWithArrayBuffer", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28053
28054 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28055 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBuffer", 1)) {
28056 return false;
28057 }
28058 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28059 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28060 if (objIsXray) {
28061 unwrappedObj.emplace(cx, obj);
28062 }
28063 UTF8StringOrArrayBuffer arg0;
28064 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28065 return false;
28066 }
28067 if (objIsXray) {
28068 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28069 // we know Xrays have no dynamic unwrap behavior.
28070 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28071 if (!unwrappedObj.ref()) {
28072 return false;
28073 }
28074 }
28075 FastErrorResult rv;
28076 // NOTE: This assert does NOT call the function.
28077 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28078 MOZ_KnownLive(self)(self)->PassUnionWithArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28079 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBuffer"
)), 0))
) {
28080 return false;
28081 }
28082 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28082; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28083 args.rval().setUndefined();
28084 return true;
28085}
28086
28087static const JSJitInfo passUnionWithArrayBuffer_methodinfo = {
28088 { (JSJitGetterOp)passUnionWithArrayBuffer },
28089 { prototypes::id::TestJSImplInterface },
28090 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28091 JSJitInfo::Method,
28092 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28093 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28094 false, /* isInfallible. False in setters. */
28095 false, /* isMovable. Not relevant for setters. */
28096 false, /* isEliminatable. Not relevant for setters. */
28097 false, /* isAlwaysInSlot. Only relevant for getters. */
28098 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28099 false, /* isTypedMethod. Only relevant for methods. */
28100 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28101};
28102
28103MOZ_CAN_RUN_SCRIPT static bool
28104passUnionWithArrayBufferOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28105{
28106 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithArrayBufferOrNull");
28107 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28110( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28108 "TestJSImplInterface", "passUnionWithArrayBufferOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28110( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28109 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28110( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28110 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28110( cx, "TestJSImplInterface"
, "passUnionWithArrayBufferOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28111
28112 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28113 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull", 1)) {
28114 return false;
28115 }
28116 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28117 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28118 if (objIsXray) {
28119 unwrappedObj.emplace(cx, obj);
28120 }
28121 UTF8StringOrArrayBufferOrNull arg0;
28122 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28123 return false;
28124 }
28125 if (objIsXray) {
28126 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28127 // we know Xrays have no dynamic unwrap behavior.
28128 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28129 if (!unwrappedObj.ref()) {
28130 return false;
28131 }
28132 }
28133 FastErrorResult rv;
28134 // NOTE: This assert does NOT call the function.
28135 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28136 MOZ_KnownLive(self)(self)->PassUnionWithArrayBufferOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28137 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithArrayBufferOrNull"
)), 0))
) {
28138 return false;
28139 }
28140 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28140; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28141 args.rval().setUndefined();
28142 return true;
28143}
28144
28145static const JSJitInfo passUnionWithArrayBufferOrNull_methodinfo = {
28146 { (JSJitGetterOp)passUnionWithArrayBufferOrNull },
28147 { prototypes::id::TestJSImplInterface },
28148 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28149 JSJitInfo::Method,
28150 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28151 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28152 false, /* isInfallible. False in setters. */
28153 false, /* isMovable. Not relevant for setters. */
28154 false, /* isEliminatable. Not relevant for setters. */
28155 false, /* isAlwaysInSlot. Only relevant for getters. */
28156 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28157 false, /* isTypedMethod. Only relevant for methods. */
28158 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28159};
28160
28161MOZ_CAN_RUN_SCRIPT static bool
28162passUnionWithTypedArrays(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28163{
28164 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArrays");
28165 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28168( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28166 "TestJSImplInterface", "passUnionWithTypedArrays", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28168( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28167 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28168( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28168 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28168( cx, "TestJSImplInterface"
, "passUnionWithTypedArrays", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28169
28170 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28171 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArrays", 1)) {
28172 return false;
28173 }
28174 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28175 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28176 if (objIsXray) {
28177 unwrappedObj.emplace(cx, obj);
28178 }
28179 ArrayBufferViewOrArrayBuffer arg0;
28180 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28181 return false;
28182 }
28183 if (objIsXray) {
28184 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28185 // we know Xrays have no dynamic unwrap behavior.
28186 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28187 if (!unwrappedObj.ref()) {
28188 return false;
28189 }
28190 }
28191 FastErrorResult rv;
28192 // NOTE: This assert does NOT call the function.
28193 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28194 MOZ_KnownLive(self)(self)->PassUnionWithTypedArrays(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28195 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArrays"
)), 0))
) {
28196 return false;
28197 }
28198 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28198); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28198; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28199 args.rval().setUndefined();
28200 return true;
28201}
28202
28203static const JSJitInfo passUnionWithTypedArrays_methodinfo = {
28204 { (JSJitGetterOp)passUnionWithTypedArrays },
28205 { prototypes::id::TestJSImplInterface },
28206 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28207 JSJitInfo::Method,
28208 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28209 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28210 false, /* isInfallible. False in setters. */
28211 false, /* isMovable. Not relevant for setters. */
28212 false, /* isEliminatable. Not relevant for setters. */
28213 false, /* isAlwaysInSlot. Only relevant for getters. */
28214 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28215 false, /* isTypedMethod. Only relevant for methods. */
28216 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28217};
28218
28219MOZ_CAN_RUN_SCRIPT static bool
28220passUnionWithTypedArraysOrNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28221{
28222 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithTypedArraysOrNull");
28223 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28226( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28224 "TestJSImplInterface", "passUnionWithTypedArraysOrNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28226( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28225 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28226( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28226 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28226( cx, "TestJSImplInterface"
, "passUnionWithTypedArraysOrNull", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28227
28228 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28229 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull", 1)) {
28230 return false;
28231 }
28232 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28233 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28234 if (objIsXray) {
28235 unwrappedObj.emplace(cx, obj);
28236 }
28237 ArrayBufferViewOrArrayBufferOrNull arg0;
28238 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28239 return false;
28240 }
28241 if (objIsXray) {
28242 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28243 // we know Xrays have no dynamic unwrap behavior.
28244 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28245 if (!unwrappedObj.ref()) {
28246 return false;
28247 }
28248 }
28249 FastErrorResult rv;
28250 // NOTE: This assert does NOT call the function.
28251 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28252 MOZ_KnownLive(self)(self)->PassUnionWithTypedArraysOrNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28253 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithTypedArraysOrNull"
)), 0))
) {
28254 return false;
28255 }
28256 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28256); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28256; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28257 args.rval().setUndefined();
28258 return true;
28259}
28260
28261static const JSJitInfo passUnionWithTypedArraysOrNull_methodinfo = {
28262 { (JSJitGetterOp)passUnionWithTypedArraysOrNull },
28263 { prototypes::id::TestJSImplInterface },
28264 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28265 JSJitInfo::Method,
28266 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28267 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28268 false, /* isInfallible. False in setters. */
28269 false, /* isMovable. Not relevant for setters. */
28270 false, /* isEliminatable. Not relevant for setters. */
28271 false, /* isAlwaysInSlot. Only relevant for getters. */
28272 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28273 false, /* isTypedMethod. Only relevant for methods. */
28274 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28275};
28276
28277MOZ_CAN_RUN_SCRIPT static bool
28278passUnionWithString(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28279{
28280 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithString");
28281 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28284( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28282 "TestJSImplInterface", "passUnionWithString", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28284( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28283 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28284( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28284 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28284( cx, "TestJSImplInterface"
, "passUnionWithString", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28285
28286 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28287 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithString", 1)) {
28288 return false;
28289 }
28290 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28291 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28292 if (objIsXray) {
28293 unwrappedObj.emplace(cx, obj);
28294 }
28295 StringOrObject arg0;
28296 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28297 return false;
28298 }
28299 if (objIsXray) {
28300 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28301 // we know Xrays have no dynamic unwrap behavior.
28302 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28303 if (!unwrappedObj.ref()) {
28304 return false;
28305 }
28306 }
28307 FastErrorResult rv;
28308 // NOTE: This assert does NOT call the function.
28309 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28310 MOZ_KnownLive(self)(self)->PassUnionWithString(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28311 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithString"
)), 0))
) {
28312 return false;
28313 }
28314 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28314); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28314; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28315 args.rval().setUndefined();
28316 return true;
28317}
28318
28319static const JSJitInfo passUnionWithString_methodinfo = {
28320 { (JSJitGetterOp)passUnionWithString },
28321 { prototypes::id::TestJSImplInterface },
28322 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28323 JSJitInfo::Method,
28324 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28325 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28326 false, /* isInfallible. False in setters. */
28327 false, /* isMovable. Not relevant for setters. */
28328 false, /* isEliminatable. Not relevant for setters. */
28329 false, /* isAlwaysInSlot. Only relevant for getters. */
28330 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28331 false, /* isTypedMethod. Only relevant for methods. */
28332 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28333};
28334
28335MOZ_CAN_RUN_SCRIPT static bool
28336passUnionWithEnum(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28337{
28338 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithEnum");
28339 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28342( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28340 "TestJSImplInterface", "passUnionWithEnum", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28342( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28341 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28342( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28342 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28342( cx, "TestJSImplInterface"
, "passUnionWithEnum", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28343
28344 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28345 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithEnum", 1)) {
28346 return false;
28347 }
28348 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28349 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28350 if (objIsXray) {
28351 unwrappedObj.emplace(cx, obj);
28352 }
28353 SupportedTypeOrObject arg0;
28354 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28355 return false;
28356 }
28357 if (objIsXray) {
28358 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28359 // we know Xrays have no dynamic unwrap behavior.
28360 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28361 if (!unwrappedObj.ref()) {
28362 return false;
28363 }
28364 }
28365 FastErrorResult rv;
28366 // NOTE: This assert does NOT call the function.
28367 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28368 MOZ_KnownLive(self)(self)->PassUnionWithEnum(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28369 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithEnum"
)), 0))
) {
28370 return false;
28371 }
28372 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28372); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28372; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28373 args.rval().setUndefined();
28374 return true;
28375}
28376
28377static const JSJitInfo passUnionWithEnum_methodinfo = {
28378 { (JSJitGetterOp)passUnionWithEnum },
28379 { prototypes::id::TestJSImplInterface },
28380 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28381 JSJitInfo::Method,
28382 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28383 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28384 false, /* isInfallible. False in setters. */
28385 false, /* isMovable. Not relevant for setters. */
28386 false, /* isEliminatable. Not relevant for setters. */
28387 false, /* isAlwaysInSlot. Only relevant for getters. */
28388 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28389 false, /* isTypedMethod. Only relevant for methods. */
28390 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28391};
28392
28393MOZ_CAN_RUN_SCRIPT static bool
28394passUnionWithObject(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28395{
28396 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithObject");
28397 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28400( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28398 "TestJSImplInterface", "passUnionWithObject", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28400( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28399 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28400( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
28400 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28400( cx, "TestJSImplInterface"
, "passUnionWithObject", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
28401
28402 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28403 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionWithObject", 1)) {
28404 return false;
28405 }
28406 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28407 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28408 if (objIsXray) {
28409 unwrappedObj.emplace(cx, obj);
28410 }
28411 ObjectOrLong arg0;
28412 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28413 return false;
28414 }
28415 if (objIsXray) {
28416 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28417 // we know Xrays have no dynamic unwrap behavior.
28418 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28419 if (!unwrappedObj.ref()) {
28420 return false;
28421 }
28422 }
28423 FastErrorResult rv;
28424 // NOTE: This assert does NOT call the function.
28425 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28426 MOZ_KnownLive(self)(self)->PassUnionWithObject(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28427 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithObject"
)), 0))
) {
28428 return false;
28429 }
28430 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28430); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28430; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28431 args.rval().setUndefined();
28432 return true;
28433}
28434
28435static const JSJitInfo passUnionWithObject_methodinfo = {
28436 { (JSJitGetterOp)passUnionWithObject },
28437 { prototypes::id::TestJSImplInterface },
28438 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28439 JSJitInfo::Method,
28440 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28441 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28442 false, /* isInfallible. False in setters. */
28443 false, /* isMovable. Not relevant for setters. */
28444 false, /* isEliminatable. Not relevant for setters. */
28445 false, /* isAlwaysInSlot. Only relevant for getters. */
28446 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28447 false, /* isTypedMethod. Only relevant for methods. */
28448 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28449};
28450
28451MOZ_CAN_RUN_SCRIPT static bool
28452passUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28453{
28454 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue1");
28455 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28458( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28456 "TestJSImplInterface", "passUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28458( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28457 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28458( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28458 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28458( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28459
28460 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28461 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28462 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28463 if (objIsXray) {
28464 unwrappedObj.emplace(cx, obj);
28465 }
28466 DoubleOrString arg0;
28467 if (!(args.hasDefined(0))) {
28468 arg0.SetStringLiteral(u"");
28469 } else {
28470 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28471 return false;
28472 }
28473 }
28474 if (objIsXray) {
28475 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28476 // we know Xrays have no dynamic unwrap behavior.
28477 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28478 if (!unwrappedObj.ref()) {
28479 return false;
28480 }
28481 }
28482 FastErrorResult rv;
28483 // NOTE: This assert does NOT call the function.
28484 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28485 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28486 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue1"
)), 0))
) {
28487 return false;
28488 }
28489 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28489); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28489; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28490 args.rval().setUndefined();
28491 return true;
28492}
28493
28494static const JSJitInfo passUnionWithDefaultValue1_methodinfo = {
28495 { (JSJitGetterOp)passUnionWithDefaultValue1 },
28496 { prototypes::id::TestJSImplInterface },
28497 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28498 JSJitInfo::Method,
28499 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28500 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28501 false, /* isInfallible. False in setters. */
28502 false, /* isMovable. Not relevant for setters. */
28503 false, /* isEliminatable. Not relevant for setters. */
28504 false, /* isAlwaysInSlot. Only relevant for getters. */
28505 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28506 false, /* isTypedMethod. Only relevant for methods. */
28507 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28508};
28509
28510MOZ_CAN_RUN_SCRIPT static bool
28511passUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28512{
28513 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue2");
28514 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28517( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28515 "TestJSImplInterface", "passUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28517( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28516 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28517( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28517 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28517( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28518
28519 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28520 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28521 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28522 if (objIsXray) {
28523 unwrappedObj.emplace(cx, obj);
28524 }
28525 DoubleOrString arg0;
28526 if (!(args.hasDefined(0))) {
28527 arg0.RawSetAsDouble() = 1.0;
28528 } else {
28529 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28530 return false;
28531 }
28532 }
28533 if (objIsXray) {
28534 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28535 // we know Xrays have no dynamic unwrap behavior.
28536 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28537 if (!unwrappedObj.ref()) {
28538 return false;
28539 }
28540 }
28541 FastErrorResult rv;
28542 // NOTE: This assert does NOT call the function.
28543 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28544 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28545 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue2"
)), 0))
) {
28546 return false;
28547 }
28548 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28548); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28548; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28549 args.rval().setUndefined();
28550 return true;
28551}
28552
28553static const JSJitInfo passUnionWithDefaultValue2_methodinfo = {
28554 { (JSJitGetterOp)passUnionWithDefaultValue2 },
28555 { prototypes::id::TestJSImplInterface },
28556 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28557 JSJitInfo::Method,
28558 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28559 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28560 false, /* isInfallible. False in setters. */
28561 false, /* isMovable. Not relevant for setters. */
28562 false, /* isEliminatable. Not relevant for setters. */
28563 false, /* isAlwaysInSlot. Only relevant for getters. */
28564 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28565 false, /* isTypedMethod. Only relevant for methods. */
28566 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28567};
28568
28569MOZ_CAN_RUN_SCRIPT static bool
28570passUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28571{
28572 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue3");
28573 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28576( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28574 "TestJSImplInterface", "passUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28576( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28575 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28576( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28576 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28576( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28577
28578 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28579 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28580 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28581 if (objIsXray) {
28582 unwrappedObj.emplace(cx, obj);
28583 }
28584 DoubleOrString arg0;
28585 if (!(args.hasDefined(0))) {
28586 arg0.RawSetAsDouble() = 1.5;
28587 } else {
28588 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28589 return false;
28590 }
28591 }
28592 if (objIsXray) {
28593 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28594 // we know Xrays have no dynamic unwrap behavior.
28595 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28596 if (!unwrappedObj.ref()) {
28597 return false;
28598 }
28599 }
28600 FastErrorResult rv;
28601 // NOTE: This assert does NOT call the function.
28602 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28603 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28604 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue3"
)), 0))
) {
28605 return false;
28606 }
28607 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28607; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28608 args.rval().setUndefined();
28609 return true;
28610}
28611
28612static const JSJitInfo passUnionWithDefaultValue3_methodinfo = {
28613 { (JSJitGetterOp)passUnionWithDefaultValue3 },
28614 { prototypes::id::TestJSImplInterface },
28615 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28616 JSJitInfo::Method,
28617 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28618 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28619 false, /* isInfallible. False in setters. */
28620 false, /* isMovable. Not relevant for setters. */
28621 false, /* isEliminatable. Not relevant for setters. */
28622 false, /* isAlwaysInSlot. Only relevant for getters. */
28623 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28624 false, /* isTypedMethod. Only relevant for methods. */
28625 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28626};
28627
28628MOZ_CAN_RUN_SCRIPT static bool
28629passUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28630{
28631 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue4");
28632 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28635( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28633 "TestJSImplInterface", "passUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28635( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28634 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28635( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28635 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28635( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28636
28637 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28638 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28639 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28640 if (objIsXray) {
28641 unwrappedObj.emplace(cx, obj);
28642 }
28643 FloatOrString arg0;
28644 if (!(args.hasDefined(0))) {
28645 arg0.SetStringLiteral(u"");
28646 } else {
28647 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28648 return false;
28649 }
28650 }
28651 if (objIsXray) {
28652 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28653 // we know Xrays have no dynamic unwrap behavior.
28654 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28655 if (!unwrappedObj.ref()) {
28656 return false;
28657 }
28658 }
28659 FastErrorResult rv;
28660 // NOTE: This assert does NOT call the function.
28661 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28662 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28663 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue4"
)), 0))
) {
28664 return false;
28665 }
28666 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28666); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28666; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28667 args.rval().setUndefined();
28668 return true;
28669}
28670
28671static const JSJitInfo passUnionWithDefaultValue4_methodinfo = {
28672 { (JSJitGetterOp)passUnionWithDefaultValue4 },
28673 { prototypes::id::TestJSImplInterface },
28674 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28675 JSJitInfo::Method,
28676 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28677 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28678 false, /* isInfallible. False in setters. */
28679 false, /* isMovable. Not relevant for setters. */
28680 false, /* isEliminatable. Not relevant for setters. */
28681 false, /* isAlwaysInSlot. Only relevant for getters. */
28682 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28683 false, /* isTypedMethod. Only relevant for methods. */
28684 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28685};
28686
28687MOZ_CAN_RUN_SCRIPT static bool
28688passUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28689{
28690 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue5");
28691 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28694( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28692 "TestJSImplInterface", "passUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28694( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28693 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28694( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28694 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28694( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28695
28696 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28697 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28698 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28699 if (objIsXray) {
28700 unwrappedObj.emplace(cx, obj);
28701 }
28702 FloatOrString arg0;
28703 if (!(args.hasDefined(0))) {
28704 arg0.RawSetAsFloat() = 1.0F;
28705 } else {
28706 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28707 return false;
28708 }
28709 }
28710 if (objIsXray) {
28711 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28712 // we know Xrays have no dynamic unwrap behavior.
28713 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28714 if (!unwrappedObj.ref()) {
28715 return false;
28716 }
28717 }
28718 FastErrorResult rv;
28719 // NOTE: This assert does NOT call the function.
28720 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28721 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28722 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue5"
)), 0))
) {
28723 return false;
28724 }
28725 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28725); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28725; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28726 args.rval().setUndefined();
28727 return true;
28728}
28729
28730static const JSJitInfo passUnionWithDefaultValue5_methodinfo = {
28731 { (JSJitGetterOp)passUnionWithDefaultValue5 },
28732 { prototypes::id::TestJSImplInterface },
28733 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28734 JSJitInfo::Method,
28735 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28736 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28737 false, /* isInfallible. False in setters. */
28738 false, /* isMovable. Not relevant for setters. */
28739 false, /* isEliminatable. Not relevant for setters. */
28740 false, /* isAlwaysInSlot. Only relevant for getters. */
28741 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28742 false, /* isTypedMethod. Only relevant for methods. */
28743 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28744};
28745
28746MOZ_CAN_RUN_SCRIPT static bool
28747passUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28748{
28749 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue6");
28750 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28753( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28751 "TestJSImplInterface", "passUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28753( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28752 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28753( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28753 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28753( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28754
28755 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28756 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28757 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28758 if (objIsXray) {
28759 unwrappedObj.emplace(cx, obj);
28760 }
28761 FloatOrString arg0;
28762 if (!(args.hasDefined(0))) {
28763 arg0.RawSetAsFloat() = 1.5F;
28764 } else {
28765 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28766 return false;
28767 }
28768 }
28769 if (objIsXray) {
28770 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28771 // we know Xrays have no dynamic unwrap behavior.
28772 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28773 if (!unwrappedObj.ref()) {
28774 return false;
28775 }
28776 }
28777 FastErrorResult rv;
28778 // NOTE: This assert does NOT call the function.
28779 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28780 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28781 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue6"
)), 0))
) {
28782 return false;
28783 }
28784 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28784); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28784; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28785 args.rval().setUndefined();
28786 return true;
28787}
28788
28789static const JSJitInfo passUnionWithDefaultValue6_methodinfo = {
28790 { (JSJitGetterOp)passUnionWithDefaultValue6 },
28791 { prototypes::id::TestJSImplInterface },
28792 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28793 JSJitInfo::Method,
28794 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28795 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28796 false, /* isInfallible. False in setters. */
28797 false, /* isMovable. Not relevant for setters. */
28798 false, /* isEliminatable. Not relevant for setters. */
28799 false, /* isAlwaysInSlot. Only relevant for getters. */
28800 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28801 false, /* isTypedMethod. Only relevant for methods. */
28802 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28803};
28804
28805MOZ_CAN_RUN_SCRIPT static bool
28806passUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28807{
28808 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue7");
28809 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28812( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28810 "TestJSImplInterface", "passUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28812( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28811 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28812( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28812 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28812( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28813
28814 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28815 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28816 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28817 if (objIsXray) {
28818 unwrappedObj.emplace(cx, obj);
28819 }
28820 UnrestrictedDoubleOrString arg0;
28821 if (!(args.hasDefined(0))) {
28822 arg0.SetStringLiteral(u"");
28823 } else {
28824 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28825 return false;
28826 }
28827 }
28828 if (objIsXray) {
28829 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28830 // we know Xrays have no dynamic unwrap behavior.
28831 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28832 if (!unwrappedObj.ref()) {
28833 return false;
28834 }
28835 }
28836 FastErrorResult rv;
28837 // NOTE: This assert does NOT call the function.
28838 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28839 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28840 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue7"
)), 0))
) {
28841 return false;
28842 }
28843 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28843); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28843; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28844 args.rval().setUndefined();
28845 return true;
28846}
28847
28848static const JSJitInfo passUnionWithDefaultValue7_methodinfo = {
28849 { (JSJitGetterOp)passUnionWithDefaultValue7 },
28850 { prototypes::id::TestJSImplInterface },
28851 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28852 JSJitInfo::Method,
28853 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28854 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28855 false, /* isInfallible. False in setters. */
28856 false, /* isMovable. Not relevant for setters. */
28857 false, /* isEliminatable. Not relevant for setters. */
28858 false, /* isAlwaysInSlot. Only relevant for getters. */
28859 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28860 false, /* isTypedMethod. Only relevant for methods. */
28861 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28862};
28863
28864MOZ_CAN_RUN_SCRIPT static bool
28865passUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28866{
28867 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue8");
28868 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28871( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28869 "TestJSImplInterface", "passUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28871( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28870 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28871( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28871 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28871( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28872
28873 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28874 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28875 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28876 if (objIsXray) {
28877 unwrappedObj.emplace(cx, obj);
28878 }
28879 UnrestrictedDoubleOrString arg0;
28880 if (!(args.hasDefined(0))) {
28881 arg0.RawSetAsUnrestrictedDouble() = 1.0;
28882 } else {
28883 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28884 return false;
28885 }
28886 }
28887 if (objIsXray) {
28888 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28889 // we know Xrays have no dynamic unwrap behavior.
28890 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28891 if (!unwrappedObj.ref()) {
28892 return false;
28893 }
28894 }
28895 FastErrorResult rv;
28896 // NOTE: This assert does NOT call the function.
28897 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28898 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28899 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue8"
)), 0))
) {
28900 return false;
28901 }
28902 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28902); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28902; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28903 args.rval().setUndefined();
28904 return true;
28905}
28906
28907static const JSJitInfo passUnionWithDefaultValue8_methodinfo = {
28908 { (JSJitGetterOp)passUnionWithDefaultValue8 },
28909 { prototypes::id::TestJSImplInterface },
28910 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28911 JSJitInfo::Method,
28912 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28913 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28914 false, /* isInfallible. False in setters. */
28915 false, /* isMovable. Not relevant for setters. */
28916 false, /* isEliminatable. Not relevant for setters. */
28917 false, /* isAlwaysInSlot. Only relevant for getters. */
28918 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28919 false, /* isTypedMethod. Only relevant for methods. */
28920 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28921};
28922
28923MOZ_CAN_RUN_SCRIPT static bool
28924passUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28925{
28926 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue9");
28927 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28930( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28928 "TestJSImplInterface", "passUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28930( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28929 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28930( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28930 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28930( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue9", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28931
28932 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28933 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28934 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28935 if (objIsXray) {
28936 unwrappedObj.emplace(cx, obj);
28937 }
28938 UnrestrictedDoubleOrString arg0;
28939 if (!(args.hasDefined(0))) {
28940 arg0.RawSetAsUnrestrictedDouble() = 1.5;
28941 } else {
28942 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
28943 return false;
28944 }
28945 }
28946 if (objIsXray) {
28947 // Since our object is an Xray, we can just CheckedUnwrapStatic:
28948 // we know Xrays have no dynamic unwrap behavior.
28949 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
28950 if (!unwrappedObj.ref()) {
28951 return false;
28952 }
28953 }
28954 FastErrorResult rv;
28955 // NOTE: This assert does NOT call the function.
28956 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
28957 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
28958 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue9"
)), 0))
) {
28959 return false;
28960 }
28961 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 28961); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 28961; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
28962 args.rval().setUndefined();
28963 return true;
28964}
28965
28966static const JSJitInfo passUnionWithDefaultValue9_methodinfo = {
28967 { (JSJitGetterOp)passUnionWithDefaultValue9 },
28968 { prototypes::id::TestJSImplInterface },
28969 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
28970 JSJitInfo::Method,
28971 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
28972 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
28973 false, /* isInfallible. False in setters. */
28974 false, /* isMovable. Not relevant for setters. */
28975 false, /* isEliminatable. Not relevant for setters. */
28976 false, /* isAlwaysInSlot. Only relevant for getters. */
28977 false, /* isLazilyCachedInSlot. Only relevant for getters. */
28978 false, /* isTypedMethod. Only relevant for methods. */
28979 0 /* Reserved slot index, if we're stored in a slot, else 0. */
28980};
28981
28982MOZ_CAN_RUN_SCRIPT static bool
28983passUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
28984{
28985 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue10");
28986 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject28989( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28987 "TestJSImplInterface", "passUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject28989( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28988 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject28989( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
28989 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject28989( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue10", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
28990
28991 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
28992 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
28993 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
28994 if (objIsXray) {
28995 unwrappedObj.emplace(cx, obj);
28996 }
28997 UnrestrictedDoubleOrString arg0;
28998 if (!(args.hasDefined(0))) {
28999 arg0.RawSetAsUnrestrictedDouble() = mozilla::PositiveInfinity<double>();
29000 } else {
29001 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29002 return false;
29003 }
29004 }
29005 if (objIsXray) {
29006 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29007 // we know Xrays have no dynamic unwrap behavior.
29008 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29009 if (!unwrappedObj.ref()) {
29010 return false;
29011 }
29012 }
29013 FastErrorResult rv;
29014 // NOTE: This assert does NOT call the function.
29015 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29016 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29017 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue10"
)), 0))
) {
29018 return false;
29019 }
29020 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29020); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29020; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29021 args.rval().setUndefined();
29022 return true;
29023}
29024
29025static const JSJitInfo passUnionWithDefaultValue10_methodinfo = {
29026 { (JSJitGetterOp)passUnionWithDefaultValue10 },
29027 { prototypes::id::TestJSImplInterface },
29028 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29029 JSJitInfo::Method,
29030 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29031 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29032 false, /* isInfallible. False in setters. */
29033 false, /* isMovable. Not relevant for setters. */
29034 false, /* isEliminatable. Not relevant for setters. */
29035 false, /* isAlwaysInSlot. Only relevant for getters. */
29036 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29037 false, /* isTypedMethod. Only relevant for methods. */
29038 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29039};
29040
29041MOZ_CAN_RUN_SCRIPT static bool
29042passUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29043{
29044 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue11");
29045 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29048( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29046 "TestJSImplInterface", "passUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29048( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29047 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29048( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29048 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29048( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue11", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29049
29050 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29051 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29052 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29053 if (objIsXray) {
29054 unwrappedObj.emplace(cx, obj);
29055 }
29056 UnrestrictedFloatOrString arg0;
29057 if (!(args.hasDefined(0))) {
29058 arg0.SetStringLiteral(u"");
29059 } else {
29060 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29061 return false;
29062 }
29063 }
29064 if (objIsXray) {
29065 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29066 // we know Xrays have no dynamic unwrap behavior.
29067 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29068 if (!unwrappedObj.ref()) {
29069 return false;
29070 }
29071 }
29072 FastErrorResult rv;
29073 // NOTE: This assert does NOT call the function.
29074 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29075 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29076 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue11"
)), 0))
) {
29077 return false;
29078 }
29079 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29079); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29079; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29080 args.rval().setUndefined();
29081 return true;
29082}
29083
29084static const JSJitInfo passUnionWithDefaultValue11_methodinfo = {
29085 { (JSJitGetterOp)passUnionWithDefaultValue11 },
29086 { prototypes::id::TestJSImplInterface },
29087 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29088 JSJitInfo::Method,
29089 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29090 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29091 false, /* isInfallible. False in setters. */
29092 false, /* isMovable. Not relevant for setters. */
29093 false, /* isEliminatable. Not relevant for setters. */
29094 false, /* isAlwaysInSlot. Only relevant for getters. */
29095 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29096 false, /* isTypedMethod. Only relevant for methods. */
29097 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29098};
29099
29100MOZ_CAN_RUN_SCRIPT static bool
29101passUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29102{
29103 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue12");
29104 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29107( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29105 "TestJSImplInterface", "passUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29107( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29106 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29107( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29107 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29107( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue12", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29108
29109 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29110 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29111 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29112 if (objIsXray) {
29113 unwrappedObj.emplace(cx, obj);
29114 }
29115 UnrestrictedFloatOrString arg0;
29116 if (!(args.hasDefined(0))) {
29117 arg0.RawSetAsUnrestrictedFloat() = 1.0F;
29118 } else {
29119 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29120 return false;
29121 }
29122 }
29123 if (objIsXray) {
29124 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29125 // we know Xrays have no dynamic unwrap behavior.
29126 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29127 if (!unwrappedObj.ref()) {
29128 return false;
29129 }
29130 }
29131 FastErrorResult rv;
29132 // NOTE: This assert does NOT call the function.
29133 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29134 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29135 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue12"
)), 0))
) {
29136 return false;
29137 }
29138 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29138); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29138; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29139 args.rval().setUndefined();
29140 return true;
29141}
29142
29143static const JSJitInfo passUnionWithDefaultValue12_methodinfo = {
29144 { (JSJitGetterOp)passUnionWithDefaultValue12 },
29145 { prototypes::id::TestJSImplInterface },
29146 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29147 JSJitInfo::Method,
29148 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29149 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29150 false, /* isInfallible. False in setters. */
29151 false, /* isMovable. Not relevant for setters. */
29152 false, /* isEliminatable. Not relevant for setters. */
29153 false, /* isAlwaysInSlot. Only relevant for getters. */
29154 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29155 false, /* isTypedMethod. Only relevant for methods. */
29156 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29157};
29158
29159MOZ_CAN_RUN_SCRIPT static bool
29160passUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29161{
29162 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue13");
29163 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29166( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29164 "TestJSImplInterface", "passUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29166( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29165 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29166( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29166 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29166( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue13", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29167
29168 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29169 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29170 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29171 if (objIsXray) {
29172 unwrappedObj.emplace(cx, obj);
29173 }
29174 UnrestrictedFloatOrString arg0;
29175 if (!(args.hasDefined(0))) {
29176 arg0.RawSetAsUnrestrictedFloat() = mozilla::PositiveInfinity<float>();
29177 } else {
29178 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29179 return false;
29180 }
29181 }
29182 if (objIsXray) {
29183 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29184 // we know Xrays have no dynamic unwrap behavior.
29185 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29186 if (!unwrappedObj.ref()) {
29187 return false;
29188 }
29189 }
29190 FastErrorResult rv;
29191 // NOTE: This assert does NOT call the function.
29192 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29193 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29194 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue13"
)), 0))
) {
29195 return false;
29196 }
29197 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29197); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29197; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29198 args.rval().setUndefined();
29199 return true;
29200}
29201
29202static const JSJitInfo passUnionWithDefaultValue13_methodinfo = {
29203 { (JSJitGetterOp)passUnionWithDefaultValue13 },
29204 { prototypes::id::TestJSImplInterface },
29205 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29206 JSJitInfo::Method,
29207 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29208 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29209 false, /* isInfallible. False in setters. */
29210 false, /* isMovable. Not relevant for setters. */
29211 false, /* isEliminatable. Not relevant for setters. */
29212 false, /* isAlwaysInSlot. Only relevant for getters. */
29213 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29214 false, /* isTypedMethod. Only relevant for methods. */
29215 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29216};
29217
29218MOZ_CAN_RUN_SCRIPT static bool
29219passUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29220{
29221 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue14");
29222 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29225( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29223 "TestJSImplInterface", "passUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29225( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29224 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29225( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29225 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29225( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue14", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29226
29227 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29228 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29229 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29230 if (objIsXray) {
29231 unwrappedObj.emplace(cx, obj);
29232 }
29233 DoubleOrByteString arg0;
29234 if (!(args.hasDefined(0))) {
29235 arg0.SetStringLiteral("");
29236 } else {
29237 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29238 return false;
29239 }
29240 }
29241 if (objIsXray) {
29242 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29243 // we know Xrays have no dynamic unwrap behavior.
29244 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29245 if (!unwrappedObj.ref()) {
29246 return false;
29247 }
29248 }
29249 FastErrorResult rv;
29250 // NOTE: This assert does NOT call the function.
29251 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29252 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29253 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue14"
)), 0))
) {
29254 return false;
29255 }
29256 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29256); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29256; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29257 args.rval().setUndefined();
29258 return true;
29259}
29260
29261static const JSJitInfo passUnionWithDefaultValue14_methodinfo = {
29262 { (JSJitGetterOp)passUnionWithDefaultValue14 },
29263 { prototypes::id::TestJSImplInterface },
29264 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29265 JSJitInfo::Method,
29266 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29267 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29268 false, /* isInfallible. False in setters. */
29269 false, /* isMovable. Not relevant for setters. */
29270 false, /* isEliminatable. Not relevant for setters. */
29271 false, /* isAlwaysInSlot. Only relevant for getters. */
29272 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29273 false, /* isTypedMethod. Only relevant for methods. */
29274 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29275};
29276
29277MOZ_CAN_RUN_SCRIPT static bool
29278passUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29279{
29280 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue15");
29281 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29284( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29282 "TestJSImplInterface", "passUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29284( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29283 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29284( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29284 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29284( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue15", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29285
29286 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29287 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29288 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29289 if (objIsXray) {
29290 unwrappedObj.emplace(cx, obj);
29291 }
29292 DoubleOrByteString arg0;
29293 if (!(args.hasDefined(0))) {
29294 arg0.RawSetAsDouble() = 1.0;
29295 } else {
29296 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29297 return false;
29298 }
29299 }
29300 if (objIsXray) {
29301 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29302 // we know Xrays have no dynamic unwrap behavior.
29303 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29304 if (!unwrappedObj.ref()) {
29305 return false;
29306 }
29307 }
29308 FastErrorResult rv;
29309 // NOTE: This assert does NOT call the function.
29310 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29311 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29312 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue15"
)), 0))
) {
29313 return false;
29314 }
29315 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29315); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29315; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29316 args.rval().setUndefined();
29317 return true;
29318}
29319
29320static const JSJitInfo passUnionWithDefaultValue15_methodinfo = {
29321 { (JSJitGetterOp)passUnionWithDefaultValue15 },
29322 { prototypes::id::TestJSImplInterface },
29323 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29324 JSJitInfo::Method,
29325 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29326 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29327 false, /* isInfallible. False in setters. */
29328 false, /* isMovable. Not relevant for setters. */
29329 false, /* isEliminatable. Not relevant for setters. */
29330 false, /* isAlwaysInSlot. Only relevant for getters. */
29331 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29332 false, /* isTypedMethod. Only relevant for methods. */
29333 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29334};
29335
29336MOZ_CAN_RUN_SCRIPT static bool
29337passUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29338{
29339 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue16");
29340 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29343( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29341 "TestJSImplInterface", "passUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29343( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29342 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29343( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29343 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29343( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue16", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29344
29345 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29346 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29347 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29348 if (objIsXray) {
29349 unwrappedObj.emplace(cx, obj);
29350 }
29351 DoubleOrByteString arg0;
29352 if (!(args.hasDefined(0))) {
29353 arg0.RawSetAsDouble() = 1.5;
29354 } else {
29355 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29356 return false;
29357 }
29358 }
29359 if (objIsXray) {
29360 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29361 // we know Xrays have no dynamic unwrap behavior.
29362 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29363 if (!unwrappedObj.ref()) {
29364 return false;
29365 }
29366 }
29367 FastErrorResult rv;
29368 // NOTE: This assert does NOT call the function.
29369 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29370 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29371 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue16"
)), 0))
) {
29372 return false;
29373 }
29374 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29374); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29374; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29375 args.rval().setUndefined();
29376 return true;
29377}
29378
29379static const JSJitInfo passUnionWithDefaultValue16_methodinfo = {
29380 { (JSJitGetterOp)passUnionWithDefaultValue16 },
29381 { prototypes::id::TestJSImplInterface },
29382 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29383 JSJitInfo::Method,
29384 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29385 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29386 false, /* isInfallible. False in setters. */
29387 false, /* isMovable. Not relevant for setters. */
29388 false, /* isEliminatable. Not relevant for setters. */
29389 false, /* isAlwaysInSlot. Only relevant for getters. */
29390 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29391 false, /* isTypedMethod. Only relevant for methods. */
29392 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29393};
29394
29395MOZ_CAN_RUN_SCRIPT static bool
29396passUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29397{
29398 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue17");
29399 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29402( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29400 "TestJSImplInterface", "passUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29402( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29401 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29402( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29402 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29402( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue17", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29403
29404 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29405 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29406 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29407 if (objIsXray) {
29408 unwrappedObj.emplace(cx, obj);
29409 }
29410 DoubleOrSupportedType arg0;
29411 if (!(args.hasDefined(0))) {
29412 arg0.RawSetAsSupportedType() = SupportedType::Text_html;
29413 } else {
29414 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29415 return false;
29416 }
29417 }
29418 if (objIsXray) {
29419 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29420 // we know Xrays have no dynamic unwrap behavior.
29421 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29422 if (!unwrappedObj.ref()) {
29423 return false;
29424 }
29425 }
29426 FastErrorResult rv;
29427 // NOTE: This assert does NOT call the function.
29428 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29429 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29430 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue17"
)), 0))
) {
29431 return false;
29432 }
29433 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29433); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29433; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29434 args.rval().setUndefined();
29435 return true;
29436}
29437
29438static const JSJitInfo passUnionWithDefaultValue17_methodinfo = {
29439 { (JSJitGetterOp)passUnionWithDefaultValue17 },
29440 { prototypes::id::TestJSImplInterface },
29441 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29442 JSJitInfo::Method,
29443 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29444 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29445 false, /* isInfallible. False in setters. */
29446 false, /* isMovable. Not relevant for setters. */
29447 false, /* isEliminatable. Not relevant for setters. */
29448 false, /* isAlwaysInSlot. Only relevant for getters. */
29449 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29450 false, /* isTypedMethod. Only relevant for methods. */
29451 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29452};
29453
29454MOZ_CAN_RUN_SCRIPT static bool
29455passUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29456{
29457 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue18");
29458 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29461( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29459 "TestJSImplInterface", "passUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29461( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29460 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29461( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29461 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29461( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue18", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29462
29463 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29464 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29465 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29466 if (objIsXray) {
29467 unwrappedObj.emplace(cx, obj);
29468 }
29469 DoubleOrSupportedType arg0;
29470 if (!(args.hasDefined(0))) {
29471 arg0.RawSetAsDouble() = 1.0;
29472 } else {
29473 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29474 return false;
29475 }
29476 }
29477 if (objIsXray) {
29478 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29479 // we know Xrays have no dynamic unwrap behavior.
29480 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29481 if (!unwrappedObj.ref()) {
29482 return false;
29483 }
29484 }
29485 FastErrorResult rv;
29486 // NOTE: This assert does NOT call the function.
29487 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29488 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29489 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue18"
)), 0))
) {
29490 return false;
29491 }
29492 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29492); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29492; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29493 args.rval().setUndefined();
29494 return true;
29495}
29496
29497static const JSJitInfo passUnionWithDefaultValue18_methodinfo = {
29498 { (JSJitGetterOp)passUnionWithDefaultValue18 },
29499 { prototypes::id::TestJSImplInterface },
29500 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29501 JSJitInfo::Method,
29502 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29503 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29504 false, /* isInfallible. False in setters. */
29505 false, /* isMovable. Not relevant for setters. */
29506 false, /* isEliminatable. Not relevant for setters. */
29507 false, /* isAlwaysInSlot. Only relevant for getters. */
29508 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29509 false, /* isTypedMethod. Only relevant for methods. */
29510 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29511};
29512
29513MOZ_CAN_RUN_SCRIPT static bool
29514passUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29515{
29516 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue19");
29517 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29520( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29518 "TestJSImplInterface", "passUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29520( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29519 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29520( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29520 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29520( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue19", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29521
29522 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29523 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29524 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29525 if (objIsXray) {
29526 unwrappedObj.emplace(cx, obj);
29527 }
29528 DoubleOrSupportedType arg0;
29529 if (!(args.hasDefined(0))) {
29530 arg0.RawSetAsDouble() = 1.5;
29531 } else {
29532 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29533 return false;
29534 }
29535 }
29536 if (objIsXray) {
29537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29538 // we know Xrays have no dynamic unwrap behavior.
29539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29540 if (!unwrappedObj.ref()) {
29541 return false;
29542 }
29543 }
29544 FastErrorResult rv;
29545 // NOTE: This assert does NOT call the function.
29546 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29547 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue19"
)), 0))
) {
29549 return false;
29550 }
29551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29551; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29552 args.rval().setUndefined();
29553 return true;
29554}
29555
29556static const JSJitInfo passUnionWithDefaultValue19_methodinfo = {
29557 { (JSJitGetterOp)passUnionWithDefaultValue19 },
29558 { prototypes::id::TestJSImplInterface },
29559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29560 JSJitInfo::Method,
29561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29563 false, /* isInfallible. False in setters. */
29564 false, /* isMovable. Not relevant for setters. */
29565 false, /* isEliminatable. Not relevant for setters. */
29566 false, /* isAlwaysInSlot. Only relevant for getters. */
29567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29568 false, /* isTypedMethod. Only relevant for methods. */
29569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29570};
29571
29572MOZ_CAN_RUN_SCRIPT static bool
29573passUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29574{
29575 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue20");
29576 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29579( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29577 "TestJSImplInterface", "passUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29579( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29578 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29579( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29579 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29579( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue20", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29580
29581 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29582 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29583 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29584 if (objIsXray) {
29585 unwrappedObj.emplace(cx, obj);
29586 }
29587 DoubleOrUSVString arg0;
29588 if (!(args.hasDefined(0))) {
29589 arg0.SetStringLiteral(u"abc");
29590 } else {
29591 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29592 return false;
29593 }
29594 }
29595 if (objIsXray) {
29596 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29597 // we know Xrays have no dynamic unwrap behavior.
29598 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29599 if (!unwrappedObj.ref()) {
29600 return false;
29601 }
29602 }
29603 FastErrorResult rv;
29604 // NOTE: This assert does NOT call the function.
29605 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29606 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29607 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue20"
)), 0))
) {
29608 return false;
29609 }
29610 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29610); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29610; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29611 args.rval().setUndefined();
29612 return true;
29613}
29614
29615static const JSJitInfo passUnionWithDefaultValue20_methodinfo = {
29616 { (JSJitGetterOp)passUnionWithDefaultValue20 },
29617 { prototypes::id::TestJSImplInterface },
29618 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29619 JSJitInfo::Method,
29620 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29621 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29622 false, /* isInfallible. False in setters. */
29623 false, /* isMovable. Not relevant for setters. */
29624 false, /* isEliminatable. Not relevant for setters. */
29625 false, /* isAlwaysInSlot. Only relevant for getters. */
29626 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29627 false, /* isTypedMethod. Only relevant for methods. */
29628 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29629};
29630
29631MOZ_CAN_RUN_SCRIPT static bool
29632passUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29633{
29634 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue21");
29635 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29638( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29636 "TestJSImplInterface", "passUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29638( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29637 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29638( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29638 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29638( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue21", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29639
29640 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29641 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29642 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29643 if (objIsXray) {
29644 unwrappedObj.emplace(cx, obj);
29645 }
29646 DoubleOrUSVString arg0;
29647 if (!(args.hasDefined(0))) {
29648 arg0.RawSetAsDouble() = 1.0;
29649 } else {
29650 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29651 return false;
29652 }
29653 }
29654 if (objIsXray) {
29655 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29656 // we know Xrays have no dynamic unwrap behavior.
29657 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29658 if (!unwrappedObj.ref()) {
29659 return false;
29660 }
29661 }
29662 FastErrorResult rv;
29663 // NOTE: This assert does NOT call the function.
29664 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29665 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29666 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue21"
)), 0))
) {
29667 return false;
29668 }
29669 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29669); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29669; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29670 args.rval().setUndefined();
29671 return true;
29672}
29673
29674static const JSJitInfo passUnionWithDefaultValue21_methodinfo = {
29675 { (JSJitGetterOp)passUnionWithDefaultValue21 },
29676 { prototypes::id::TestJSImplInterface },
29677 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29678 JSJitInfo::Method,
29679 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29680 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29681 false, /* isInfallible. False in setters. */
29682 false, /* isMovable. Not relevant for setters. */
29683 false, /* isEliminatable. Not relevant for setters. */
29684 false, /* isAlwaysInSlot. Only relevant for getters. */
29685 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29686 false, /* isTypedMethod. Only relevant for methods. */
29687 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29688};
29689
29690MOZ_CAN_RUN_SCRIPT static bool
29691passUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29692{
29693 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue22");
29694 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29697( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29695 "TestJSImplInterface", "passUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29697( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29696 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29697( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29697 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29697( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue22", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29698
29699 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29700 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29701 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29702 if (objIsXray) {
29703 unwrappedObj.emplace(cx, obj);
29704 }
29705 DoubleOrUSVString arg0;
29706 if (!(args.hasDefined(0))) {
29707 arg0.RawSetAsDouble() = 1.5;
29708 } else {
29709 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29710 return false;
29711 }
29712 }
29713 if (objIsXray) {
29714 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29715 // we know Xrays have no dynamic unwrap behavior.
29716 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29717 if (!unwrappedObj.ref()) {
29718 return false;
29719 }
29720 }
29721 FastErrorResult rv;
29722 // NOTE: This assert does NOT call the function.
29723 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29724 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29725 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue22"
)), 0))
) {
29726 return false;
29727 }
29728 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29728); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29728; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29729 args.rval().setUndefined();
29730 return true;
29731}
29732
29733static const JSJitInfo passUnionWithDefaultValue22_methodinfo = {
29734 { (JSJitGetterOp)passUnionWithDefaultValue22 },
29735 { prototypes::id::TestJSImplInterface },
29736 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29737 JSJitInfo::Method,
29738 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29739 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29740 false, /* isInfallible. False in setters. */
29741 false, /* isMovable. Not relevant for setters. */
29742 false, /* isEliminatable. Not relevant for setters. */
29743 false, /* isAlwaysInSlot. Only relevant for getters. */
29744 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29745 false, /* isTypedMethod. Only relevant for methods. */
29746 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29747};
29748
29749MOZ_CAN_RUN_SCRIPT static bool
29750passUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29751{
29752 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue23");
29753 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29756( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29754 "TestJSImplInterface", "passUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29756( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29755 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29756( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29756 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29756( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue23", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29757
29758 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29759 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29760 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29761 if (objIsXray) {
29762 unwrappedObj.emplace(cx, obj);
29763 }
29764 DoubleOrUTF8String arg0;
29765 if (!(args.hasDefined(0))) {
29766 arg0.SetStringLiteral("");
29767 } else {
29768 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29769 return false;
29770 }
29771 }
29772 if (objIsXray) {
29773 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29774 // we know Xrays have no dynamic unwrap behavior.
29775 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29776 if (!unwrappedObj.ref()) {
29777 return false;
29778 }
29779 }
29780 FastErrorResult rv;
29781 // NOTE: This assert does NOT call the function.
29782 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29783 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29784 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue23"
)), 0))
) {
29785 return false;
29786 }
29787 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29787); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29787; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29788 args.rval().setUndefined();
29789 return true;
29790}
29791
29792static const JSJitInfo passUnionWithDefaultValue23_methodinfo = {
29793 { (JSJitGetterOp)passUnionWithDefaultValue23 },
29794 { prototypes::id::TestJSImplInterface },
29795 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29796 JSJitInfo::Method,
29797 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29798 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29799 false, /* isInfallible. False in setters. */
29800 false, /* isMovable. Not relevant for setters. */
29801 false, /* isEliminatable. Not relevant for setters. */
29802 false, /* isAlwaysInSlot. Only relevant for getters. */
29803 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29804 false, /* isTypedMethod. Only relevant for methods. */
29805 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29806};
29807
29808MOZ_CAN_RUN_SCRIPT static bool
29809passUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29810{
29811 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue24");
29812 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29815( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29813 "TestJSImplInterface", "passUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29815( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29814 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29815( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29815 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29815( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue24", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29816
29817 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29818 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29819 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29820 if (objIsXray) {
29821 unwrappedObj.emplace(cx, obj);
29822 }
29823 DoubleOrUTF8String arg0;
29824 if (!(args.hasDefined(0))) {
29825 arg0.RawSetAsDouble() = 1.0;
29826 } else {
29827 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29828 return false;
29829 }
29830 }
29831 if (objIsXray) {
29832 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29833 // we know Xrays have no dynamic unwrap behavior.
29834 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29835 if (!unwrappedObj.ref()) {
29836 return false;
29837 }
29838 }
29839 FastErrorResult rv;
29840 // NOTE: This assert does NOT call the function.
29841 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29842 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29843 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue24"
)), 0))
) {
29844 return false;
29845 }
29846 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29846; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29847 args.rval().setUndefined();
29848 return true;
29849}
29850
29851static const JSJitInfo passUnionWithDefaultValue24_methodinfo = {
29852 { (JSJitGetterOp)passUnionWithDefaultValue24 },
29853 { prototypes::id::TestJSImplInterface },
29854 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29855 JSJitInfo::Method,
29856 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29857 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29858 false, /* isInfallible. False in setters. */
29859 false, /* isMovable. Not relevant for setters. */
29860 false, /* isEliminatable. Not relevant for setters. */
29861 false, /* isAlwaysInSlot. Only relevant for getters. */
29862 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29863 false, /* isTypedMethod. Only relevant for methods. */
29864 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29865};
29866
29867MOZ_CAN_RUN_SCRIPT static bool
29868passUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29869{
29870 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionWithDefaultValue25");
29871 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29874( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29872 "TestJSImplInterface", "passUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29874( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29873 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29874( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29874 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29874( cx, "TestJSImplInterface"
, "passUnionWithDefaultValue25", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29875
29876 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29877 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29878 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29879 if (objIsXray) {
29880 unwrappedObj.emplace(cx, obj);
29881 }
29882 DoubleOrUTF8String arg0;
29883 if (!(args.hasDefined(0))) {
29884 arg0.RawSetAsDouble() = 1.5;
29885 } else {
29886 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
29887 return false;
29888 }
29889 }
29890 if (objIsXray) {
29891 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29892 // we know Xrays have no dynamic unwrap behavior.
29893 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29894 if (!unwrappedObj.ref()) {
29895 return false;
29896 }
29897 }
29898 FastErrorResult rv;
29899 // NOTE: This assert does NOT call the function.
29900 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29901 MOZ_KnownLive(self)(self)->PassUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29902 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionWithDefaultValue25"
)), 0))
) {
29903 return false;
29904 }
29905 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29905); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29905; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29906 args.rval().setUndefined();
29907 return true;
29908}
29909
29910static const JSJitInfo passUnionWithDefaultValue25_methodinfo = {
29911 { (JSJitGetterOp)passUnionWithDefaultValue25 },
29912 { prototypes::id::TestJSImplInterface },
29913 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29914 JSJitInfo::Method,
29915 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29916 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29917 false, /* isInfallible. False in setters. */
29918 false, /* isMovable. Not relevant for setters. */
29919 false, /* isEliminatable. Not relevant for setters. */
29920 false, /* isAlwaysInSlot. Only relevant for getters. */
29921 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29922 false, /* isTypedMethod. Only relevant for methods. */
29923 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29924};
29925
29926MOZ_CAN_RUN_SCRIPT static bool
29927passNullableUnionWithDefaultValue1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29928{
29929 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue1");
29930 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29933( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29931 "TestJSImplInterface", "passNullableUnionWithDefaultValue1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29933( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29932 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29933( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29933 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29933( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue1", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29934
29935 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29936 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
29937 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
29938 if (objIsXray) {
29939 unwrappedObj.emplace(cx, obj);
29940 }
29941 Nullable<DoubleOrString > arg0;
29942 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
29943 arg0.SetNull();
29944 } else {
29945 if (!(args.hasDefined(0))) {
29946 arg0.SetValue().SetStringLiteral(u"");
29947 } else {
29948 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
29949 return false;
29950 }
29951 }
29952 }
29953 if (objIsXray) {
29954 // Since our object is an Xray, we can just CheckedUnwrapStatic:
29955 // we know Xrays have no dynamic unwrap behavior.
29956 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
29957 if (!unwrappedObj.ref()) {
29958 return false;
29959 }
29960 }
29961 FastErrorResult rv;
29962 // NOTE: This assert does NOT call the function.
29963 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
29964 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue1(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
29965 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue1"
)), 0))
) {
29966 return false;
29967 }
29968 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 29968); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 29968; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
29969 args.rval().setUndefined();
29970 return true;
29971}
29972
29973static const JSJitInfo passNullableUnionWithDefaultValue1_methodinfo = {
29974 { (JSJitGetterOp)passNullableUnionWithDefaultValue1 },
29975 { prototypes::id::TestJSImplInterface },
29976 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
29977 JSJitInfo::Method,
29978 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
29979 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
29980 false, /* isInfallible. False in setters. */
29981 false, /* isMovable. Not relevant for setters. */
29982 false, /* isEliminatable. Not relevant for setters. */
29983 false, /* isAlwaysInSlot. Only relevant for getters. */
29984 false, /* isLazilyCachedInSlot. Only relevant for getters. */
29985 false, /* isTypedMethod. Only relevant for methods. */
29986 0 /* Reserved slot index, if we're stored in a slot, else 0. */
29987};
29988
29989MOZ_CAN_RUN_SCRIPT static bool
29990passNullableUnionWithDefaultValue2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
29991{
29992 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue2");
29993 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject29996( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29994 "TestJSImplInterface", "passNullableUnionWithDefaultValue2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject29996( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29995 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject29996( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
29996 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject29996( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue2", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
29997
29998 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
29999 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30000 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30001 if (objIsXray) {
30002 unwrappedObj.emplace(cx, obj);
30003 }
30004 Nullable<DoubleOrString > arg0;
30005 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30006 arg0.SetNull();
30007 } else {
30008 if (!(args.hasDefined(0))) {
30009 arg0.SetValue().RawSetAsDouble() = 1.0;
30010 } else {
30011 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30012 return false;
30013 }
30014 }
30015 }
30016 if (objIsXray) {
30017 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30018 // we know Xrays have no dynamic unwrap behavior.
30019 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30020 if (!unwrappedObj.ref()) {
30021 return false;
30022 }
30023 }
30024 FastErrorResult rv;
30025 // NOTE: This assert does NOT call the function.
30026 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30027 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30028 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue2"
)), 0))
) {
30029 return false;
30030 }
30031 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30031; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30032 args.rval().setUndefined();
30033 return true;
30034}
30035
30036static const JSJitInfo passNullableUnionWithDefaultValue2_methodinfo = {
30037 { (JSJitGetterOp)passNullableUnionWithDefaultValue2 },
30038 { prototypes::id::TestJSImplInterface },
30039 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30040 JSJitInfo::Method,
30041 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30042 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30043 false, /* isInfallible. False in setters. */
30044 false, /* isMovable. Not relevant for setters. */
30045 false, /* isEliminatable. Not relevant for setters. */
30046 false, /* isAlwaysInSlot. Only relevant for getters. */
30047 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30048 false, /* isTypedMethod. Only relevant for methods. */
30049 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30050};
30051
30052MOZ_CAN_RUN_SCRIPT static bool
30053passNullableUnionWithDefaultValue3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30054{
30055 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue3");
30056 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30059( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30057 "TestJSImplInterface", "passNullableUnionWithDefaultValue3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30059( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30058 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30059( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30059 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30059( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue3", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30060
30061 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30062 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30063 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30064 if (objIsXray) {
30065 unwrappedObj.emplace(cx, obj);
30066 }
30067 Nullable<DoubleOrString > arg0;
30068 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30069 arg0.SetNull();
30070 } else {
30071 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30072 return false;
30073 }
30074 }
30075 if (objIsXray) {
30076 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30077 // we know Xrays have no dynamic unwrap behavior.
30078 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30079 if (!unwrappedObj.ref()) {
30080 return false;
30081 }
30082 }
30083 FastErrorResult rv;
30084 // NOTE: This assert does NOT call the function.
30085 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30086 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue3(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30087 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue3"
)), 0))
) {
30088 return false;
30089 }
30090 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30090); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30090; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30091 args.rval().setUndefined();
30092 return true;
30093}
30094
30095static const JSJitInfo passNullableUnionWithDefaultValue3_methodinfo = {
30096 { (JSJitGetterOp)passNullableUnionWithDefaultValue3 },
30097 { prototypes::id::TestJSImplInterface },
30098 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30099 JSJitInfo::Method,
30100 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30101 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30102 false, /* isInfallible. False in setters. */
30103 false, /* isMovable. Not relevant for setters. */
30104 false, /* isEliminatable. Not relevant for setters. */
30105 false, /* isAlwaysInSlot. Only relevant for getters. */
30106 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30107 false, /* isTypedMethod. Only relevant for methods. */
30108 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30109};
30110
30111MOZ_CAN_RUN_SCRIPT static bool
30112passNullableUnionWithDefaultValue4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30113{
30114 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue4");
30115 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30118( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30116 "TestJSImplInterface", "passNullableUnionWithDefaultValue4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30118( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30117 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30118( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30118 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30118( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue4", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30119
30120 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30121 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30122 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30123 if (objIsXray) {
30124 unwrappedObj.emplace(cx, obj);
30125 }
30126 Nullable<FloatOrString > arg0;
30127 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30128 arg0.SetNull();
30129 } else {
30130 if (!(args.hasDefined(0))) {
30131 arg0.SetValue().SetStringLiteral(u"");
30132 } else {
30133 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30134 return false;
30135 }
30136 }
30137 }
30138 if (objIsXray) {
30139 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30140 // we know Xrays have no dynamic unwrap behavior.
30141 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30142 if (!unwrappedObj.ref()) {
30143 return false;
30144 }
30145 }
30146 FastErrorResult rv;
30147 // NOTE: This assert does NOT call the function.
30148 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30149 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue4(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30150 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue4"
)), 0))
) {
30151 return false;
30152 }
30153 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30153); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30153; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30154 args.rval().setUndefined();
30155 return true;
30156}
30157
30158static const JSJitInfo passNullableUnionWithDefaultValue4_methodinfo = {
30159 { (JSJitGetterOp)passNullableUnionWithDefaultValue4 },
30160 { prototypes::id::TestJSImplInterface },
30161 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30162 JSJitInfo::Method,
30163 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30164 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30165 false, /* isInfallible. False in setters. */
30166 false, /* isMovable. Not relevant for setters. */
30167 false, /* isEliminatable. Not relevant for setters. */
30168 false, /* isAlwaysInSlot. Only relevant for getters. */
30169 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30170 false, /* isTypedMethod. Only relevant for methods. */
30171 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30172};
30173
30174MOZ_CAN_RUN_SCRIPT static bool
30175passNullableUnionWithDefaultValue5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30176{
30177 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue5");
30178 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30181( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30179 "TestJSImplInterface", "passNullableUnionWithDefaultValue5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30181( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30180 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30181( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30181 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30181( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue5", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30182
30183 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30184 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30185 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30186 if (objIsXray) {
30187 unwrappedObj.emplace(cx, obj);
30188 }
30189 Nullable<FloatOrString > arg0;
30190 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30191 arg0.SetNull();
30192 } else {
30193 if (!(args.hasDefined(0))) {
30194 arg0.SetValue().RawSetAsFloat() = 1.0F;
30195 } else {
30196 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30197 return false;
30198 }
30199 }
30200 }
30201 if (objIsXray) {
30202 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30203 // we know Xrays have no dynamic unwrap behavior.
30204 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30205 if (!unwrappedObj.ref()) {
30206 return false;
30207 }
30208 }
30209 FastErrorResult rv;
30210 // NOTE: This assert does NOT call the function.
30211 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30212 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue5(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30213 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue5"
)), 0))
) {
30214 return false;
30215 }
30216 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30216); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30216; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30217 args.rval().setUndefined();
30218 return true;
30219}
30220
30221static const JSJitInfo passNullableUnionWithDefaultValue5_methodinfo = {
30222 { (JSJitGetterOp)passNullableUnionWithDefaultValue5 },
30223 { prototypes::id::TestJSImplInterface },
30224 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30225 JSJitInfo::Method,
30226 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30227 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30228 false, /* isInfallible. False in setters. */
30229 false, /* isMovable. Not relevant for setters. */
30230 false, /* isEliminatable. Not relevant for setters. */
30231 false, /* isAlwaysInSlot. Only relevant for getters. */
30232 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30233 false, /* isTypedMethod. Only relevant for methods. */
30234 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30235};
30236
30237MOZ_CAN_RUN_SCRIPT static bool
30238passNullableUnionWithDefaultValue6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30239{
30240 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue6");
30241 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30244( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30242 "TestJSImplInterface", "passNullableUnionWithDefaultValue6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30244( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30243 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30244( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30244 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30244( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue6", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30245
30246 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30247 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30248 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30249 if (objIsXray) {
30250 unwrappedObj.emplace(cx, obj);
30251 }
30252 Nullable<FloatOrString > arg0;
30253 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30254 arg0.SetNull();
30255 } else {
30256 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30257 return false;
30258 }
30259 }
30260 if (objIsXray) {
30261 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30262 // we know Xrays have no dynamic unwrap behavior.
30263 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30264 if (!unwrappedObj.ref()) {
30265 return false;
30266 }
30267 }
30268 FastErrorResult rv;
30269 // NOTE: This assert does NOT call the function.
30270 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30271 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue6(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30272 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue6"
)), 0))
) {
30273 return false;
30274 }
30275 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30275); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30275; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30276 args.rval().setUndefined();
30277 return true;
30278}
30279
30280static const JSJitInfo passNullableUnionWithDefaultValue6_methodinfo = {
30281 { (JSJitGetterOp)passNullableUnionWithDefaultValue6 },
30282 { prototypes::id::TestJSImplInterface },
30283 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30284 JSJitInfo::Method,
30285 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30286 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30287 false, /* isInfallible. False in setters. */
30288 false, /* isMovable. Not relevant for setters. */
30289 false, /* isEliminatable. Not relevant for setters. */
30290 false, /* isAlwaysInSlot. Only relevant for getters. */
30291 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30292 false, /* isTypedMethod. Only relevant for methods. */
30293 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30294};
30295
30296MOZ_CAN_RUN_SCRIPT static bool
30297passNullableUnionWithDefaultValue7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30298{
30299 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue7");
30300 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30303( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30301 "TestJSImplInterface", "passNullableUnionWithDefaultValue7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30303( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30302 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30303( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30303 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30303( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue7", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30304
30305 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30306 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30307 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30308 if (objIsXray) {
30309 unwrappedObj.emplace(cx, obj);
30310 }
30311 Nullable<UnrestrictedDoubleOrString > arg0;
30312 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30313 arg0.SetNull();
30314 } else {
30315 if (!(args.hasDefined(0))) {
30316 arg0.SetValue().SetStringLiteral(u"");
30317 } else {
30318 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30319 return false;
30320 }
30321 }
30322 }
30323 if (objIsXray) {
30324 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30325 // we know Xrays have no dynamic unwrap behavior.
30326 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30327 if (!unwrappedObj.ref()) {
30328 return false;
30329 }
30330 }
30331 FastErrorResult rv;
30332 // NOTE: This assert does NOT call the function.
30333 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30334 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30335 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue7"
)), 0))
) {
30336 return false;
30337 }
30338 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30338); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30338; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30339 args.rval().setUndefined();
30340 return true;
30341}
30342
30343static const JSJitInfo passNullableUnionWithDefaultValue7_methodinfo = {
30344 { (JSJitGetterOp)passNullableUnionWithDefaultValue7 },
30345 { prototypes::id::TestJSImplInterface },
30346 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30347 JSJitInfo::Method,
30348 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30349 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30350 false, /* isInfallible. False in setters. */
30351 false, /* isMovable. Not relevant for setters. */
30352 false, /* isEliminatable. Not relevant for setters. */
30353 false, /* isAlwaysInSlot. Only relevant for getters. */
30354 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30355 false, /* isTypedMethod. Only relevant for methods. */
30356 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30357};
30358
30359MOZ_CAN_RUN_SCRIPT static bool
30360passNullableUnionWithDefaultValue8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30361{
30362 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue8");
30363 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30366( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30364 "TestJSImplInterface", "passNullableUnionWithDefaultValue8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30366( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30365 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30366( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30366 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30366( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue8", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30367
30368 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30369 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30370 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30371 if (objIsXray) {
30372 unwrappedObj.emplace(cx, obj);
30373 }
30374 Nullable<UnrestrictedDoubleOrString > arg0;
30375 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30376 arg0.SetNull();
30377 } else {
30378 if (!(args.hasDefined(0))) {
30379 arg0.SetValue().RawSetAsUnrestrictedDouble() = 1.0;
30380 } else {
30381 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30382 return false;
30383 }
30384 }
30385 }
30386 if (objIsXray) {
30387 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30388 // we know Xrays have no dynamic unwrap behavior.
30389 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30390 if (!unwrappedObj.ref()) {
30391 return false;
30392 }
30393 }
30394 FastErrorResult rv;
30395 // NOTE: This assert does NOT call the function.
30396 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30397 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue8(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30398 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue8"
)), 0))
) {
30399 return false;
30400 }
30401 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30401); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30401; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30402 args.rval().setUndefined();
30403 return true;
30404}
30405
30406static const JSJitInfo passNullableUnionWithDefaultValue8_methodinfo = {
30407 { (JSJitGetterOp)passNullableUnionWithDefaultValue8 },
30408 { prototypes::id::TestJSImplInterface },
30409 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30410 JSJitInfo::Method,
30411 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30412 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30413 false, /* isInfallible. False in setters. */
30414 false, /* isMovable. Not relevant for setters. */
30415 false, /* isEliminatable. Not relevant for setters. */
30416 false, /* isAlwaysInSlot. Only relevant for getters. */
30417 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30418 false, /* isTypedMethod. Only relevant for methods. */
30419 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30420};
30421
30422MOZ_CAN_RUN_SCRIPT static bool
30423passNullableUnionWithDefaultValue9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30424{
30425 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue9");
30426 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30429( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30427 "TestJSImplInterface", "passNullableUnionWithDefaultValue9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30429( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30428 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30429( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30429 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30429( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue9", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30430
30431 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30432 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30433 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30434 if (objIsXray) {
30435 unwrappedObj.emplace(cx, obj);
30436 }
30437 Nullable<UnrestrictedDoubleOrString > arg0;
30438 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30439 arg0.SetNull();
30440 } else {
30441 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30442 return false;
30443 }
30444 }
30445 if (objIsXray) {
30446 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30447 // we know Xrays have no dynamic unwrap behavior.
30448 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30449 if (!unwrappedObj.ref()) {
30450 return false;
30451 }
30452 }
30453 FastErrorResult rv;
30454 // NOTE: This assert does NOT call the function.
30455 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30456 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30457 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue9"
)), 0))
) {
30458 return false;
30459 }
30460 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30460); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30460; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30461 args.rval().setUndefined();
30462 return true;
30463}
30464
30465static const JSJitInfo passNullableUnionWithDefaultValue9_methodinfo = {
30466 { (JSJitGetterOp)passNullableUnionWithDefaultValue9 },
30467 { prototypes::id::TestJSImplInterface },
30468 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30469 JSJitInfo::Method,
30470 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30471 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30472 false, /* isInfallible. False in setters. */
30473 false, /* isMovable. Not relevant for setters. */
30474 false, /* isEliminatable. Not relevant for setters. */
30475 false, /* isAlwaysInSlot. Only relevant for getters. */
30476 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30477 false, /* isTypedMethod. Only relevant for methods. */
30478 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30479};
30480
30481MOZ_CAN_RUN_SCRIPT static bool
30482passNullableUnionWithDefaultValue10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30483{
30484 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue10");
30485 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30488( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30486 "TestJSImplInterface", "passNullableUnionWithDefaultValue10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30488( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30487 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30488( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30488 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30488( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue10", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30489
30490 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30491 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30492 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30493 if (objIsXray) {
30494 unwrappedObj.emplace(cx, obj);
30495 }
30496 Nullable<UnrestrictedFloatOrString > arg0;
30497 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30498 arg0.SetNull();
30499 } else {
30500 if (!(args.hasDefined(0))) {
30501 arg0.SetValue().SetStringLiteral(u"");
30502 } else {
30503 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30504 return false;
30505 }
30506 }
30507 }
30508 if (objIsXray) {
30509 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30510 // we know Xrays have no dynamic unwrap behavior.
30511 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30512 if (!unwrappedObj.ref()) {
30513 return false;
30514 }
30515 }
30516 FastErrorResult rv;
30517 // NOTE: This assert does NOT call the function.
30518 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30519 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30520 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue10"
)), 0))
) {
30521 return false;
30522 }
30523 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30523; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30524 args.rval().setUndefined();
30525 return true;
30526}
30527
30528static const JSJitInfo passNullableUnionWithDefaultValue10_methodinfo = {
30529 { (JSJitGetterOp)passNullableUnionWithDefaultValue10 },
30530 { prototypes::id::TestJSImplInterface },
30531 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30532 JSJitInfo::Method,
30533 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30534 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30535 false, /* isInfallible. False in setters. */
30536 false, /* isMovable. Not relevant for setters. */
30537 false, /* isEliminatable. Not relevant for setters. */
30538 false, /* isAlwaysInSlot. Only relevant for getters. */
30539 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30540 false, /* isTypedMethod. Only relevant for methods. */
30541 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30542};
30543
30544MOZ_CAN_RUN_SCRIPT static bool
30545passNullableUnionWithDefaultValue11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30546{
30547 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue11");
30548 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30551( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30549 "TestJSImplInterface", "passNullableUnionWithDefaultValue11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30551( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30550 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30551( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30551 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30551( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue11", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30552
30553 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30554 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30555 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30556 if (objIsXray) {
30557 unwrappedObj.emplace(cx, obj);
30558 }
30559 Nullable<UnrestrictedFloatOrString > arg0;
30560 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30561 arg0.SetNull();
30562 } else {
30563 if (!(args.hasDefined(0))) {
30564 arg0.SetValue().RawSetAsUnrestrictedFloat() = 1.0F;
30565 } else {
30566 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30567 return false;
30568 }
30569 }
30570 }
30571 if (objIsXray) {
30572 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30573 // we know Xrays have no dynamic unwrap behavior.
30574 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30575 if (!unwrappedObj.ref()) {
30576 return false;
30577 }
30578 }
30579 FastErrorResult rv;
30580 // NOTE: This assert does NOT call the function.
30581 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30582 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue11(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30583 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue11"
)), 0))
) {
30584 return false;
30585 }
30586 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30586); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30586; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30587 args.rval().setUndefined();
30588 return true;
30589}
30590
30591static const JSJitInfo passNullableUnionWithDefaultValue11_methodinfo = {
30592 { (JSJitGetterOp)passNullableUnionWithDefaultValue11 },
30593 { prototypes::id::TestJSImplInterface },
30594 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30595 JSJitInfo::Method,
30596 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30597 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30598 false, /* isInfallible. False in setters. */
30599 false, /* isMovable. Not relevant for setters. */
30600 false, /* isEliminatable. Not relevant for setters. */
30601 false, /* isAlwaysInSlot. Only relevant for getters. */
30602 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30603 false, /* isTypedMethod. Only relevant for methods. */
30604 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30605};
30606
30607MOZ_CAN_RUN_SCRIPT static bool
30608passNullableUnionWithDefaultValue12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30609{
30610 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue12");
30611 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30614( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30612 "TestJSImplInterface", "passNullableUnionWithDefaultValue12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30614( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30613 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30614( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30614 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30614( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue12", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30615
30616 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30617 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30618 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30619 if (objIsXray) {
30620 unwrappedObj.emplace(cx, obj);
30621 }
30622 Nullable<UnrestrictedFloatOrString > arg0;
30623 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30624 arg0.SetNull();
30625 } else {
30626 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30627 return false;
30628 }
30629 }
30630 if (objIsXray) {
30631 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30632 // we know Xrays have no dynamic unwrap behavior.
30633 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30634 if (!unwrappedObj.ref()) {
30635 return false;
30636 }
30637 }
30638 FastErrorResult rv;
30639 // NOTE: This assert does NOT call the function.
30640 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30641 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30642 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue12"
)), 0))
) {
30643 return false;
30644 }
30645 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30645); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30645; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30646 args.rval().setUndefined();
30647 return true;
30648}
30649
30650static const JSJitInfo passNullableUnionWithDefaultValue12_methodinfo = {
30651 { (JSJitGetterOp)passNullableUnionWithDefaultValue12 },
30652 { prototypes::id::TestJSImplInterface },
30653 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30654 JSJitInfo::Method,
30655 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30656 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30657 false, /* isInfallible. False in setters. */
30658 false, /* isMovable. Not relevant for setters. */
30659 false, /* isEliminatable. Not relevant for setters. */
30660 false, /* isAlwaysInSlot. Only relevant for getters. */
30661 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30662 false, /* isTypedMethod. Only relevant for methods. */
30663 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30664};
30665
30666MOZ_CAN_RUN_SCRIPT static bool
30667passNullableUnionWithDefaultValue13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30668{
30669 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue13");
30670 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30673( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30671 "TestJSImplInterface", "passNullableUnionWithDefaultValue13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30673( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30672 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30673( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30673 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30673( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue13", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30674
30675 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30676 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30677 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30678 if (objIsXray) {
30679 unwrappedObj.emplace(cx, obj);
30680 }
30681 Nullable<DoubleOrByteString > arg0;
30682 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30683 arg0.SetNull();
30684 } else {
30685 if (!(args.hasDefined(0))) {
30686 arg0.SetValue().SetStringLiteral("");
30687 } else {
30688 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30689 return false;
30690 }
30691 }
30692 }
30693 if (objIsXray) {
30694 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30695 // we know Xrays have no dynamic unwrap behavior.
30696 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30697 if (!unwrappedObj.ref()) {
30698 return false;
30699 }
30700 }
30701 FastErrorResult rv;
30702 // NOTE: This assert does NOT call the function.
30703 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30704 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30705 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue13"
)), 0))
) {
30706 return false;
30707 }
30708 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30708); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30708; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30709 args.rval().setUndefined();
30710 return true;
30711}
30712
30713static const JSJitInfo passNullableUnionWithDefaultValue13_methodinfo = {
30714 { (JSJitGetterOp)passNullableUnionWithDefaultValue13 },
30715 { prototypes::id::TestJSImplInterface },
30716 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30717 JSJitInfo::Method,
30718 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30719 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30720 false, /* isInfallible. False in setters. */
30721 false, /* isMovable. Not relevant for setters. */
30722 false, /* isEliminatable. Not relevant for setters. */
30723 false, /* isAlwaysInSlot. Only relevant for getters. */
30724 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30725 false, /* isTypedMethod. Only relevant for methods. */
30726 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30727};
30728
30729MOZ_CAN_RUN_SCRIPT static bool
30730passNullableUnionWithDefaultValue14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30731{
30732 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue14");
30733 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30736( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30734 "TestJSImplInterface", "passNullableUnionWithDefaultValue14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30736( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30735 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30736( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30736 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30736( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue14", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30737
30738 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30739 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30740 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30741 if (objIsXray) {
30742 unwrappedObj.emplace(cx, obj);
30743 }
30744 Nullable<DoubleOrByteString > arg0;
30745 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30746 arg0.SetNull();
30747 } else {
30748 if (!(args.hasDefined(0))) {
30749 arg0.SetValue().RawSetAsDouble() = 1.0;
30750 } else {
30751 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30752 return false;
30753 }
30754 }
30755 }
30756 if (objIsXray) {
30757 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30758 // we know Xrays have no dynamic unwrap behavior.
30759 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30760 if (!unwrappedObj.ref()) {
30761 return false;
30762 }
30763 }
30764 FastErrorResult rv;
30765 // NOTE: This assert does NOT call the function.
30766 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30767 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30768 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue14"
)), 0))
) {
30769 return false;
30770 }
30771 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30771); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30771; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30772 args.rval().setUndefined();
30773 return true;
30774}
30775
30776static const JSJitInfo passNullableUnionWithDefaultValue14_methodinfo = {
30777 { (JSJitGetterOp)passNullableUnionWithDefaultValue14 },
30778 { prototypes::id::TestJSImplInterface },
30779 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30780 JSJitInfo::Method,
30781 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30782 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30783 false, /* isInfallible. False in setters. */
30784 false, /* isMovable. Not relevant for setters. */
30785 false, /* isEliminatable. Not relevant for setters. */
30786 false, /* isAlwaysInSlot. Only relevant for getters. */
30787 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30788 false, /* isTypedMethod. Only relevant for methods. */
30789 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30790};
30791
30792MOZ_CAN_RUN_SCRIPT static bool
30793passNullableUnionWithDefaultValue15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30794{
30795 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue15");
30796 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30799( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30797 "TestJSImplInterface", "passNullableUnionWithDefaultValue15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30799( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30798 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30799( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30799 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30799( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue15", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30800
30801 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30802 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30803 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30804 if (objIsXray) {
30805 unwrappedObj.emplace(cx, obj);
30806 }
30807 Nullable<DoubleOrByteString > arg0;
30808 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30809 arg0.SetNull();
30810 } else {
30811 if (!(args.hasDefined(0))) {
30812 arg0.SetValue().RawSetAsDouble() = 1.5;
30813 } else {
30814 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30815 return false;
30816 }
30817 }
30818 }
30819 if (objIsXray) {
30820 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30821 // we know Xrays have no dynamic unwrap behavior.
30822 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30823 if (!unwrappedObj.ref()) {
30824 return false;
30825 }
30826 }
30827 FastErrorResult rv;
30828 // NOTE: This assert does NOT call the function.
30829 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30830 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue15(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30831 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue15"
)), 0))
) {
30832 return false;
30833 }
30834 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30834; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30835 args.rval().setUndefined();
30836 return true;
30837}
30838
30839static const JSJitInfo passNullableUnionWithDefaultValue15_methodinfo = {
30840 { (JSJitGetterOp)passNullableUnionWithDefaultValue15 },
30841 { prototypes::id::TestJSImplInterface },
30842 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30843 JSJitInfo::Method,
30844 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30845 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30846 false, /* isInfallible. False in setters. */
30847 false, /* isMovable. Not relevant for setters. */
30848 false, /* isEliminatable. Not relevant for setters. */
30849 false, /* isAlwaysInSlot. Only relevant for getters. */
30850 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30851 false, /* isTypedMethod. Only relevant for methods. */
30852 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30853};
30854
30855MOZ_CAN_RUN_SCRIPT static bool
30856passNullableUnionWithDefaultValue16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30857{
30858 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue16");
30859 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30862( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30860 "TestJSImplInterface", "passNullableUnionWithDefaultValue16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30862( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30861 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30862( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30862 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30862( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue16", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30863
30864 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30865 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30866 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30867 if (objIsXray) {
30868 unwrappedObj.emplace(cx, obj);
30869 }
30870 Nullable<DoubleOrByteString > arg0;
30871 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
30872 arg0.SetNull();
30873 } else {
30874 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30875 return false;
30876 }
30877 }
30878 if (objIsXray) {
30879 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30880 // we know Xrays have no dynamic unwrap behavior.
30881 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30882 if (!unwrappedObj.ref()) {
30883 return false;
30884 }
30885 }
30886 FastErrorResult rv;
30887 // NOTE: This assert does NOT call the function.
30888 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30889 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue16(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30890 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue16"
)), 0))
) {
30891 return false;
30892 }
30893 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30893); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30893; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30894 args.rval().setUndefined();
30895 return true;
30896}
30897
30898static const JSJitInfo passNullableUnionWithDefaultValue16_methodinfo = {
30899 { (JSJitGetterOp)passNullableUnionWithDefaultValue16 },
30900 { prototypes::id::TestJSImplInterface },
30901 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30902 JSJitInfo::Method,
30903 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30904 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30905 false, /* isInfallible. False in setters. */
30906 false, /* isMovable. Not relevant for setters. */
30907 false, /* isEliminatable. Not relevant for setters. */
30908 false, /* isAlwaysInSlot. Only relevant for getters. */
30909 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30910 false, /* isTypedMethod. Only relevant for methods. */
30911 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30912};
30913
30914MOZ_CAN_RUN_SCRIPT static bool
30915passNullableUnionWithDefaultValue17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30916{
30917 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue17");
30918 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30921( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30919 "TestJSImplInterface", "passNullableUnionWithDefaultValue17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30921( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30920 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30921( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30921 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30921( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue17", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30922
30923 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30924 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30925 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30926 if (objIsXray) {
30927 unwrappedObj.emplace(cx, obj);
30928 }
30929 Nullable<DoubleOrSupportedType > arg0;
30930 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30931 arg0.SetNull();
30932 } else {
30933 if (!(args.hasDefined(0))) {
30934 arg0.SetValue().RawSetAsSupportedType() = SupportedType::Text_html;
30935 } else {
30936 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
30937 return false;
30938 }
30939 }
30940 }
30941 if (objIsXray) {
30942 // Since our object is an Xray, we can just CheckedUnwrapStatic:
30943 // we know Xrays have no dynamic unwrap behavior.
30944 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
30945 if (!unwrappedObj.ref()) {
30946 return false;
30947 }
30948 }
30949 FastErrorResult rv;
30950 // NOTE: This assert does NOT call the function.
30951 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
30952 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
30953 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue17"
)), 0))
) {
30954 return false;
30955 }
30956 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 30956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 30956; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
30957 args.rval().setUndefined();
30958 return true;
30959}
30960
30961static const JSJitInfo passNullableUnionWithDefaultValue17_methodinfo = {
30962 { (JSJitGetterOp)passNullableUnionWithDefaultValue17 },
30963 { prototypes::id::TestJSImplInterface },
30964 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
30965 JSJitInfo::Method,
30966 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
30967 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
30968 false, /* isInfallible. False in setters. */
30969 false, /* isMovable. Not relevant for setters. */
30970 false, /* isEliminatable. Not relevant for setters. */
30971 false, /* isAlwaysInSlot. Only relevant for getters. */
30972 false, /* isLazilyCachedInSlot. Only relevant for getters. */
30973 false, /* isTypedMethod. Only relevant for methods. */
30974 0 /* Reserved slot index, if we're stored in a slot, else 0. */
30975};
30976
30977MOZ_CAN_RUN_SCRIPT static bool
30978passNullableUnionWithDefaultValue18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
30979{
30980 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue18");
30981 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject30984( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30982 "TestJSImplInterface", "passNullableUnionWithDefaultValue18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject30984( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30983 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject30984( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
30984 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject30984( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue18", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
30985
30986 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
30987 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
30988 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
30989 if (objIsXray) {
30990 unwrappedObj.emplace(cx, obj);
30991 }
30992 Nullable<DoubleOrSupportedType > arg0;
30993 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
30994 arg0.SetNull();
30995 } else {
30996 if (!(args.hasDefined(0))) {
30997 arg0.SetValue().RawSetAsDouble() = 1.0;
30998 } else {
30999 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31000 return false;
31001 }
31002 }
31003 }
31004 if (objIsXray) {
31005 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31006 // we know Xrays have no dynamic unwrap behavior.
31007 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31008 if (!unwrappedObj.ref()) {
31009 return false;
31010 }
31011 }
31012 FastErrorResult rv;
31013 // NOTE: This assert does NOT call the function.
31014 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31015 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31016 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue18"
)), 0))
) {
31017 return false;
31018 }
31019 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31019); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31019; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31020 args.rval().setUndefined();
31021 return true;
31022}
31023
31024static const JSJitInfo passNullableUnionWithDefaultValue18_methodinfo = {
31025 { (JSJitGetterOp)passNullableUnionWithDefaultValue18 },
31026 { prototypes::id::TestJSImplInterface },
31027 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31028 JSJitInfo::Method,
31029 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31030 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31031 false, /* isInfallible. False in setters. */
31032 false, /* isMovable. Not relevant for setters. */
31033 false, /* isEliminatable. Not relevant for setters. */
31034 false, /* isAlwaysInSlot. Only relevant for getters. */
31035 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31036 false, /* isTypedMethod. Only relevant for methods. */
31037 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31038};
31039
31040MOZ_CAN_RUN_SCRIPT static bool
31041passNullableUnionWithDefaultValue19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31042{
31043 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue19");
31044 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31047( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31045 "TestJSImplInterface", "passNullableUnionWithDefaultValue19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31047( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31046 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31047( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31047 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31047( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue19", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31048
31049 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31050 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31051 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31052 if (objIsXray) {
31053 unwrappedObj.emplace(cx, obj);
31054 }
31055 Nullable<DoubleOrSupportedType > arg0;
31056 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31057 arg0.SetNull();
31058 } else {
31059 if (!(args.hasDefined(0))) {
31060 arg0.SetValue().RawSetAsDouble() = 1.5;
31061 } else {
31062 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31063 return false;
31064 }
31065 }
31066 }
31067 if (objIsXray) {
31068 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31069 // we know Xrays have no dynamic unwrap behavior.
31070 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31071 if (!unwrappedObj.ref()) {
31072 return false;
31073 }
31074 }
31075 FastErrorResult rv;
31076 // NOTE: This assert does NOT call the function.
31077 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31078 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31079 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue19"
)), 0))
) {
31080 return false;
31081 }
31082 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31082; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31083 args.rval().setUndefined();
31084 return true;
31085}
31086
31087static const JSJitInfo passNullableUnionWithDefaultValue19_methodinfo = {
31088 { (JSJitGetterOp)passNullableUnionWithDefaultValue19 },
31089 { prototypes::id::TestJSImplInterface },
31090 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31091 JSJitInfo::Method,
31092 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31093 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31094 false, /* isInfallible. False in setters. */
31095 false, /* isMovable. Not relevant for setters. */
31096 false, /* isEliminatable. Not relevant for setters. */
31097 false, /* isAlwaysInSlot. Only relevant for getters. */
31098 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31099 false, /* isTypedMethod. Only relevant for methods. */
31100 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31101};
31102
31103MOZ_CAN_RUN_SCRIPT static bool
31104passNullableUnionWithDefaultValue20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31105{
31106 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue20");
31107 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31110( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31108 "TestJSImplInterface", "passNullableUnionWithDefaultValue20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31110( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31109 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31110( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31110 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31110( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue20", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31111
31112 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31113 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31114 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31115 if (objIsXray) {
31116 unwrappedObj.emplace(cx, obj);
31117 }
31118 Nullable<DoubleOrSupportedType > arg0;
31119 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31120 arg0.SetNull();
31121 } else {
31122 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31123 return false;
31124 }
31125 }
31126 if (objIsXray) {
31127 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31128 // we know Xrays have no dynamic unwrap behavior.
31129 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31130 if (!unwrappedObj.ref()) {
31131 return false;
31132 }
31133 }
31134 FastErrorResult rv;
31135 // NOTE: This assert does NOT call the function.
31136 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31137 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31138 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue20"
)), 0))
) {
31139 return false;
31140 }
31141 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31141; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31142 args.rval().setUndefined();
31143 return true;
31144}
31145
31146static const JSJitInfo passNullableUnionWithDefaultValue20_methodinfo = {
31147 { (JSJitGetterOp)passNullableUnionWithDefaultValue20 },
31148 { prototypes::id::TestJSImplInterface },
31149 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31150 JSJitInfo::Method,
31151 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31152 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31153 false, /* isInfallible. False in setters. */
31154 false, /* isMovable. Not relevant for setters. */
31155 false, /* isEliminatable. Not relevant for setters. */
31156 false, /* isAlwaysInSlot. Only relevant for getters. */
31157 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31158 false, /* isTypedMethod. Only relevant for methods. */
31159 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31160};
31161
31162MOZ_CAN_RUN_SCRIPT static bool
31163passNullableUnionWithDefaultValue21(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31164{
31165 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue21");
31166 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31169( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31167 "TestJSImplInterface", "passNullableUnionWithDefaultValue21", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31169( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31168 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31169( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31169 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31169( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue21", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31170
31171 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31172 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31173 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31174 if (objIsXray) {
31175 unwrappedObj.emplace(cx, obj);
31176 }
31177 Nullable<DoubleOrUSVString > arg0;
31178 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31179 arg0.SetNull();
31180 } else {
31181 if (!(args.hasDefined(0))) {
31182 arg0.SetValue().SetStringLiteral(u"abc");
31183 } else {
31184 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31185 return false;
31186 }
31187 }
31188 }
31189 if (objIsXray) {
31190 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31191 // we know Xrays have no dynamic unwrap behavior.
31192 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31193 if (!unwrappedObj.ref()) {
31194 return false;
31195 }
31196 }
31197 FastErrorResult rv;
31198 // NOTE: This assert does NOT call the function.
31199 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31200 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue21(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31201 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue21"
)), 0))
) {
31202 return false;
31203 }
31204 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31204); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31204; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31205 args.rval().setUndefined();
31206 return true;
31207}
31208
31209static const JSJitInfo passNullableUnionWithDefaultValue21_methodinfo = {
31210 { (JSJitGetterOp)passNullableUnionWithDefaultValue21 },
31211 { prototypes::id::TestJSImplInterface },
31212 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31213 JSJitInfo::Method,
31214 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31215 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31216 false, /* isInfallible. False in setters. */
31217 false, /* isMovable. Not relevant for setters. */
31218 false, /* isEliminatable. Not relevant for setters. */
31219 false, /* isAlwaysInSlot. Only relevant for getters. */
31220 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31221 false, /* isTypedMethod. Only relevant for methods. */
31222 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31223};
31224
31225MOZ_CAN_RUN_SCRIPT static bool
31226passNullableUnionWithDefaultValue22(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31227{
31228 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue22");
31229 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31232( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31230 "TestJSImplInterface", "passNullableUnionWithDefaultValue22", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31232( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31231 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31232( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31232 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31232( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue22", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31233
31234 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31235 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31236 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31237 if (objIsXray) {
31238 unwrappedObj.emplace(cx, obj);
31239 }
31240 Nullable<DoubleOrUSVString > arg0;
31241 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31242 arg0.SetNull();
31243 } else {
31244 if (!(args.hasDefined(0))) {
31245 arg0.SetValue().RawSetAsDouble() = 1.0;
31246 } else {
31247 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31248 return false;
31249 }
31250 }
31251 }
31252 if (objIsXray) {
31253 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31254 // we know Xrays have no dynamic unwrap behavior.
31255 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31256 if (!unwrappedObj.ref()) {
31257 return false;
31258 }
31259 }
31260 FastErrorResult rv;
31261 // NOTE: This assert does NOT call the function.
31262 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31263 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue22(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31264 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue22"
)), 0))
) {
31265 return false;
31266 }
31267 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31267); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31267; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31268 args.rval().setUndefined();
31269 return true;
31270}
31271
31272static const JSJitInfo passNullableUnionWithDefaultValue22_methodinfo = {
31273 { (JSJitGetterOp)passNullableUnionWithDefaultValue22 },
31274 { prototypes::id::TestJSImplInterface },
31275 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31276 JSJitInfo::Method,
31277 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31278 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31279 false, /* isInfallible. False in setters. */
31280 false, /* isMovable. Not relevant for setters. */
31281 false, /* isEliminatable. Not relevant for setters. */
31282 false, /* isAlwaysInSlot. Only relevant for getters. */
31283 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31284 false, /* isTypedMethod. Only relevant for methods. */
31285 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31286};
31287
31288MOZ_CAN_RUN_SCRIPT static bool
31289passNullableUnionWithDefaultValue23(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31290{
31291 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue23");
31292 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31295( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31293 "TestJSImplInterface", "passNullableUnionWithDefaultValue23", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31295( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31294 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31295( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31295 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31295( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue23", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31296
31297 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31298 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31299 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31300 if (objIsXray) {
31301 unwrappedObj.emplace(cx, obj);
31302 }
31303 Nullable<DoubleOrUSVString > arg0;
31304 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31305 arg0.SetNull();
31306 } else {
31307 if (!(args.hasDefined(0))) {
31308 arg0.SetValue().RawSetAsDouble() = 1.5;
31309 } else {
31310 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31311 return false;
31312 }
31313 }
31314 }
31315 if (objIsXray) {
31316 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31317 // we know Xrays have no dynamic unwrap behavior.
31318 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31319 if (!unwrappedObj.ref()) {
31320 return false;
31321 }
31322 }
31323 FastErrorResult rv;
31324 // NOTE: This assert does NOT call the function.
31325 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31326 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue23(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31327 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue23"
)), 0))
) {
31328 return false;
31329 }
31330 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31330); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31330; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31331 args.rval().setUndefined();
31332 return true;
31333}
31334
31335static const JSJitInfo passNullableUnionWithDefaultValue23_methodinfo = {
31336 { (JSJitGetterOp)passNullableUnionWithDefaultValue23 },
31337 { prototypes::id::TestJSImplInterface },
31338 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31339 JSJitInfo::Method,
31340 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31341 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31342 false, /* isInfallible. False in setters. */
31343 false, /* isMovable. Not relevant for setters. */
31344 false, /* isEliminatable. Not relevant for setters. */
31345 false, /* isAlwaysInSlot. Only relevant for getters. */
31346 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31347 false, /* isTypedMethod. Only relevant for methods. */
31348 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31349};
31350
31351MOZ_CAN_RUN_SCRIPT static bool
31352passNullableUnionWithDefaultValue24(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31353{
31354 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue24");
31355 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31358( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31356 "TestJSImplInterface", "passNullableUnionWithDefaultValue24", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31358( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31357 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31358( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31358 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31358( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue24", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31359
31360 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31361 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31362 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31363 if (objIsXray) {
31364 unwrappedObj.emplace(cx, obj);
31365 }
31366 Nullable<DoubleOrUSVString > arg0;
31367 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31368 arg0.SetNull();
31369 } else {
31370 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31371 return false;
31372 }
31373 }
31374 if (objIsXray) {
31375 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31376 // we know Xrays have no dynamic unwrap behavior.
31377 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31378 if (!unwrappedObj.ref()) {
31379 return false;
31380 }
31381 }
31382 FastErrorResult rv;
31383 // NOTE: This assert does NOT call the function.
31384 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31385 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue24(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31386 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue24"
)), 0))
) {
31387 return false;
31388 }
31389 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31389); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31389; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31390 args.rval().setUndefined();
31391 return true;
31392}
31393
31394static const JSJitInfo passNullableUnionWithDefaultValue24_methodinfo = {
31395 { (JSJitGetterOp)passNullableUnionWithDefaultValue24 },
31396 { prototypes::id::TestJSImplInterface },
31397 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31398 JSJitInfo::Method,
31399 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31400 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31401 false, /* isInfallible. False in setters. */
31402 false, /* isMovable. Not relevant for setters. */
31403 false, /* isEliminatable. Not relevant for setters. */
31404 false, /* isAlwaysInSlot. Only relevant for getters. */
31405 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31406 false, /* isTypedMethod. Only relevant for methods. */
31407 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31408};
31409
31410MOZ_CAN_RUN_SCRIPT static bool
31411passNullableUnionWithDefaultValue25(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31412{
31413 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue25");
31414 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31417( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31415 "TestJSImplInterface", "passNullableUnionWithDefaultValue25", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31417( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31416 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31417( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31417 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31417( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue25", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31418
31419 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31420 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31421 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31422 if (objIsXray) {
31423 unwrappedObj.emplace(cx, obj);
31424 }
31425 Nullable<DoubleOrUTF8String > arg0;
31426 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31427 arg0.SetNull();
31428 } else {
31429 if (!(args.hasDefined(0))) {
31430 arg0.SetValue().SetStringLiteral("");
31431 } else {
31432 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31433 return false;
31434 }
31435 }
31436 }
31437 if (objIsXray) {
31438 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31439 // we know Xrays have no dynamic unwrap behavior.
31440 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31441 if (!unwrappedObj.ref()) {
31442 return false;
31443 }
31444 }
31445 FastErrorResult rv;
31446 // NOTE: This assert does NOT call the function.
31447 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31448 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue25(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31449 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue25"
)), 0))
) {
31450 return false;
31451 }
31452 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31452); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31452; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31453 args.rval().setUndefined();
31454 return true;
31455}
31456
31457static const JSJitInfo passNullableUnionWithDefaultValue25_methodinfo = {
31458 { (JSJitGetterOp)passNullableUnionWithDefaultValue25 },
31459 { prototypes::id::TestJSImplInterface },
31460 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31461 JSJitInfo::Method,
31462 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31463 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31464 false, /* isInfallible. False in setters. */
31465 false, /* isMovable. Not relevant for setters. */
31466 false, /* isEliminatable. Not relevant for setters. */
31467 false, /* isAlwaysInSlot. Only relevant for getters. */
31468 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31469 false, /* isTypedMethod. Only relevant for methods. */
31470 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31471};
31472
31473MOZ_CAN_RUN_SCRIPT static bool
31474passNullableUnionWithDefaultValue26(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31475{
31476 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue26");
31477 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31480( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31478 "TestJSImplInterface", "passNullableUnionWithDefaultValue26", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31480( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31479 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31480( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31480 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31480( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue26", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31481
31482 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31483 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31484 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31485 if (objIsXray) {
31486 unwrappedObj.emplace(cx, obj);
31487 }
31488 Nullable<DoubleOrUTF8String > arg0;
31489 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31490 arg0.SetNull();
31491 } else {
31492 if (!(args.hasDefined(0))) {
31493 arg0.SetValue().RawSetAsDouble() = 1.0;
31494 } else {
31495 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31496 return false;
31497 }
31498 }
31499 }
31500 if (objIsXray) {
31501 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31502 // we know Xrays have no dynamic unwrap behavior.
31503 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31504 if (!unwrappedObj.ref()) {
31505 return false;
31506 }
31507 }
31508 FastErrorResult rv;
31509 // NOTE: This assert does NOT call the function.
31510 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31511 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue26(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31512 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue26"
)), 0))
) {
31513 return false;
31514 }
31515 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31515); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31515; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31516 args.rval().setUndefined();
31517 return true;
31518}
31519
31520static const JSJitInfo passNullableUnionWithDefaultValue26_methodinfo = {
31521 { (JSJitGetterOp)passNullableUnionWithDefaultValue26 },
31522 { prototypes::id::TestJSImplInterface },
31523 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31524 JSJitInfo::Method,
31525 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31526 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31527 false, /* isInfallible. False in setters. */
31528 false, /* isMovable. Not relevant for setters. */
31529 false, /* isEliminatable. Not relevant for setters. */
31530 false, /* isAlwaysInSlot. Only relevant for getters. */
31531 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31532 false, /* isTypedMethod. Only relevant for methods. */
31533 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31534};
31535
31536MOZ_CAN_RUN_SCRIPT static bool
31537passNullableUnionWithDefaultValue27(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31538{
31539 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue27");
31540 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31543( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31541 "TestJSImplInterface", "passNullableUnionWithDefaultValue27", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31543( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31542 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31543( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31543 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31543( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue27", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31544
31545 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31546 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31547 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31548 if (objIsXray) {
31549 unwrappedObj.emplace(cx, obj);
31550 }
31551 Nullable<DoubleOrUTF8String > arg0;
31552 if ((args.hasDefined(0)) && args[0].isNullOrUndefined()) {
31553 arg0.SetNull();
31554 } else {
31555 if (!(args.hasDefined(0))) {
31556 arg0.SetValue().RawSetAsDouble() = 1.5;
31557 } else {
31558 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31559 return false;
31560 }
31561 }
31562 }
31563 if (objIsXray) {
31564 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31565 // we know Xrays have no dynamic unwrap behavior.
31566 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31567 if (!unwrappedObj.ref()) {
31568 return false;
31569 }
31570 }
31571 FastErrorResult rv;
31572 // NOTE: This assert does NOT call the function.
31573 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31574 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue27(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31575 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue27"
)), 0))
) {
31576 return false;
31577 }
31578 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31578); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31578; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31579 args.rval().setUndefined();
31580 return true;
31581}
31582
31583static const JSJitInfo passNullableUnionWithDefaultValue27_methodinfo = {
31584 { (JSJitGetterOp)passNullableUnionWithDefaultValue27 },
31585 { prototypes::id::TestJSImplInterface },
31586 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31587 JSJitInfo::Method,
31588 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31589 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31590 false, /* isInfallible. False in setters. */
31591 false, /* isMovable. Not relevant for setters. */
31592 false, /* isEliminatable. Not relevant for setters. */
31593 false, /* isAlwaysInSlot. Only relevant for getters. */
31594 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31595 false, /* isTypedMethod. Only relevant for methods. */
31596 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31597};
31598
31599MOZ_CAN_RUN_SCRIPT static bool
31600passNullableUnionWithDefaultValue28(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31601{
31602 BindingCallContext cx(cx_, "TestJSImplInterface.passNullableUnionWithDefaultValue28");
31603 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31606( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31604 "TestJSImplInterface", "passNullableUnionWithDefaultValue28", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31606( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31605 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31606( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31606 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31606( cx, "TestJSImplInterface"
, "passNullableUnionWithDefaultValue28", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31607
31608 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31609 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31610 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31611 if (objIsXray) {
31612 unwrappedObj.emplace(cx, obj);
31613 }
31614 Nullable<DoubleOrUTF8String > arg0;
31615 if (!(args.hasDefined(0)) || args[0].isNullOrUndefined()) {
31616 arg0.SetNull();
31617 } else {
31618 if (!arg0.SetValue().Init(cx, args[0], "Argument 1", true)) {
31619 return false;
31620 }
31621 }
31622 if (objIsXray) {
31623 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31624 // we know Xrays have no dynamic unwrap behavior.
31625 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31626 if (!unwrappedObj.ref()) {
31627 return false;
31628 }
31629 }
31630 FastErrorResult rv;
31631 // NOTE: This assert does NOT call the function.
31632 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31633 MOZ_KnownLive(self)(self)->PassNullableUnionWithDefaultValue28(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31634 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passNullableUnionWithDefaultValue28"
)), 0))
) {
31635 return false;
31636 }
31637 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31637); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31637; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31638 args.rval().setUndefined();
31639 return true;
31640}
31641
31642static const JSJitInfo passNullableUnionWithDefaultValue28_methodinfo = {
31643 { (JSJitGetterOp)passNullableUnionWithDefaultValue28 },
31644 { prototypes::id::TestJSImplInterface },
31645 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31646 JSJitInfo::Method,
31647 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31648 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31649 false, /* isInfallible. False in setters. */
31650 false, /* isMovable. Not relevant for setters. */
31651 false, /* isEliminatable. Not relevant for setters. */
31652 false, /* isAlwaysInSlot. Only relevant for getters. */
31653 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31654 false, /* isTypedMethod. Only relevant for methods. */
31655 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31656};
31657
31658MOZ_CAN_RUN_SCRIPT static bool
31659passSequenceOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31660{
31661 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions");
31662 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31665( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31663 "TestJSImplInterface", "passSequenceOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31665( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31664 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31665( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31665 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31665( cx, "TestJSImplInterface"
, "passSequenceOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31666
31667 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31668 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfUnions", 1)) {
31669 return false;
31670 }
31671 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31672 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31673 if (objIsXray) {
31674 unwrappedObj.emplace(cx, obj);
31675 }
31676 binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0;
31677 if (args[0].isObject()) {
31678 JS::ForOfIterator iter(cx);
31679 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
31680 return false;
31681 }
31682 if (!iter.valueIsIterable()) {
31683 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31684 return false;
31685 }
31686 binding_detail::AutoSequence<OwningCanvasPatternOrCanvasGradient> &arr = arg0;
31687 JS::Rooted<JS::Value> temp(cx);
31688 while (true) {
31689 bool done;
31690 if (!iter.next(&temp, &done)) {
31691 return false;
31692 }
31693 if (done) {
31694 break;
31695 }
31696 OwningCanvasPatternOrCanvasGradient* slotPtr = arr.AppendElement(mozilla::fallible);
31697 if (!slotPtr) {
31698 JS_ReportOutOfMemory(cx);
31699 return false;
31700 }
31701 OwningCanvasPatternOrCanvasGradient& slot = *slotPtr;
31702 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
31703 return false;
31704 }
31705 }
31706 } else {
31707 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31708 return false;
31709 }
31710 if (objIsXray) {
31711 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31712 // we know Xrays have no dynamic unwrap behavior.
31713 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31714 if (!unwrappedObj.ref()) {
31715 return false;
31716 }
31717 }
31718 FastErrorResult rv;
31719 // NOTE: This assert does NOT call the function.
31720 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31721 MOZ_KnownLive(self)(self)->PassSequenceOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31722 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions"
)), 0))
) {
31723 return false;
31724 }
31725 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31725); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31725; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31726 args.rval().setUndefined();
31727 return true;
31728}
31729
31730static const JSJitInfo passSequenceOfUnions_methodinfo = {
31731 { (JSJitGetterOp)passSequenceOfUnions },
31732 { prototypes::id::TestJSImplInterface },
31733 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31734 JSJitInfo::Method,
31735 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31736 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31737 false, /* isInfallible. False in setters. */
31738 false, /* isMovable. Not relevant for setters. */
31739 false, /* isEliminatable. Not relevant for setters. */
31740 false, /* isAlwaysInSlot. Only relevant for getters. */
31741 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31742 false, /* isTypedMethod. Only relevant for methods. */
31743 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31744};
31745
31746MOZ_CAN_RUN_SCRIPT static bool
31747passSequenceOfUnions2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31748{
31749 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfUnions2");
31750 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31753( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31751 "TestJSImplInterface", "passSequenceOfUnions2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31753( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31752 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31753( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31753 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31753( cx, "TestJSImplInterface"
, "passSequenceOfUnions2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31754
31755 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31756 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfUnions2", 1)) {
31757 return false;
31758 }
31759 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31760 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31761 if (objIsXray) {
31762 unwrappedObj.emplace(cx, obj);
31763 }
31764 binding_detail::AutoSequence<OwningObjectOrLong> arg0;
31765 SequenceRooter<OwningObjectOrLong> arg0_holder(cx, &arg0);
31766 if (args[0].isObject()) {
31767 JS::ForOfIterator iter(cx);
31768 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
31769 return false;
31770 }
31771 if (!iter.valueIsIterable()) {
31772 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31773 return false;
31774 }
31775 binding_detail::AutoSequence<OwningObjectOrLong> &arr = arg0;
31776 JS::Rooted<JS::Value> temp(cx);
31777 while (true) {
31778 bool done;
31779 if (!iter.next(&temp, &done)) {
31780 return false;
31781 }
31782 if (done) {
31783 break;
31784 }
31785 OwningObjectOrLong* slotPtr = arr.AppendElement(mozilla::fallible);
31786 if (!slotPtr) {
31787 JS_ReportOutOfMemory(cx);
31788 return false;
31789 }
31790 OwningObjectOrLong& slot = *slotPtr;
31791 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
31792 return false;
31793 }
31794 }
31795 } else {
31796 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31797 return false;
31798 }
31799 if (objIsXray) {
31800 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31801 // we know Xrays have no dynamic unwrap behavior.
31802 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31803 if (!unwrappedObj.ref()) {
31804 return false;
31805 }
31806 }
31807 FastErrorResult rv;
31808 // NOTE: This assert does NOT call the function.
31809 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfUnions2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31810 MOZ_KnownLive(self)(self)->PassSequenceOfUnions2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31811 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfUnions2"
)), 0))
) {
31812 return false;
31813 }
31814 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31814); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31814; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31815 args.rval().setUndefined();
31816 return true;
31817}
31818
31819static const JSJitInfo passSequenceOfUnions2_methodinfo = {
31820 { (JSJitGetterOp)passSequenceOfUnions2 },
31821 { prototypes::id::TestJSImplInterface },
31822 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31823 JSJitInfo::Method,
31824 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31825 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31826 false, /* isInfallible. False in setters. */
31827 false, /* isMovable. Not relevant for setters. */
31828 false, /* isEliminatable. Not relevant for setters. */
31829 false, /* isAlwaysInSlot. Only relevant for getters. */
31830 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31831 false, /* isTypedMethod. Only relevant for methods. */
31832 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31833};
31834
31835MOZ_CAN_RUN_SCRIPT static bool
31836passVariadicUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31837{
31838 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicUnion");
31839 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31842( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31840 "TestJSImplInterface", "passVariadicUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31842( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31841 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31842( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
31842 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31842( cx, "TestJSImplInterface"
, "passVariadicUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
31843
31844 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31845 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31846 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31847 if (objIsXray) {
31848 unwrappedObj.emplace(cx, obj);
31849 }
31850 AutoSequence<OwningCanvasPatternOrCanvasGradient> arg0;
31851 if (args.length() > 0) {
31852 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
31853 JS_ReportOutOfMemory(cx);
31854 return false;
31855 }
31856 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
31857 // OK to do infallible append here, since we ensured capacity already.
31858 OwningCanvasPatternOrCanvasGradient& slot = *arg0.AppendElement();
31859 if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) {
31860 return false;
31861 }
31862 }
31863 }
31864 if (objIsXray) {
31865 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31866 // we know Xrays have no dynamic unwrap behavior.
31867 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31868 if (!unwrappedObj.ref()) {
31869 return false;
31870 }
31871 }
31872 FastErrorResult rv;
31873 // NOTE: This assert does NOT call the function.
31874 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31875 MOZ_KnownLive(self)(self)->PassVariadicUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31876 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicUnion"
)), 0))
) {
31877 return false;
31878 }
31879 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31879; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31880 args.rval().setUndefined();
31881 return true;
31882}
31883
31884static const JSJitInfo passVariadicUnion_methodinfo = {
31885 { (JSJitGetterOp)passVariadicUnion },
31886 { prototypes::id::TestJSImplInterface },
31887 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31888 JSJitInfo::Method,
31889 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31890 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31891 false, /* isInfallible. False in setters. */
31892 false, /* isMovable. Not relevant for setters. */
31893 false, /* isEliminatable. Not relevant for setters. */
31894 false, /* isAlwaysInSlot. Only relevant for getters. */
31895 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31896 false, /* isTypedMethod. Only relevant for methods. */
31897 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31898};
31899
31900MOZ_CAN_RUN_SCRIPT static bool
31901passSequenceOfNullableUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31902{
31903 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfNullableUnions");
31904 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31907( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31905 "TestJSImplInterface", "passSequenceOfNullableUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31907( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31906 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31907( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31907 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31907( cx, "TestJSImplInterface"
, "passSequenceOfNullableUnions", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
31908
31909 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
31910 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfNullableUnions", 1)) {
31911 return false;
31912 }
31913 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
31914 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
31915 if (objIsXray) {
31916 unwrappedObj.emplace(cx, obj);
31917 }
31918 binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0;
31919 if (args[0].isObject()) {
31920 JS::ForOfIterator iter(cx);
31921 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
31922 return false;
31923 }
31924 if (!iter.valueIsIterable()) {
31925 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31926 return false;
31927 }
31928 binding_detail::AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> &arr = arg0;
31929 JS::Rooted<JS::Value> temp(cx);
31930 while (true) {
31931 bool done;
31932 if (!iter.next(&temp, &done)) {
31933 return false;
31934 }
31935 if (done) {
31936 break;
31937 }
31938 Nullable<OwningCanvasPatternOrCanvasGradient >* slotPtr = arr.AppendElement(mozilla::fallible);
31939 if (!slotPtr) {
31940 JS_ReportOutOfMemory(cx);
31941 return false;
31942 }
31943 Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *slotPtr;
31944 if (temp.isNullOrUndefined()) {
31945 slot.SetNull();
31946 } else {
31947 if (!slot.SetValue().Init(cx, temp, "Element of argument 1", true)) {
31948 return false;
31949 }
31950 }
31951 }
31952 } else {
31953 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
31954 return false;
31955 }
31956 if (objIsXray) {
31957 // Since our object is an Xray, we can just CheckedUnwrapStatic:
31958 // we know Xrays have no dynamic unwrap behavior.
31959 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
31960 if (!unwrappedObj.ref()) {
31961 return false;
31962 }
31963 }
31964 FastErrorResult rv;
31965 // NOTE: This assert does NOT call the function.
31966 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfNullableUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
31967 MOZ_KnownLive(self)(self)->PassSequenceOfNullableUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
31968 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfNullableUnions"
)), 0))
) {
31969 return false;
31970 }
31971 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 31971); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 31971; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
31972 args.rval().setUndefined();
31973 return true;
31974}
31975
31976static const JSJitInfo passSequenceOfNullableUnions_methodinfo = {
31977 { (JSJitGetterOp)passSequenceOfNullableUnions },
31978 { prototypes::id::TestJSImplInterface },
31979 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
31980 JSJitInfo::Method,
31981 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
31982 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
31983 false, /* isInfallible. False in setters. */
31984 false, /* isMovable. Not relevant for setters. */
31985 false, /* isEliminatable. Not relevant for setters. */
31986 false, /* isAlwaysInSlot. Only relevant for getters. */
31987 false, /* isLazilyCachedInSlot. Only relevant for getters. */
31988 false, /* isTypedMethod. Only relevant for methods. */
31989 0 /* Reserved slot index, if we're stored in a slot, else 0. */
31990};
31991
31992MOZ_CAN_RUN_SCRIPT static bool
31993passVariadicNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
31994{
31995 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicNullableUnion");
31996 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31997 "TestJSImplInterface", "passVariadicNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31998 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
31999 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject31999( cx, "TestJSImplInterface"
, "passVariadicNullableUnion", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32000
32001 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32002 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32003 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32004 if (objIsXray) {
32005 unwrappedObj.emplace(cx, obj);
32006 }
32007 AutoSequence<Nullable<OwningCanvasPatternOrCanvasGradient >> arg0;
32008 if (args.length() > 0) {
32009 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
32010 JS_ReportOutOfMemory(cx);
32011 return false;
32012 }
32013 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
32014 // OK to do infallible append here, since we ensured capacity already.
32015 Nullable<OwningCanvasPatternOrCanvasGradient >& slot = *arg0.AppendElement();
32016 if (args[variadicArg].isNullOrUndefined()) {
32017 slot.SetNull();
32018 } else {
32019 if (!slot.SetValue().Init(cx, args[variadicArg], "Argument 1", true)) {
32020 return false;
32021 }
32022 }
32023 }
32024 }
32025 if (objIsXray) {
32026 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32027 // we know Xrays have no dynamic unwrap behavior.
32028 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32029 if (!unwrappedObj.ref()) {
32030 return false;
32031 }
32032 }
32033 FastErrorResult rv;
32034 // NOTE: This assert does NOT call the function.
32035 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32036 MOZ_KnownLive(self)(self)->PassVariadicNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32037 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicNullableUnion"
)), 0))
) {
32038 return false;
32039 }
32040 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32040); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32040; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32041 args.rval().setUndefined();
32042 return true;
32043}
32044
32045static const JSJitInfo passVariadicNullableUnion_methodinfo = {
32046 { (JSJitGetterOp)passVariadicNullableUnion },
32047 { prototypes::id::TestJSImplInterface },
32048 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32049 JSJitInfo::Method,
32050 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32051 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32052 false, /* isInfallible. False in setters. */
32053 false, /* isMovable. Not relevant for setters. */
32054 false, /* isEliminatable. Not relevant for setters. */
32055 false, /* isAlwaysInSlot. Only relevant for getters. */
32056 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32057 false, /* isTypedMethod. Only relevant for methods. */
32058 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32059};
32060
32061MOZ_CAN_RUN_SCRIPT static bool
32062passRecordOfUnions(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32063{
32064 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfUnions");
32065 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32068( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32066 "TestJSImplInterface", "passRecordOfUnions", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32068( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32067 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32068( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32068 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32068( cx, "TestJSImplInterface"
, "passRecordOfUnions", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32069
32070 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32071 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfUnions", 1)) {
32072 return false;
32073 }
32074 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32075 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32076 if (objIsXray) {
32077 unwrappedObj.emplace(cx, obj);
32078 }
32079 Record<nsString, OwningCanvasPatternOrCanvasGradient> arg0;
32080 if (args[0].isObject()) {
32081 auto& recordEntries = arg0.Entries();
32082
32083 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
32084 JS::RootedVector<jsid> ids(cx);
32085 if (!js::GetPropertyKeys(cx, recordObj,
32086 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
32087 return false;
32088 }
32089 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
32090 JS_ReportOutOfMemory(cx);
32091 return false;
32092 }
32093 JS::Rooted<JS::Value> propNameValue(cx);
32094 JS::Rooted<JS::Value> temp(cx);
32095 JS::Rooted<jsid> curId(cx);
32096 JS::Rooted<JS::Value> idVal(cx);
32097 // Use a hashset to keep track of ids seen, to avoid
32098 // introducing nasty O(N^2) behavior scanning for them all the
32099 // time. Ideally we'd use a data structure with O(1) lookup
32100 // _and_ ordering for the MozMap, but we don't have one lying
32101 // around.
32102 nsTHashtable<nsStringHashKey> idsSeen;
32103 for (size_t i = 0; i < ids.length(); ++i) {
32104 curId = ids[i];
32105
32106 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
32107 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
32108 &desc)) {
32109 return false;
32110 }
32111
32112 if (desc.isNothing() || !desc->enumerable()) {
32113 continue;
32114 }
32115
32116 idVal = js::IdToValue(curId);
32117 nsString propName;
32118 // This will just throw if idVal is a Symbol, like the spec says
32119 // to do.
32120 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
32121 return false;
32122 }
32123
32124 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
32125 return false;
32126 }
32127
32128 Record<nsString, OwningCanvasPatternOrCanvasGradient>::EntryType* entry;
32129 if (!idsSeen.EnsureInserted(propName)) {
32130 // Find the existing entry.
32131 auto idx = recordEntries.IndexOf(propName);
32132 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 32133); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 32133; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
32133 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 32133); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 32133; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
32134 // Now blow it away to make it look like it was just added
32135 // to the array, because it's not obvious that it's
32136 // safe to write to its already-initialized mValue via our
32137 // normal codegen conversions. For example, the value
32138 // could be a union and this would change its type, but
32139 // codegen assumes we won't do that.
32140 entry = recordEntries.ReconstructElementAt(idx);
32141 } else {
32142 // Safe to do an infallible append here, because we did a
32143 // SetCapacity above to the right capacity.
32144 entry = recordEntries.AppendElement();
32145 }
32146 entry->mKey = propName;
32147 OwningCanvasPatternOrCanvasGradient& slot = entry->mValue;
32148 if (!slot.Init(cx, temp, "Value in argument 1", true)) {
32149 return false;
32150 }
32151 }
32152 } else {
32153 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
32154 return false;
32155 }
32156 if (objIsXray) {
32157 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32158 // we know Xrays have no dynamic unwrap behavior.
32159 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32160 if (!unwrappedObj.ref()) {
32161 return false;
32162 }
32163 }
32164 FastErrorResult rv;
32165 // NOTE: This assert does NOT call the function.
32166 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32167 MOZ_KnownLive(self)(self)->PassRecordOfUnions(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32168 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfUnions"
)), 0))
) {
32169 return false;
32170 }
32171 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32171; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32172 args.rval().setUndefined();
32173 return true;
32174}
32175
32176static const JSJitInfo passRecordOfUnions_methodinfo = {
32177 { (JSJitGetterOp)passRecordOfUnions },
32178 { prototypes::id::TestJSImplInterface },
32179 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32180 JSJitInfo::Method,
32181 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32182 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32183 false, /* isInfallible. False in setters. */
32184 false, /* isMovable. Not relevant for setters. */
32185 false, /* isEliminatable. Not relevant for setters. */
32186 false, /* isAlwaysInSlot. Only relevant for getters. */
32187 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32188 false, /* isTypedMethod. Only relevant for methods. */
32189 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32190};
32191
32192MOZ_CAN_RUN_SCRIPT static bool
32193receiveUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32194{
32195 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32198( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32196 "TestJSImplInterface", "receiveUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32198( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32197 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32198( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32198 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32198( cx, "TestJSImplInterface"
, "receiveUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32199
32200 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32201 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32202 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32203 if (objIsXray) {
32204 unwrappedObj.emplace(cx, obj);
32205 }
32206 if (objIsXray) {
32207 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32208 // we know Xrays have no dynamic unwrap behavior.
32209 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32210 if (!unwrappedObj.ref()) {
32211 return false;
32212 }
32213 }
32214 FastErrorResult rv;
32215 OwningCanvasPatternOrCanvasGradient result;
32216 // NOTE: This assert does NOT call the function.
32217 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32218 MOZ_KnownLive(self)(self)->ReceiveUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32219 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion"
)), 0))
) {
32220 return false;
32221 }
32222 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32222); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32222; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32223 if (!result.ToJSVal(cx, obj, args.rval())) {
32224 return false;
32225 }
32226 return true;
32227}
32228
32229static const JSJitInfo receiveUnion_methodinfo = {
32230 { (JSJitGetterOp)receiveUnion },
32231 { prototypes::id::TestJSImplInterface },
32232 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32233 JSJitInfo::Method,
32234 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32235 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
32236 false, /* isInfallible. False in setters. */
32237 false, /* isMovable. Not relevant for setters. */
32238 false, /* isEliminatable. Not relevant for setters. */
32239 false, /* isAlwaysInSlot. Only relevant for getters. */
32240 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32241 false, /* isTypedMethod. Only relevant for methods. */
32242 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32243};
32244
32245MOZ_CAN_RUN_SCRIPT static bool
32246receiveUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32247{
32248 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32251( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32249 "TestJSImplInterface", "receiveUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32251( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32250 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32251( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32251 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32251( cx, "TestJSImplInterface"
, "receiveUnion2", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32252
32253 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32254 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32255 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32256 if (objIsXray) {
32257 unwrappedObj.emplace(cx, obj);
32258 }
32259 if (objIsXray) {
32260 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32261 // we know Xrays have no dynamic unwrap behavior.
32262 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32263 if (!unwrappedObj.ref()) {
32264 return false;
32265 }
32266 }
32267 FastErrorResult rv;
32268 RootedUnion<OwningObjectOrLong> result(cx);
32269 // NOTE: This assert does NOT call the function.
32270 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32271 MOZ_KnownLive(self)(self)->ReceiveUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32272 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnion2"
)), 0))
) {
32273 return false;
32274 }
32275 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32275); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32275; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32276 if (!result.ToJSVal(cx, obj, args.rval())) {
32277 return false;
32278 }
32279 return true;
32280}
32281
32282static const JSJitInfo receiveUnion2_methodinfo = {
32283 { (JSJitGetterOp)receiveUnion2 },
32284 { prototypes::id::TestJSImplInterface },
32285 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32286 JSJitInfo::Method,
32287 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32288 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32289 false, /* isInfallible. False in setters. */
32290 false, /* isMovable. Not relevant for setters. */
32291 false, /* isEliminatable. Not relevant for setters. */
32292 false, /* isAlwaysInSlot. Only relevant for getters. */
32293 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32294 false, /* isTypedMethod. Only relevant for methods. */
32295 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32296};
32297
32298MOZ_CAN_RUN_SCRIPT static bool
32299receiveUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32300{
32301 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32304( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32302 "TestJSImplInterface", "receiveUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32304( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32303 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32304( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32304 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32304( cx, "TestJSImplInterface"
, "receiveUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32305
32306 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32307 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32308 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32309 if (objIsXray) {
32310 unwrappedObj.emplace(cx, obj);
32311 }
32312 if (objIsXray) {
32313 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32314 // we know Xrays have no dynamic unwrap behavior.
32315 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32316 if (!unwrappedObj.ref()) {
32317 return false;
32318 }
32319 }
32320 FastErrorResult rv;
32321 OwningCanvasPatternOrNullOrCanvasGradient result;
32322 // NOTE: This assert does NOT call the function.
32323 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32324 MOZ_KnownLive(self)(self)->ReceiveUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32325 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveUnionContainingNull"
)), 0))
) {
32326 return false;
32327 }
32328 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32328); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32328; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32329 if (!result.ToJSVal(cx, obj, args.rval())) {
32330 return false;
32331 }
32332 return true;
32333}
32334
32335static const JSJitInfo receiveUnionContainingNull_methodinfo = {
32336 { (JSJitGetterOp)receiveUnionContainingNull },
32337 { prototypes::id::TestJSImplInterface },
32338 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32339 JSJitInfo::Method,
32340 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32341 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32342 false, /* isInfallible. False in setters. */
32343 false, /* isMovable. Not relevant for setters. */
32344 false, /* isEliminatable. Not relevant for setters. */
32345 false, /* isAlwaysInSlot. Only relevant for getters. */
32346 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32347 false, /* isTypedMethod. Only relevant for methods. */
32348 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32349};
32350
32351MOZ_CAN_RUN_SCRIPT static bool
32352receiveNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32353{
32354 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32357( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32355 "TestJSImplInterface", "receiveNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32357( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32356 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32357( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32357 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32357( cx, "TestJSImplInterface"
, "receiveNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32358
32359 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32360 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32361 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32362 if (objIsXray) {
32363 unwrappedObj.emplace(cx, obj);
32364 }
32365 if (objIsXray) {
32366 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32367 // we know Xrays have no dynamic unwrap behavior.
32368 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32369 if (!unwrappedObj.ref()) {
32370 return false;
32371 }
32372 }
32373 FastErrorResult rv;
32374 Nullable<OwningCanvasPatternOrCanvasGradient> result;
32375 // NOTE: This assert does NOT call the function.
32376 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32377 MOZ_KnownLive(self)(self)->ReceiveNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32378 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion"
)), 0))
) {
32379 return false;
32380 }
32381 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32381); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32381; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32382 if (result.IsNull()) {
32383 args.rval().setNull();
32384 return true;
32385 }
32386 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32387 return false;
32388 }
32389 return true;
32390}
32391
32392static const JSJitInfo receiveNullableUnion_methodinfo = {
32393 { (JSJitGetterOp)receiveNullableUnion },
32394 { prototypes::id::TestJSImplInterface },
32395 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32396 JSJitInfo::Method,
32397 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32398 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32399 false, /* isInfallible. False in setters. */
32400 false, /* isMovable. Not relevant for setters. */
32401 false, /* isEliminatable. Not relevant for setters. */
32402 false, /* isAlwaysInSlot. Only relevant for getters. */
32403 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32404 false, /* isTypedMethod. Only relevant for methods. */
32405 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32406};
32407
32408MOZ_CAN_RUN_SCRIPT static bool
32409receiveNullableUnion2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32410{
32411 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32414( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32412 "TestJSImplInterface", "receiveNullableUnion2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32414( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32413 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32414( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32414 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32414( cx, "TestJSImplInterface"
, "receiveNullableUnion2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32415
32416 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32417 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32418 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32419 if (objIsXray) {
32420 unwrappedObj.emplace(cx, obj);
32421 }
32422 if (objIsXray) {
32423 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32424 // we know Xrays have no dynamic unwrap behavior.
32425 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32426 if (!unwrappedObj.ref()) {
32427 return false;
32428 }
32429 }
32430 FastErrorResult rv;
32431 NullableRootedUnion<OwningObjectOrLong> result(cx);
32432 // NOTE: This assert does NOT call the function.
32433 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32434 MOZ_KnownLive(self)(self)->ReceiveNullableUnion2(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32435 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableUnion2"
)), 0))
) {
32436 return false;
32437 }
32438 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32438); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32438; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32439 if (result.IsNull()) {
32440 args.rval().setNull();
32441 return true;
32442 }
32443 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32444 return false;
32445 }
32446 return true;
32447}
32448
32449static const JSJitInfo receiveNullableUnion2_methodinfo = {
32450 { (JSJitGetterOp)receiveNullableUnion2 },
32451 { prototypes::id::TestJSImplInterface },
32452 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32453 JSJitInfo::Method,
32454 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32455 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32456 false, /* isInfallible. False in setters. */
32457 false, /* isMovable. Not relevant for setters. */
32458 false, /* isEliminatable. Not relevant for setters. */
32459 false, /* isAlwaysInSlot. Only relevant for getters. */
32460 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32461 false, /* isTypedMethod. Only relevant for methods. */
32462 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32463};
32464
32465MOZ_CAN_RUN_SCRIPT static bool
32466get_writableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32467{
32468 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32471( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32469 "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32471( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32470 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32471( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32471 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32471( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32472
32473 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32474 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32475 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32476 if (objIsXray) {
32477 unwrappedObj.emplace(cx, obj);
32478 }
32479 if (objIsXray) {
32480 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32481 // we know Xrays have no dynamic unwrap behavior.
32482 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32483 if (!unwrappedObj.ref()) {
32484 return false;
32485 }
32486 }
32487 FastErrorResult rv;
32488 OwningCanvasPatternOrCanvasGradient result;
32489 // NOTE: This assert does NOT call the function.
32490 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetWritableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32491 MOZ_KnownLive(self)(self)->GetWritableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32492 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion getter"
)), 0))
) {
32493 return false;
32494 }
32495 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32495); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32495; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32496 if (!result.ToJSVal(cx, obj, args.rval())) {
32497 return false;
32498 }
32499 return true;
32500}
32501
32502MOZ_CAN_RUN_SCRIPT static bool
32503set_writableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32504{
32505 BindingCallContext cx(cx_, "TestJSImplInterface.writableUnion setter");
32506 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32509( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32507 "TestJSImplInterface", "writableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32509( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32508 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32509( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32509 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32509( cx, "TestJSImplInterface"
, "writableUnion", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32510
32511 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32512 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32513 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32514 if (objIsXray) {
32515 unwrappedObj.emplace(cx, obj);
32516 }
32517 CanvasPatternOrCanvasGradient arg0;
32518 if (!arg0.Init(cx, args[0], "Value being assigned", true)) {
32519 return false;
32520 }
32521 if (objIsXray) {
32522 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32523 // we know Xrays have no dynamic unwrap behavior.
32524 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32525 if (!unwrappedObj.ref()) {
32526 return false;
32527 }
32528 }
32529 FastErrorResult rv;
32530 // NOTE: This assert does NOT call the function.
32531 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32532 MOZ_KnownLive(self)(self)->SetWritableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32533 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnion setter"
)), 0))
) {
32534 return false;
32535 }
32536 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32536); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32536; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32537
32538 return true;
32539}
32540
32541static const JSJitInfo writableUnion_getterinfo = {
32542 { get_writableUnion },
32543 { prototypes::id::TestJSImplInterface },
32544 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32545 JSJitInfo::Getter,
32546 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32547 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
32548 false, /* isInfallible. False in setters. */
32549 false, /* isMovable. Not relevant for setters. */
32550 false, /* isEliminatable. Not relevant for setters. */
32551 false, /* isAlwaysInSlot. Only relevant for getters. */
32552 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32553 false, /* isTypedMethod. Only relevant for methods. */
32554 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32555};
32556static const JSJitInfo writableUnion_setterinfo = {
32557 { (JSJitGetterOp)set_writableUnion },
32558 { prototypes::id::TestJSImplInterface },
32559 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32560 JSJitInfo::Setter,
32561 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32562 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32563 false, /* isInfallible. False in setters. */
32564 false, /* isMovable. Not relevant for setters. */
32565 false, /* isEliminatable. Not relevant for setters. */
32566 false, /* isAlwaysInSlot. Only relevant for getters. */
32567 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32568 false, /* isTypedMethod. Only relevant for methods. */
32569 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32570};
32571
32572MOZ_CAN_RUN_SCRIPT static bool
32573get_writableUnionContainingNull(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32574{
32575 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32578( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32576 "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32578( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32577 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32578( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32578 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32578( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32579
32580 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32581 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32582 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32583 if (objIsXray) {
32584 unwrappedObj.emplace(cx, obj);
32585 }
32586 if (objIsXray) {
32587 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32588 // we know Xrays have no dynamic unwrap behavior.
32589 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32590 if (!unwrappedObj.ref()) {
32591 return false;
32592 }
32593 }
32594 FastErrorResult rv;
32595 OwningCanvasPatternOrNullOrCanvasGradient result;
32596 // NOTE: This assert does NOT call the function.
32597 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetWritableUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32598 MOZ_KnownLive(self)(self)->GetWritableUnionContainingNull(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32599 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull getter"
)), 0))
) {
32600 return false;
32601 }
32602 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32602); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32602; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32603 if (!result.ToJSVal(cx, obj, args.rval())) {
32604 return false;
32605 }
32606 return true;
32607}
32608
32609MOZ_CAN_RUN_SCRIPT static bool
32610set_writableUnionContainingNull(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32611{
32612 BindingCallContext cx(cx_, "TestJSImplInterface.writableUnionContainingNull setter");
32613 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32616( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32614 "TestJSImplInterface", "writableUnionContainingNull", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32616( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32615 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32616( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
32616 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32616( cx, "TestJSImplInterface"
, "writableUnionContainingNull", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
32617
32618 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32619 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32620 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32621 if (objIsXray) {
32622 unwrappedObj.emplace(cx, obj);
32623 }
32624 CanvasPatternOrNullOrCanvasGradient arg0;
32625 if (!arg0.Init(cx, args[0], "Value being assigned", true)) {
32626 return false;
32627 }
32628 if (objIsXray) {
32629 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32630 // we know Xrays have no dynamic unwrap behavior.
32631 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32632 if (!unwrappedObj.ref()) {
32633 return false;
32634 }
32635 }
32636 FastErrorResult rv;
32637 // NOTE: This assert does NOT call the function.
32638 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableUnionContainingNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32639 MOZ_KnownLive(self)(self)->SetWritableUnionContainingNull(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32640 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableUnionContainingNull setter"
)), 0))
) {
32641 return false;
32642 }
32643 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32643); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32643; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32644
32645 return true;
32646}
32647
32648static const JSJitInfo writableUnionContainingNull_getterinfo = {
32649 { get_writableUnionContainingNull },
32650 { prototypes::id::TestJSImplInterface },
32651 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32652 JSJitInfo::Getter,
32653 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32654 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32655 false, /* isInfallible. False in setters. */
32656 false, /* isMovable. Not relevant for setters. */
32657 false, /* isEliminatable. Not relevant for setters. */
32658 false, /* isAlwaysInSlot. Only relevant for getters. */
32659 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32660 false, /* isTypedMethod. Only relevant for methods. */
32661 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32662};
32663static const JSJitInfo writableUnionContainingNull_setterinfo = {
32664 { (JSJitGetterOp)set_writableUnionContainingNull },
32665 { prototypes::id::TestJSImplInterface },
32666 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32667 JSJitInfo::Setter,
32668 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32669 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32670 false, /* isInfallible. False in setters. */
32671 false, /* isMovable. Not relevant for setters. */
32672 false, /* isEliminatable. Not relevant for setters. */
32673 false, /* isAlwaysInSlot. Only relevant for getters. */
32674 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32675 false, /* isTypedMethod. Only relevant for methods. */
32676 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32677};
32678
32679MOZ_CAN_RUN_SCRIPT static bool
32680get_writableNullableUnion(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
32681{
32682 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32685( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32683 "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32685( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32684 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject32685( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32685 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32685( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32686
32687 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32688 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32689 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32690 if (objIsXray) {
32691 unwrappedObj.emplace(cx, obj);
32692 }
32693 if (objIsXray) {
32694 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32695 // we know Xrays have no dynamic unwrap behavior.
32696 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32697 if (!unwrappedObj.ref()) {
32698 return false;
32699 }
32700 }
32701 FastErrorResult rv;
32702 Nullable<OwningCanvasPatternOrCanvasGradient> result;
32703 // NOTE: This assert does NOT call the function.
32704 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetWritableNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32705 MOZ_KnownLive(self)(self)->GetWritableNullableUnion(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32706 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion getter"
)), 0))
) {
32707 return false;
32708 }
32709 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32709); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32709; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32710 if (result.IsNull()) {
32711 args.rval().setNull();
32712 return true;
32713 }
32714 if (!result.Value().ToJSVal(cx, obj, args.rval())) {
32715 return false;
32716 }
32717 return true;
32718}
32719
32720MOZ_CAN_RUN_SCRIPT static bool
32721set_writableNullableUnion(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
32722{
32723 BindingCallContext cx(cx_, "TestJSImplInterface.writableNullableUnion setter");
32724 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32727( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32725 "TestJSImplInterface", "writableNullableUnion", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32727( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32726 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject32727( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32727 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32727( cx, "TestJSImplInterface"
, "writableNullableUnion", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32728
32729 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32730 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32731 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32732 if (objIsXray) {
32733 unwrappedObj.emplace(cx, obj);
32734 }
32735 Nullable<CanvasPatternOrCanvasGradient > arg0;
32736 if (args[0].isNullOrUndefined()) {
32737 arg0.SetNull();
32738 } else {
32739 if (!arg0.SetValue().Init(cx, args[0], "Value being assigned", true)) {
32740 return false;
32741 }
32742 }
32743 if (objIsXray) {
32744 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32745 // we know Xrays have no dynamic unwrap behavior.
32746 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32747 if (!unwrappedObj.ref()) {
32748 return false;
32749 }
32750 }
32751 FastErrorResult rv;
32752 // NOTE: This assert does NOT call the function.
32753 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetWritableNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32754 MOZ_KnownLive(self)(self)->SetWritableNullableUnion(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32755 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.writableNullableUnion setter"
)), 0))
) {
32756 return false;
32757 }
32758 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32758); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32758; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32759
32760 return true;
32761}
32762
32763static const JSJitInfo writableNullableUnion_getterinfo = {
32764 { get_writableNullableUnion },
32765 { prototypes::id::TestJSImplInterface },
32766 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32767 JSJitInfo::Getter,
32768 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32769 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
32770 false, /* isInfallible. False in setters. */
32771 false, /* isMovable. Not relevant for setters. */
32772 false, /* isEliminatable. Not relevant for setters. */
32773 false, /* isAlwaysInSlot. Only relevant for getters. */
32774 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32775 false, /* isTypedMethod. Only relevant for methods. */
32776 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32777};
32778static const JSJitInfo writableNullableUnion_setterinfo = {
32779 { (JSJitGetterOp)set_writableNullableUnion },
32780 { prototypes::id::TestJSImplInterface },
32781 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32782 JSJitInfo::Setter,
32783 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32784 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32785 false, /* isInfallible. False in setters. */
32786 false, /* isMovable. Not relevant for setters. */
32787 false, /* isEliminatable. Not relevant for setters. */
32788 false, /* isAlwaysInSlot. Only relevant for getters. */
32789 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32790 false, /* isTypedMethod. Only relevant for methods. */
32791 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32792};
32793
32794MOZ_CAN_RUN_SCRIPT static bool
32795passPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32796{
32797 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32800( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32798 "TestJSImplInterface", "passPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32800( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32799 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32800( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32800 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32800( cx, "TestJSImplInterface"
, "passPromise", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32801
32802 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32803 if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromise", 1)) {
32804 return false;
32805 }
32806 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32807 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32808 if (objIsXray) {
32809 unwrappedObj.emplace(cx, obj);
32810 }
32811 OwningNonNull<Promise> arg0;
32812 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
32813 // etc.
32814
32815 JS::Rooted<JSObject*> globalObj(cx);
32816 globalObj = JS::CurrentGlobalOrNull(cx);
32817 JSAutoRealm ar(cx, globalObj);
32818 GlobalObject promiseGlobal(cx, globalObj);
32819 if (promiseGlobal.Failed()) {
32820 return false;
32821 }
32822
32823 JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
32824 if (!JS_WrapValue(cx, &valueToResolve)) {
32825 return false;
32826 }
32827 binding_detail::FastErrorResult promiseRv;
32828 nsCOMPtr<nsIGlobalObject> global =
32829 do_QueryInterface(promiseGlobal.GetAsSupports());
32830 if (!global) {
32831 promiseRv.Throw(NS_ERROR_UNEXPECTED);
32832 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "promiseRv.MaybeSetPendingException(cx)"
")", "../TestJSImplGenBinding.cpp", 32832); AnnotateMozCrashReason
("MOZ_DIAGNOSTIC_ASSERT" "(" "false" ") (" "promiseRv.MaybeSetPendingException(cx)"
")"); do { *((volatile int*)__null) = 32832; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
32833 return false;
32834 }
32835 arg0 = Promise::Resolve(global, cx, valueToResolve,
32836 promiseRv);
32837 if (promiseRv.MaybeSetPendingException(cx)) {
32838 return false;
32839 }
32840 }
32841 if (objIsXray) {
32842 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32843 // we know Xrays have no dynamic unwrap behavior.
32844 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32845 if (!unwrappedObj.ref()) {
32846 return false;
32847 }
32848 }
32849 FastErrorResult rv;
32850 // NOTE: This assert does NOT call the function.
32851 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassPromise(NonNullHelper(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32852 MOZ_KnownLive(self)(self)->PassPromise(NonNullHelper(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32853 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromise"
)), 0))
) {
32854 return false;
32855 }
32856 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32856); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32856; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32857 args.rval().setUndefined();
32858 return true;
32859}
32860
32861static const JSJitInfo passPromise_methodinfo = {
32862 { (JSJitGetterOp)passPromise },
32863 { prototypes::id::TestJSImplInterface },
32864 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32865 JSJitInfo::Method,
32866 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32867 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32868 false, /* isInfallible. False in setters. */
32869 false, /* isMovable. Not relevant for setters. */
32870 false, /* isEliminatable. Not relevant for setters. */
32871 false, /* isAlwaysInSlot. Only relevant for getters. */
32872 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32873 false, /* isTypedMethod. Only relevant for methods. */
32874 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32875};
32876
32877MOZ_CAN_RUN_SCRIPT static bool
32878passOptionalPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32879{
32880 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32883( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32881 "TestJSImplInterface", "passOptionalPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32883( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32882 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32883( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32883 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32883( cx, "TestJSImplInterface"
, "passOptionalPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32884
32885 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32886 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32887 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32888 if (objIsXray) {
32889 unwrappedObj.emplace(cx, obj);
32890 }
32891 Optional<OwningNonNull<Promise>> arg0;
32892 if (args.hasDefined(0)) {
32893 arg0.Construct();
32894 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
32895 // etc.
32896
32897 JS::Rooted<JSObject*> globalObj(cx);
32898 globalObj = JS::CurrentGlobalOrNull(cx);
32899 JSAutoRealm ar(cx, globalObj);
32900 GlobalObject promiseGlobal(cx, globalObj);
32901 if (promiseGlobal.Failed()) {
32902 return false;
32903 }
32904
32905 JS::Rooted<JS::Value> valueToResolve(cx, args[0]);
32906 if (!JS_WrapValue(cx, &valueToResolve)) {
32907 return false;
32908 }
32909 binding_detail::FastErrorResult promiseRv;
32910 nsCOMPtr<nsIGlobalObject> global =
32911 do_QueryInterface(promiseGlobal.GetAsSupports());
32912 if (!global) {
32913 promiseRv.Throw(NS_ERROR_UNEXPECTED);
32914 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "promiseRv.MaybeSetPendingException(cx)"
")", "../TestJSImplGenBinding.cpp", 32914); AnnotateMozCrashReason
("MOZ_DIAGNOSTIC_ASSERT" "(" "false" ") (" "promiseRv.MaybeSetPendingException(cx)"
")"); do { *((volatile int*)__null) = 32914; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
32915 return false;
32916 }
32917 arg0.Value() = Promise::Resolve(global, cx, valueToResolve,
32918 promiseRv);
32919 if (promiseRv.MaybeSetPendingException(cx)) {
32920 return false;
32921 }
32922 }
32923 }
32924 if (objIsXray) {
32925 // Since our object is an Xray, we can just CheckedUnwrapStatic:
32926 // we know Xrays have no dynamic unwrap behavior.
32927 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
32928 if (!unwrappedObj.ref()) {
32929 return false;
32930 }
32931 }
32932 FastErrorResult rv;
32933 // NOTE: This assert does NOT call the function.
32934 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOptionalPromise(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
32935 MOZ_KnownLive(self)(self)->PassOptionalPromise(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
32936 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOptionalPromise"
)), 0))
) {
32937 return false;
32938 }
32939 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 32939); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 32939; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
32940 args.rval().setUndefined();
32941 return true;
32942}
32943
32944static const JSJitInfo passOptionalPromise_methodinfo = {
32945 { (JSJitGetterOp)passOptionalPromise },
32946 { prototypes::id::TestJSImplInterface },
32947 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
32948 JSJitInfo::Method,
32949 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
32950 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
32951 false, /* isInfallible. False in setters. */
32952 false, /* isMovable. Not relevant for setters. */
32953 false, /* isEliminatable. Not relevant for setters. */
32954 false, /* isAlwaysInSlot. Only relevant for getters. */
32955 false, /* isLazilyCachedInSlot. Only relevant for getters. */
32956 false, /* isTypedMethod. Only relevant for methods. */
32957 0 /* Reserved slot index, if we're stored in a slot, else 0. */
32958};
32959
32960MOZ_CAN_RUN_SCRIPT static bool
32961passPromiseSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
32962{
32963 BindingCallContext cx(cx_, "TestJSImplInterface.passPromiseSequence");
32964 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject32967( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32965 "TestJSImplInterface", "passPromiseSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject32967( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32966 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject32967( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
32967 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject32967( cx, "TestJSImplInterface"
, "passPromiseSequence", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
32968
32969 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
32970 if (!args.requireAtLeast(cx, "TestJSImplInterface.passPromiseSequence", 1)) {
32971 return false;
32972 }
32973 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
32974 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
32975 if (objIsXray) {
32976 unwrappedObj.emplace(cx, obj);
32977 }
32978 binding_detail::AutoSequence<OwningNonNull<Promise>> arg0;
32979 if (args[0].isObject()) {
32980 JS::ForOfIterator iter(cx);
32981 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
32982 return false;
32983 }
32984 if (!iter.valueIsIterable()) {
32985 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
32986 return false;
32987 }
32988 binding_detail::AutoSequence<OwningNonNull<Promise>> &arr = arg0;
32989 JS::Rooted<JS::Value> temp(cx);
32990 while (true) {
32991 bool done;
32992 if (!iter.next(&temp, &done)) {
32993 return false;
32994 }
32995 if (done) {
32996 break;
32997 }
32998 OwningNonNull<Promise>* slotPtr = arr.AppendElement(mozilla::fallible);
32999 if (!slotPtr) {
33000 JS_ReportOutOfMemory(cx);
33001 return false;
33002 }
33003 OwningNonNull<Promise>& slot = *slotPtr;
33004 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
33005 // etc.
33006
33007 JS::Rooted<JSObject*> globalObj(cx);
33008 globalObj = JS::CurrentGlobalOrNull(cx);
33009 JSAutoRealm ar(cx, globalObj);
33010 GlobalObject promiseGlobal(cx, globalObj);
33011 if (promiseGlobal.Failed()) {
33012 return false;
33013 }
33014
33015 JS::Rooted<JS::Value> valueToResolve(cx, temp);
33016 if (!JS_WrapValue(cx, &valueToResolve)) {
33017 return false;
33018 }
33019 binding_detail::FastErrorResult promiseRv;
33020 nsCOMPtr<nsIGlobalObject> global =
33021 do_QueryInterface(promiseGlobal.GetAsSupports());
33022 if (!global) {
33023 promiseRv.Throw(NS_ERROR_UNEXPECTED);
33024 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "promiseRv.MaybeSetPendingException(cx)"
")", "../TestJSImplGenBinding.cpp", 33024); AnnotateMozCrashReason
("MOZ_DIAGNOSTIC_ASSERT" "(" "false" ") (" "promiseRv.MaybeSetPendingException(cx)"
")"); do { *((volatile int*)__null) = 33024; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
33025 return false;
33026 }
33027 slot = Promise::Resolve(global, cx, valueToResolve,
33028 promiseRv);
33029 if (promiseRv.MaybeSetPendingException(cx)) {
33030 return false;
33031 }
33032 }
33033 }
33034 } else {
33035 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33036 return false;
33037 }
33038 if (objIsXray) {
33039 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33040 // we know Xrays have no dynamic unwrap behavior.
33041 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33042 if (!unwrappedObj.ref()) {
33043 return false;
33044 }
33045 }
33046 FastErrorResult rv;
33047 // NOTE: This assert does NOT call the function.
33048 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassPromiseSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33049 MOZ_KnownLive(self)(self)->PassPromiseSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33050 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passPromiseSequence"
)), 0))
) {
33051 return false;
33052 }
33053 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33053); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33053; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33054 args.rval().setUndefined();
33055 return true;
33056}
33057
33058static const JSJitInfo passPromiseSequence_methodinfo = {
33059 { (JSJitGetterOp)passPromiseSequence },
33060 { prototypes::id::TestJSImplInterface },
33061 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33062 JSJitInfo::Method,
33063 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33064 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33065 false, /* isInfallible. False in setters. */
33066 false, /* isMovable. Not relevant for setters. */
33067 false, /* isEliminatable. Not relevant for setters. */
33068 false, /* isAlwaysInSlot. Only relevant for getters. */
33069 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33070 false, /* isTypedMethod. Only relevant for methods. */
33071 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33072};
33073
33074MOZ_CAN_RUN_SCRIPT static bool
33075receivePromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33076{
33077 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33080( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33078 "TestJSImplInterface", "receivePromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33080( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33079 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33080( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33080 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33080( cx, "TestJSImplInterface"
, "receivePromise", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33081
33082 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33083 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33084 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33085 if (objIsXray) {
33086 unwrappedObj.emplace(cx, obj);
33087 }
33088 if (objIsXray) {
33089 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33090 // we know Xrays have no dynamic unwrap behavior.
33091 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33092 if (!unwrappedObj.ref()) {
33093 return false;
33094 }
33095 }
33096 FastErrorResult rv;
33097 auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceivePromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
33098 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receivePromise"
)), 0))
) {
33099 return false;
33100 }
33101 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33101); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33101; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33102 if (!ToJSValue(cx, result, args.rval())) {
33103 return false;
33104 }
33105 return true;
33106}
33107
33108MOZ_CAN_RUN_SCRIPT static bool
33109receivePromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33110{
33111 bool ok = receivePromise(cx, obj, void_self, args);
33112 if (ok) {
33113 return true;
33114 }
33115 return ConvertExceptionToPromise(cx, args.rval());
33116}
33117
33118static const JSJitInfo receivePromise_methodinfo = {
33119 { (JSJitGetterOp)receivePromise_promiseWrapper },
33120 { prototypes::id::TestJSImplInterface },
33121 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33122 JSJitInfo::Method,
33123 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33124 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33125 false, /* isInfallible. False in setters. */
33126 false, /* isMovable. Not relevant for setters. */
33127 false, /* isEliminatable. Not relevant for setters. */
33128 false, /* isAlwaysInSlot. Only relevant for getters. */
33129 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33130 false, /* isTypedMethod. Only relevant for methods. */
33131 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33132};
33133
33134MOZ_CAN_RUN_SCRIPT static bool
33135receiveAddrefedPromise(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33136{
33137 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33140( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33138 "TestJSImplInterface", "receiveAddrefedPromise", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33140( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33139 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33140( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33140 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33140( cx, "TestJSImplInterface"
, "receiveAddrefedPromise", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33141
33142 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33143 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33144 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33145 if (objIsXray) {
33146 unwrappedObj.emplace(cx, obj);
33147 }
33148 if (objIsXray) {
33149 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33150 // we know Xrays have no dynamic unwrap behavior.
33151 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33152 if (!unwrappedObj.ref()) {
33153 return false;
33154 }
33155 }
33156 FastErrorResult rv;
33157 auto result(StrongOrRawPtr<Promise>(MOZ_KnownLive(self)(self)->ReceiveAddrefedPromise(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
33158 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveAddrefedPromise"
)), 0))
) {
33159 return false;
33160 }
33161 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33161); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33161; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33162 if (!ToJSValue(cx, result, args.rval())) {
33163 return false;
33164 }
33165 return true;
33166}
33167
33168MOZ_CAN_RUN_SCRIPT static bool
33169receiveAddrefedPromise_promiseWrapper(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33170{
33171 bool ok = receiveAddrefedPromise(cx, obj, void_self, args);
33172 if (ok) {
33173 return true;
33174 }
33175 return ConvertExceptionToPromise(cx, args.rval());
33176}
33177
33178static const JSJitInfo receiveAddrefedPromise_methodinfo = {
33179 { (JSJitGetterOp)receiveAddrefedPromise_promiseWrapper },
33180 { prototypes::id::TestJSImplInterface },
33181 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33182 JSJitInfo::Method,
33183 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33184 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33185 false, /* isInfallible. False in setters. */
33186 false, /* isMovable. Not relevant for setters. */
33187 false, /* isEliminatable. Not relevant for setters. */
33188 false, /* isAlwaysInSlot. Only relevant for getters. */
33189 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33190 false, /* isTypedMethod. Only relevant for methods. */
33191 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33192};
33193
33194MOZ_CAN_RUN_SCRIPT static bool
33195methodRenamedFrom(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33196{
33197 BindingCallContext cx(cx_, "TestJSImplInterface.methodRenamedFrom");
33198 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33201( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33199 "TestJSImplInterface", "methodRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33201( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33200 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33201( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33201 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33201( cx, "TestJSImplInterface"
, "methodRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33202
33203 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33204 unsigned argcount = std::min(args.length(), 1u);
33205 switch (argcount) {
33206 case 0: {
33207 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33208 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33209 if (objIsXray) {
33210 unwrappedObj.emplace(cx, obj);
33211 }
33212 if (objIsXray) {
33213 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33214 // we know Xrays have no dynamic unwrap behavior.
33215 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33216 if (!unwrappedObj.ref()) {
33217 return false;
33218 }
33219 }
33220 FastErrorResult rv;
33221 // NOTE: This assert does NOT call the function.
33222 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->MethodRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33223 MOZ_KnownLive(self)(self)->MethodRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33224 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"
)), 0))
) {
33225 return false;
33226 }
33227 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33227); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33227; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33228 args.rval().setUndefined();
33229 return true;
33230 break;
33231 }
33232 case 1: {
33233 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33234 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33235 if (objIsXray) {
33236 unwrappedObj.emplace(cx, obj);
33237 }
33238 int8_t arg0;
33239 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
33240 return false;
33241 }
33242 if (objIsXray) {
33243 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33244 // we know Xrays have no dynamic unwrap behavior.
33245 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33246 if (!unwrappedObj.ref()) {
33247 return false;
33248 }
33249 }
33250 FastErrorResult rv;
33251 // NOTE: This assert does NOT call the function.
33252 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->MethodRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33253 MOZ_KnownLive(self)(self)->MethodRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33254 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.methodRenamedFrom"
)), 0))
) {
33255 return false;
33256 }
33257 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33257); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33257; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33258 args.rval().setUndefined();
33259 return true;
33260 break;
33261 }
33262 default: {
33263 // Using nsPrintfCString here would require including that
33264 // header. Let's not worry about it.
33265 nsAutoCString argCountStr;
33266 argCountStr.AppendPrintf("%u", args.length());
33267 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
33268 }
33269 }
33270 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 33270); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 33270; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
33271 return false;
33272}
33273
33274static const JSJitInfo methodRenamedFrom_methodinfo = {
33275 { (JSJitGetterOp)methodRenamedFrom },
33276 { prototypes::id::TestJSImplInterface },
33277 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33278 JSJitInfo::Method,
33279 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33280 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33281 false, /* isInfallible. False in setters. */
33282 false, /* isMovable. Not relevant for setters. */
33283 false, /* isEliminatable. Not relevant for setters. */
33284 false, /* isAlwaysInSlot. Only relevant for getters. */
33285 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33286 false, /* isTypedMethod. Only relevant for methods. */
33287 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33288};
33289
33290MOZ_CAN_RUN_SCRIPT static bool
33291get_attributeGetterRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
33292{
33293 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33296( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33294 "TestJSImplInterface", "attributeGetterRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33296( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33295 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33296( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33296 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33296( cx, "TestJSImplInterface"
, "attributeGetterRenamedFrom", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33297
33298 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33299 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33300 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33301 if (objIsXray) {
33302 unwrappedObj.emplace(cx, obj);
33303 }
33304 if (objIsXray) {
33305 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33306 // we know Xrays have no dynamic unwrap behavior.
33307 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33308 if (!unwrappedObj.ref()) {
33309 return false;
33310 }
33311 }
33312 FastErrorResult rv;
33313 int8_t result(MOZ_KnownLive(self)(self)->GetAttributeGetterRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
33314 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeGetterRenamedFrom getter"
)), 0))
) {
33315 return false;
33316 }
33317 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33317); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33317; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33318 args.rval().setInt32(int32_t(result));
33319 return true;
33320}
33321
33322static const JSJitInfo attributeGetterRenamedFrom_getterinfo = {
33323 { get_attributeGetterRenamedFrom },
33324 { prototypes::id::TestJSImplInterface },
33325 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33326 JSJitInfo::Getter,
33327 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33328 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
33329 false, /* isInfallible. False in setters. */
33330 false, /* isMovable. Not relevant for setters. */
33331 false, /* isEliminatable. Not relevant for setters. */
33332 false, /* isAlwaysInSlot. Only relevant for getters. */
33333 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33334 false, /* isTypedMethod. Only relevant for methods. */
33335 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33336};
33337
33338MOZ_CAN_RUN_SCRIPT static bool
33339get_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
33340{
33341 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33344( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33342 "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33344( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33343 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject33344( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33344 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33344( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33345
33346 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33347 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33348 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33349 if (objIsXray) {
33350 unwrappedObj.emplace(cx, obj);
33351 }
33352 if (objIsXray) {
33353 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33354 // we know Xrays have no dynamic unwrap behavior.
33355 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33356 if (!unwrappedObj.ref()) {
33357 return false;
33358 }
33359 }
33360 FastErrorResult rv;
33361 int8_t result(MOZ_KnownLive(self)(self)->GetAttributeRenamedTo(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
33362 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom getter"
)), 0))
) {
33363 return false;
33364 }
33365 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33365); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33365; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33366 args.rval().setInt32(int32_t(result));
33367 return true;
33368}
33369
33370MOZ_CAN_RUN_SCRIPT static bool
33371set_attributeRenamedFrom(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
33372{
33373 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33376( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33374 "TestJSImplInterface", "attributeRenamedFrom", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33376( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33375 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject33376( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33376 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33376( cx, "TestJSImplInterface"
, "attributeRenamedFrom", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33377
33378 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33379 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33380 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33381 if (objIsXray) {
33382 unwrappedObj.emplace(cx, obj);
33383 }
33384 int8_t arg0;
33385 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
33386 return false;
33387 }
33388 if (objIsXray) {
33389 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33390 // we know Xrays have no dynamic unwrap behavior.
33391 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33392 if (!unwrappedObj.ref()) {
33393 return false;
33394 }
33395 }
33396 FastErrorResult rv;
33397 // NOTE: This assert does NOT call the function.
33398 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAttributeRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33399 MOZ_KnownLive(self)(self)->SetAttributeRenamedTo(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33400 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attributeRenamedFrom setter"
)), 0))
) {
33401 return false;
33402 }
33403 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33403); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33403; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33404
33405 return true;
33406}
33407
33408static const JSJitInfo attributeRenamedFrom_getterinfo = {
33409 { get_attributeRenamedFrom },
33410 { prototypes::id::TestJSImplInterface },
33411 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33412 JSJitInfo::Getter,
33413 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33414 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
33415 false, /* isInfallible. False in setters. */
33416 false, /* isMovable. Not relevant for setters. */
33417 false, /* isEliminatable. Not relevant for setters. */
33418 false, /* isAlwaysInSlot. Only relevant for getters. */
33419 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33420 false, /* isTypedMethod. Only relevant for methods. */
33421 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33422};
33423static const JSJitInfo attributeRenamedFrom_setterinfo = {
33424 { (JSJitGetterOp)set_attributeRenamedFrom },
33425 { prototypes::id::TestJSImplInterface },
33426 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33427 JSJitInfo::Setter,
33428 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33429 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33430 false, /* isInfallible. False in setters. */
33431 false, /* isMovable. Not relevant for setters. */
33432 false, /* isEliminatable. Not relevant for setters. */
33433 false, /* isAlwaysInSlot. Only relevant for getters. */
33434 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33435 false, /* isTypedMethod. Only relevant for methods. */
33436 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33437};
33438
33439MOZ_CAN_RUN_SCRIPT static bool
33440passDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33441{
33442 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary");
33443 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33446( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33444 "TestJSImplInterface", "passDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33446( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33445 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33446( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33446 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33446( cx, "TestJSImplInterface"
, "passDictionary", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33447
33448 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33449 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33450 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33451 if (objIsXray) {
33452 unwrappedObj.emplace(cx, obj);
33453 }
33454 RootedDictionary<binding_detail::FastDict> arg0(cx);
33455 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
33456 return false;
33457 }
33458 if (objIsXray) {
33459 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33460 // we know Xrays have no dynamic unwrap behavior.
33461 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33462 if (!unwrappedObj.ref()) {
33463 return false;
33464 }
33465 }
33466 FastErrorResult rv;
33467 // NOTE: This assert does NOT call the function.
33468 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33469 MOZ_KnownLive(self)(self)->PassDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33470 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary"
)), 0))
) {
33471 return false;
33472 }
33473 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33473); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33473; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33474 args.rval().setUndefined();
33475 return true;
33476}
33477
33478static const JSJitInfo passDictionary_methodinfo = {
33479 { (JSJitGetterOp)passDictionary },
33480 { prototypes::id::TestJSImplInterface },
33481 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33482 JSJitInfo::Method,
33483 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33484 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33485 false, /* isInfallible. False in setters. */
33486 false, /* isMovable. Not relevant for setters. */
33487 false, /* isEliminatable. Not relevant for setters. */
33488 false, /* isAlwaysInSlot. Only relevant for getters. */
33489 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33490 false, /* isTypedMethod. Only relevant for methods. */
33491 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33492};
33493
33494MOZ_CAN_RUN_SCRIPT static bool
33495passDictionary2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33496{
33497 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionary2");
33498 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33501( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33499 "TestJSImplInterface", "passDictionary2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33501( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33500 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33501( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33501 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33501( cx, "TestJSImplInterface"
, "passDictionary2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33502
33503 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33504 if (!args.requireAtLeast(cx, "TestJSImplInterface.passDictionary2", 1)) {
33505 return false;
33506 }
33507 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33508 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33509 if (objIsXray) {
33510 unwrappedObj.emplace(cx, obj);
33511 }
33512 RootedDictionary<binding_detail::FastDict> arg0(cx);
33513 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
33514 return false;
33515 }
33516 if (objIsXray) {
33517 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33518 // we know Xrays have no dynamic unwrap behavior.
33519 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33520 if (!unwrappedObj.ref()) {
33521 return false;
33522 }
33523 }
33524 FastErrorResult rv;
33525 // NOTE: This assert does NOT call the function.
33526 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionary2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33527 MOZ_KnownLive(self)(self)->PassDictionary2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33528 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionary2"
)), 0))
) {
33529 return false;
33530 }
33531 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33531); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33531; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33532 args.rval().setUndefined();
33533 return true;
33534}
33535
33536static const JSJitInfo passDictionary2_methodinfo = {
33537 { (JSJitGetterOp)passDictionary2 },
33538 { prototypes::id::TestJSImplInterface },
33539 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33540 JSJitInfo::Method,
33541 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33542 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33543 false, /* isInfallible. False in setters. */
33544 false, /* isMovable. Not relevant for setters. */
33545 false, /* isEliminatable. Not relevant for setters. */
33546 false, /* isAlwaysInSlot. Only relevant for getters. */
33547 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33548 false, /* isTypedMethod. Only relevant for methods. */
33549 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33550};
33551
33552MOZ_CAN_RUN_SCRIPT static bool
33553receiveDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33554{
33555 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33558( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33556 "TestJSImplInterface", "receiveDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33558( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33557 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33558( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33558 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33558( cx, "TestJSImplInterface"
, "receiveDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33559
33560 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33561 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33562 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33563 if (objIsXray) {
33564 unwrappedObj.emplace(cx, obj);
33565 }
33566 if (objIsXray) {
33567 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33568 // we know Xrays have no dynamic unwrap behavior.
33569 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33570 if (!unwrappedObj.ref()) {
33571 return false;
33572 }
33573 }
33574 FastErrorResult rv;
33575 RootedDictionary<Dict> result(cx);
33576 // NOTE: This assert does NOT call the function.
33577 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33578 MOZ_KnownLive(self)(self)->ReceiveDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33579 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictionary"
)), 0))
) {
33580 return false;
33581 }
33582 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33582; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33583 if (!result.ToObjectInternal(cx, args.rval())) {
33584 return false;
33585 }
33586 return true;
33587}
33588
33589static const JSJitInfo receiveDictionary_methodinfo = {
33590 { (JSJitGetterOp)receiveDictionary },
33591 { prototypes::id::TestJSImplInterface },
33592 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33593 JSJitInfo::Method,
33594 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33595 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
33596 false, /* isInfallible. False in setters. */
33597 false, /* isMovable. Not relevant for setters. */
33598 false, /* isEliminatable. Not relevant for setters. */
33599 false, /* isAlwaysInSlot. Only relevant for getters. */
33600 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33601 false, /* isTypedMethod. Only relevant for methods. */
33602 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33603};
33604
33605MOZ_CAN_RUN_SCRIPT static bool
33606receiveNullableDictionary(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33607{
33608 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33611( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33609 "TestJSImplInterface", "receiveNullableDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33611( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33610 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33611( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33611 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33611( cx, "TestJSImplInterface"
, "receiveNullableDictionary", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33612
33613 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33614 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33615 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33616 if (objIsXray) {
33617 unwrappedObj.emplace(cx, obj);
33618 }
33619 if (objIsXray) {
33620 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33621 // we know Xrays have no dynamic unwrap behavior.
33622 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33623 if (!unwrappedObj.ref()) {
33624 return false;
33625 }
33626 }
33627 FastErrorResult rv;
33628 NullableRootedDictionary<Dict> result(cx);
33629 // NOTE: This assert does NOT call the function.
33630 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveNullableDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33631 MOZ_KnownLive(self)(self)->ReceiveNullableDictionary(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33632 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveNullableDictionary"
)), 0))
) {
33633 return false;
33634 }
33635 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33635); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33635; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33636 if (result.IsNull()) {
33637 args.rval().setNull();
33638 return true;
33639 }
33640 if (!result.Value().ToObjectInternal(cx, args.rval())) {
33641 return false;
33642 }
33643 return true;
33644}
33645
33646static const JSJitInfo receiveNullableDictionary_methodinfo = {
33647 { (JSJitGetterOp)receiveNullableDictionary },
33648 { prototypes::id::TestJSImplInterface },
33649 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33650 JSJitInfo::Method,
33651 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33652 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
33653 false, /* isInfallible. False in setters. */
33654 false, /* isMovable. Not relevant for setters. */
33655 false, /* isEliminatable. Not relevant for setters. */
33656 false, /* isAlwaysInSlot. Only relevant for getters. */
33657 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33658 false, /* isTypedMethod. Only relevant for methods. */
33659 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33660};
33661
33662MOZ_CAN_RUN_SCRIPT static bool
33663passOtherDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33664{
33665 BindingCallContext cx(cx_, "TestJSImplInterface.passOtherDictionary");
33666 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33669( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33667 "TestJSImplInterface", "passOtherDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33669( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33668 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33669( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33669 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33669( cx, "TestJSImplInterface"
, "passOtherDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33670
33671 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33672 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33673 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33674 if (objIsXray) {
33675 unwrappedObj.emplace(cx, obj);
33676 }
33677 binding_detail::FastGrandparentDict arg0;
33678 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
33679 return false;
33680 }
33681 if (objIsXray) {
33682 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33683 // we know Xrays have no dynamic unwrap behavior.
33684 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33685 if (!unwrappedObj.ref()) {
33686 return false;
33687 }
33688 }
33689 FastErrorResult rv;
33690 // NOTE: This assert does NOT call the function.
33691 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassOtherDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33692 MOZ_KnownLive(self)(self)->PassOtherDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33693 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passOtherDictionary"
)), 0))
) {
33694 return false;
33695 }
33696 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33696); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33696; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33697 args.rval().setUndefined();
33698 return true;
33699}
33700
33701static const JSJitInfo passOtherDictionary_methodinfo = {
33702 { (JSJitGetterOp)passOtherDictionary },
33703 { prototypes::id::TestJSImplInterface },
33704 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33705 JSJitInfo::Method,
33706 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33707 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33708 false, /* isInfallible. False in setters. */
33709 false, /* isMovable. Not relevant for setters. */
33710 false, /* isEliminatable. Not relevant for setters. */
33711 false, /* isAlwaysInSlot. Only relevant for getters. */
33712 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33713 false, /* isTypedMethod. Only relevant for methods. */
33714 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33715};
33716
33717MOZ_CAN_RUN_SCRIPT static bool
33718passSequenceOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33719{
33720 BindingCallContext cx(cx_, "TestJSImplInterface.passSequenceOfDictionaries");
33721 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33724( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33722 "TestJSImplInterface", "passSequenceOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33724( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33723 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33724( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33724 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33724( cx, "TestJSImplInterface"
, "passSequenceOfDictionaries", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33725
33726 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33727 if (!args.requireAtLeast(cx, "TestJSImplInterface.passSequenceOfDictionaries", 1)) {
33728 return false;
33729 }
33730 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33731 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33732 if (objIsXray) {
33733 unwrappedObj.emplace(cx, obj);
33734 }
33735 binding_detail::AutoSequence<Dict> arg0;
33736 SequenceRooter<Dict> arg0_holder(cx, &arg0);
33737 if (args[0].isObject()) {
33738 JS::ForOfIterator iter(cx);
33739 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
33740 return false;
33741 }
33742 if (!iter.valueIsIterable()) {
33743 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33744 return false;
33745 }
33746 binding_detail::AutoSequence<Dict> &arr = arg0;
33747 JS::Rooted<JS::Value> temp(cx);
33748 while (true) {
33749 bool done;
33750 if (!iter.next(&temp, &done)) {
33751 return false;
33752 }
33753 if (done) {
33754 break;
33755 }
33756 Dict* slotPtr = arr.AppendElement(mozilla::fallible);
33757 if (!slotPtr) {
33758 JS_ReportOutOfMemory(cx);
33759 return false;
33760 }
33761 Dict& slot = *slotPtr;
33762 if (!slot.Init(cx, temp, "Element of argument 1", true)) {
33763 return false;
33764 }
33765 }
33766 } else {
33767 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 1", "sequence");
33768 return false;
33769 }
33770 if (objIsXray) {
33771 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33772 // we know Xrays have no dynamic unwrap behavior.
33773 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33774 if (!unwrappedObj.ref()) {
33775 return false;
33776 }
33777 }
33778 FastErrorResult rv;
33779 // NOTE: This assert does NOT call the function.
33780 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassSequenceOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33781 MOZ_KnownLive(self)(self)->PassSequenceOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33782 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passSequenceOfDictionaries"
)), 0))
) {
33783 return false;
33784 }
33785 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33785); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33785; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33786 args.rval().setUndefined();
33787 return true;
33788}
33789
33790static const JSJitInfo passSequenceOfDictionaries_methodinfo = {
33791 { (JSJitGetterOp)passSequenceOfDictionaries },
33792 { prototypes::id::TestJSImplInterface },
33793 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33794 JSJitInfo::Method,
33795 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33796 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33797 false, /* isInfallible. False in setters. */
33798 false, /* isMovable. Not relevant for setters. */
33799 false, /* isEliminatable. Not relevant for setters. */
33800 false, /* isAlwaysInSlot. Only relevant for getters. */
33801 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33802 false, /* isTypedMethod. Only relevant for methods. */
33803 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33804};
33805
33806MOZ_CAN_RUN_SCRIPT static bool
33807passRecordOfDictionaries(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33808{
33809 BindingCallContext cx(cx_, "TestJSImplInterface.passRecordOfDictionaries");
33810 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33813( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33811 "TestJSImplInterface", "passRecordOfDictionaries", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33813( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33812 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33813( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
33813 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33813( cx, "TestJSImplInterface"
, "passRecordOfDictionaries", JS::ProfilingCategoryPair::DOM,
uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
33814
33815 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33816 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRecordOfDictionaries", 1)) {
33817 return false;
33818 }
33819 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33820 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33821 if (objIsXray) {
33822 unwrappedObj.emplace(cx, obj);
33823 }
33824 Record<nsString, GrandparentDict> arg0;
33825 if (args[0].isObject()) {
33826 auto& recordEntries = arg0.Entries();
33827
33828 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
33829 JS::RootedVector<jsid> ids(cx);
33830 if (!js::GetPropertyKeys(cx, recordObj,
33831 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
33832 return false;
33833 }
33834 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
33835 JS_ReportOutOfMemory(cx);
33836 return false;
33837 }
33838 JS::Rooted<JS::Value> propNameValue(cx);
33839 JS::Rooted<JS::Value> temp(cx);
33840 JS::Rooted<jsid> curId(cx);
33841 JS::Rooted<JS::Value> idVal(cx);
33842 // Use a hashset to keep track of ids seen, to avoid
33843 // introducing nasty O(N^2) behavior scanning for them all the
33844 // time. Ideally we'd use a data structure with O(1) lookup
33845 // _and_ ordering for the MozMap, but we don't have one lying
33846 // around.
33847 nsTHashtable<nsStringHashKey> idsSeen;
33848 for (size_t i = 0; i < ids.length(); ++i) {
33849 curId = ids[i];
33850
33851 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
33852 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
33853 &desc)) {
33854 return false;
33855 }
33856
33857 if (desc.isNothing() || !desc->enumerable()) {
33858 continue;
33859 }
33860
33861 idVal = js::IdToValue(curId);
33862 nsString propName;
33863 // This will just throw if idVal is a Symbol, like the spec says
33864 // to do.
33865 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
33866 return false;
33867 }
33868
33869 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
33870 return false;
33871 }
33872
33873 Record<nsString, GrandparentDict>::EntryType* entry;
33874 if (!idsSeen.EnsureInserted(propName)) {
33875 // Find the existing entry.
33876 auto idx = recordEntries.IndexOf(propName);
33877 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 33878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 33878; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
33878 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 33878); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 33878; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
33879 // Now blow it away to make it look like it was just added
33880 // to the array, because it's not obvious that it's
33881 // safe to write to its already-initialized mValue via our
33882 // normal codegen conversions. For example, the value
33883 // could be a union and this would change its type, but
33884 // codegen assumes we won't do that.
33885 entry = recordEntries.ReconstructElementAt(idx);
33886 } else {
33887 // Safe to do an infallible append here, because we did a
33888 // SetCapacity above to the right capacity.
33889 entry = recordEntries.AppendElement();
33890 }
33891 entry->mKey = propName;
33892 GrandparentDict& slot = entry->mValue;
33893 if (!slot.Init(cx, temp, "Value in argument 1", true)) {
33894 return false;
33895 }
33896 }
33897 } else {
33898 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
33899 return false;
33900 }
33901 if (objIsXray) {
33902 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33903 // we know Xrays have no dynamic unwrap behavior.
33904 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33905 if (!unwrappedObj.ref()) {
33906 return false;
33907 }
33908 }
33909 FastErrorResult rv;
33910 // NOTE: This assert does NOT call the function.
33911 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRecordOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33912 MOZ_KnownLive(self)(self)->PassRecordOfDictionaries(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33913 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRecordOfDictionaries"
)), 0))
) {
33914 return false;
33915 }
33916 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33916); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33916; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33917 args.rval().setUndefined();
33918 return true;
33919}
33920
33921static const JSJitInfo passRecordOfDictionaries_methodinfo = {
33922 { (JSJitGetterOp)passRecordOfDictionaries },
33923 { prototypes::id::TestJSImplInterface },
33924 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
33925 JSJitInfo::Method,
33926 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
33927 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
33928 false, /* isInfallible. False in setters. */
33929 false, /* isMovable. Not relevant for setters. */
33930 false, /* isEliminatable. Not relevant for setters. */
33931 false, /* isAlwaysInSlot. Only relevant for getters. */
33932 false, /* isLazilyCachedInSlot. Only relevant for getters. */
33933 false, /* isTypedMethod. Only relevant for methods. */
33934 0 /* Reserved slot index, if we're stored in a slot, else 0. */
33935};
33936
33937MOZ_CAN_RUN_SCRIPT static bool
33938passDictionaryOrLong(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
33939{
33940 BindingCallContext cx(cx_, "TestJSImplInterface.passDictionaryOrLong");
33941 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject33944( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33942 "TestJSImplInterface", "passDictionaryOrLong", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject33944( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33943 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject33944( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
33944 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject33944( cx, "TestJSImplInterface"
, "passDictionaryOrLong", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
33945
33946 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
33947 unsigned argcount = std::min(args.length(), 1u);
33948 switch (argcount) {
33949 case 0: {
33950 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33951 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33952 if (objIsXray) {
33953 unwrappedObj.emplace(cx, obj);
33954 }
33955 RootedDictionary<binding_detail::FastDict> arg0(cx);
33956 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
33957 return false;
33958 }
33959 if (objIsXray) {
33960 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33961 // we know Xrays have no dynamic unwrap behavior.
33962 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33963 if (!unwrappedObj.ref()) {
33964 return false;
33965 }
33966 }
33967 FastErrorResult rv;
33968 // NOTE: This assert does NOT call the function.
33969 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
33970 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
33971 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
33972 return false;
33973 }
33974 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 33974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 33974; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
33975 args.rval().setUndefined();
33976 return true;
33977 break;
33978 }
33979 case 1: {
33980 if (args[0].isNullOrUndefined()) {
33981 RootedDictionary<binding_detail::FastDict> arg0(cx);
33982 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
33983 return false;
33984 }
33985 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
33986 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
33987 if (objIsXray) {
33988 unwrappedObj.emplace(cx, obj);
33989 }
33990 if (objIsXray) {
33991 // Since our object is an Xray, we can just CheckedUnwrapStatic:
33992 // we know Xrays have no dynamic unwrap behavior.
33993 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
33994 if (!unwrappedObj.ref()) {
33995 return false;
33996 }
33997 }
33998 FastErrorResult rv;
33999 // NOTE: This assert does NOT call the function.
34000 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34001 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34002 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34003 return false;
34004 }
34005 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34005; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34006 args.rval().setUndefined();
34007 return true;
34008 }
34009 if (args[0].isObject()) {
34010 do {
34011 RootedDictionary<binding_detail::FastDict> arg0(cx);
34012 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
34013 return false;
34014 }
34015 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34016 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34017 if (objIsXray) {
34018 unwrappedObj.emplace(cx, obj);
34019 }
34020 if (objIsXray) {
34021 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34022 // we know Xrays have no dynamic unwrap behavior.
34023 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34024 if (!unwrappedObj.ref()) {
34025 return false;
34026 }
34027 }
34028 FastErrorResult rv;
34029 // NOTE: This assert does NOT call the function.
34030 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34031 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34032 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34033 return false;
34034 }
34035 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34035); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34035; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34036 args.rval().setUndefined();
34037 return true;
34038 } while (false);
34039 }
34040 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34041 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34042 if (objIsXray) {
34043 unwrappedObj.emplace(cx, obj);
34044 }
34045 int32_t arg0;
34046 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
34047 return false;
34048 }
34049 if (objIsXray) {
34050 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34051 // we know Xrays have no dynamic unwrap behavior.
34052 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34053 if (!unwrappedObj.ref()) {
34054 return false;
34055 }
34056 }
34057 FastErrorResult rv;
34058 // NOTE: This assert does NOT call the function.
34059 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictionaryOrLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34060 MOZ_KnownLive(self)(self)->PassDictionaryOrLong(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34061 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictionaryOrLong"
)), 0))
) {
34062 return false;
34063 }
34064 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34064; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34065 args.rval().setUndefined();
34066 return true;
34067 break;
34068 }
34069 default: {
34070 // Using nsPrintfCString here would require including that
34071 // header. Let's not worry about it.
34072 nsAutoCString argCountStr;
34073 argCountStr.AppendPrintf("%u", args.length());
34074 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
34075 }
34076 }
34077 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 34077); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 34077; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
34078 return false;
34079}
34080
34081static const JSJitInfo passDictionaryOrLong_methodinfo = {
34082 { (JSJitGetterOp)passDictionaryOrLong },
34083 { prototypes::id::TestJSImplInterface },
34084 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34085 JSJitInfo::Method,
34086 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34087 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34088 false, /* isInfallible. False in setters. */
34089 false, /* isMovable. Not relevant for setters. */
34090 false, /* isEliminatable. Not relevant for setters. */
34091 false, /* isAlwaysInSlot. Only relevant for getters. */
34092 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34093 false, /* isTypedMethod. Only relevant for methods. */
34094 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34095};
34096
34097MOZ_CAN_RUN_SCRIPT static bool
34098passDictContainingDict(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34099{
34100 BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingDict");
34101 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34104( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34102 "TestJSImplInterface", "passDictContainingDict", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34104( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34103 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34104( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34104 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34104( cx, "TestJSImplInterface"
, "passDictContainingDict", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34105
34106 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34109 if (objIsXray) {
34110 unwrappedObj.emplace(cx, obj);
34111 }
34112 RootedDictionary<binding_detail::FastDictContainingDict> arg0(cx);
34113 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
34114 return false;
34115 }
34116 if (objIsXray) {
34117 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34118 // we know Xrays have no dynamic unwrap behavior.
34119 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34120 if (!unwrappedObj.ref()) {
34121 return false;
34122 }
34123 }
34124 FastErrorResult rv;
34125 // NOTE: This assert does NOT call the function.
34126 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictContainingDict(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34127 MOZ_KnownLive(self)(self)->PassDictContainingDict(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34128 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingDict"
)), 0))
) {
34129 return false;
34130 }
34131 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34131); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34131; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34132 args.rval().setUndefined();
34133 return true;
34134}
34135
34136static const JSJitInfo passDictContainingDict_methodinfo = {
34137 { (JSJitGetterOp)passDictContainingDict },
34138 { prototypes::id::TestJSImplInterface },
34139 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34140 JSJitInfo::Method,
34141 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34142 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34143 false, /* isInfallible. False in setters. */
34144 false, /* isMovable. Not relevant for setters. */
34145 false, /* isEliminatable. Not relevant for setters. */
34146 false, /* isAlwaysInSlot. Only relevant for getters. */
34147 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34148 false, /* isTypedMethod. Only relevant for methods. */
34149 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34150};
34151
34152MOZ_CAN_RUN_SCRIPT static bool
34153passDictContainingSequence(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34154{
34155 BindingCallContext cx(cx_, "TestJSImplInterface.passDictContainingSequence");
34156 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34159( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34157 "TestJSImplInterface", "passDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34159( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34158 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34159( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34159 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34159( cx, "TestJSImplInterface"
, "passDictContainingSequence", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
34160
34161 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34162 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34163 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34164 if (objIsXray) {
34165 unwrappedObj.emplace(cx, obj);
34166 }
34167 RootedDictionary<binding_detail::FastDictContainingSequence> arg0(cx);
34168 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
34169 return false;
34170 }
34171 if (objIsXray) {
34172 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34173 // we know Xrays have no dynamic unwrap behavior.
34174 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34175 if (!unwrappedObj.ref()) {
34176 return false;
34177 }
34178 }
34179 FastErrorResult rv;
34180 // NOTE: This assert does NOT call the function.
34181 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassDictContainingSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34182 MOZ_KnownLive(self)(self)->PassDictContainingSequence(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34183 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passDictContainingSequence"
)), 0))
) {
34184 return false;
34185 }
34186 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34186); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34186; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34187 args.rval().setUndefined();
34188 return true;
34189}
34190
34191static const JSJitInfo passDictContainingSequence_methodinfo = {
34192 { (JSJitGetterOp)passDictContainingSequence },
34193 { prototypes::id::TestJSImplInterface },
34194 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34195 JSJitInfo::Method,
34196 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34197 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34198 false, /* isInfallible. False in setters. */
34199 false, /* isMovable. Not relevant for setters. */
34200 false, /* isEliminatable. Not relevant for setters. */
34201 false, /* isAlwaysInSlot. Only relevant for getters. */
34202 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34203 false, /* isTypedMethod. Only relevant for methods. */
34204 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34205};
34206
34207MOZ_CAN_RUN_SCRIPT static bool
34208receiveDictContainingSequence(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34209{
34210 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34213( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34211 "TestJSImplInterface", "receiveDictContainingSequence", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34213( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34212 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34213( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
34213 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34213( cx, "TestJSImplInterface"
, "receiveDictContainingSequence", JS::ProfilingCategoryPair::
DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
34214
34215 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34216 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34217 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34218 if (objIsXray) {
34219 unwrappedObj.emplace(cx, obj);
34220 }
34221 if (objIsXray) {
34222 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34223 // we know Xrays have no dynamic unwrap behavior.
34224 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34225 if (!unwrappedObj.ref()) {
34226 return false;
34227 }
34228 }
34229 FastErrorResult rv;
34230 RootedDictionary<DictContainingSequence> result(cx);
34231 // NOTE: This assert does NOT call the function.
34232 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ReceiveDictContainingSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34233 MOZ_KnownLive(self)(self)->ReceiveDictContainingSequence(result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34234 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.receiveDictContainingSequence"
)), 0))
) {
34235 return false;
34236 }
34237 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34237); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34237; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34238 if (!result.ToObjectInternal(cx, args.rval())) {
34239 return false;
34240 }
34241 return true;
34242}
34243
34244static const JSJitInfo receiveDictContainingSequence_methodinfo = {
34245 { (JSJitGetterOp)receiveDictContainingSequence },
34246 { prototypes::id::TestJSImplInterface },
34247 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34248 JSJitInfo::Method,
34249 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34250 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
34251 false, /* isInfallible. False in setters. */
34252 false, /* isMovable. Not relevant for setters. */
34253 false, /* isEliminatable. Not relevant for setters. */
34254 false, /* isAlwaysInSlot. Only relevant for getters. */
34255 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34256 false, /* isTypedMethod. Only relevant for methods. */
34257 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34258};
34259
34260MOZ_CAN_RUN_SCRIPT static bool
34261passVariadicDictionary(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34262{
34263 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicDictionary");
34264 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34267( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34265 "TestJSImplInterface", "passVariadicDictionary", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34267( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34266 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34267( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34267 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34267( cx, "TestJSImplInterface"
, "passVariadicDictionary", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34268
34269 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34270 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34271 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34272 if (objIsXray) {
34273 unwrappedObj.emplace(cx, obj);
34274 }
34275 AutoSequence<Dict> arg0;
34276 SequenceRooter<Dict> arg0_holder(cx, &arg0);
34277 if (args.length() > 0) {
34278 if (!arg0.SetCapacity(args.length() - 0, mozilla::fallible)) {
34279 JS_ReportOutOfMemory(cx);
34280 return false;
34281 }
34282 for (uint32_t variadicArg = 0; variadicArg < args.length(); ++variadicArg) {
34283 // OK to do infallible append here, since we ensured capacity already.
34284 Dict& slot = *arg0.AppendElement();
34285 if (!slot.Init(cx, args[variadicArg], "Argument 1", true)) {
34286 return false;
34287 }
34288 }
34289 }
34290 if (objIsXray) {
34291 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34292 // we know Xrays have no dynamic unwrap behavior.
34293 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34294 if (!unwrappedObj.ref()) {
34295 return false;
34296 }
34297 }
34298 FastErrorResult rv;
34299 // NOTE: This assert does NOT call the function.
34300 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34301 MOZ_KnownLive(self)(self)->PassVariadicDictionary(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34302 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicDictionary"
)), 0))
) {
34303 return false;
34304 }
34305 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34305); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34305; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34306 args.rval().setUndefined();
34307 return true;
34308}
34309
34310static const JSJitInfo passVariadicDictionary_methodinfo = {
34311 { (JSJitGetterOp)passVariadicDictionary },
34312 { prototypes::id::TestJSImplInterface },
34313 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34314 JSJitInfo::Method,
34315 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34316 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34317 false, /* isInfallible. False in setters. */
34318 false, /* isMovable. Not relevant for setters. */
34319 false, /* isEliminatable. Not relevant for setters. */
34320 false, /* isAlwaysInSlot. Only relevant for getters. */
34321 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34322 false, /* isTypedMethod. Only relevant for methods. */
34323 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34324};
34325
34326MOZ_CAN_RUN_SCRIPT static bool
34327dontEnforceRangeOrClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34328{
34329 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34332( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34330 "TestJSImplInterface", "dontEnforceRangeOrClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34332( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34331 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34332( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34332 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34332( cx, "TestJSImplInterface"
, "dontEnforceRangeOrClamp", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34333
34334 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34335 if (!args.requireAtLeast(cx, "TestJSImplInterface.dontEnforceRangeOrClamp", 1)) {
34336 return false;
34337 }
34338 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34339 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34340 if (objIsXray) {
34341 unwrappedObj.emplace(cx, obj);
34342 }
34343 int8_t arg0;
34344 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
34345 return false;
34346 }
34347 if (objIsXray) {
34348 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34349 // we know Xrays have no dynamic unwrap behavior.
34350 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34351 if (!unwrappedObj.ref()) {
34352 return false;
34353 }
34354 }
34355 FastErrorResult rv;
34356 // NOTE: This assert does NOT call the function.
34357 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DontEnforceRangeOrClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34358 MOZ_KnownLive(self)(self)->DontEnforceRangeOrClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34359 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dontEnforceRangeOrClamp"
)), 0))
) {
34360 return false;
34361 }
34362 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34362; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34363 args.rval().setUndefined();
34364 return true;
34365}
34366
34367static const JSJitInfo dontEnforceRangeOrClamp_methodinfo = {
34368 { (JSJitGetterOp)dontEnforceRangeOrClamp },
34369 { prototypes::id::TestJSImplInterface },
34370 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34371 JSJitInfo::Method,
34372 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34373 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34374 false, /* isInfallible. False in setters. */
34375 false, /* isMovable. Not relevant for setters. */
34376 false, /* isEliminatable. Not relevant for setters. */
34377 false, /* isAlwaysInSlot. Only relevant for getters. */
34378 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34379 false, /* isTypedMethod. Only relevant for methods. */
34380 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34381};
34382
34383MOZ_CAN_RUN_SCRIPT static bool
34384doEnforceRange(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34385{
34386 BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRange");
34387 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34390( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34388 "TestJSImplInterface", "doEnforceRange", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34390( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34389 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34390( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34390 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34390( cx, "TestJSImplInterface"
, "doEnforceRange", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34391
34392 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34393 if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRange", 1)) {
34394 return false;
34395 }
34396 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34397 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34398 if (objIsXray) {
34399 unwrappedObj.emplace(cx, obj);
34400 }
34401 int8_t arg0;
34402 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0)) {
34403 return false;
34404 }
34405 if (objIsXray) {
34406 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34407 // we know Xrays have no dynamic unwrap behavior.
34408 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34409 if (!unwrappedObj.ref()) {
34410 return false;
34411 }
34412 }
34413 FastErrorResult rv;
34414 // NOTE: This assert does NOT call the function.
34415 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DoEnforceRange(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34416 MOZ_KnownLive(self)(self)->DoEnforceRange(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34417 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRange"
)), 0))
) {
34418 return false;
34419 }
34420 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34420); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34420; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34421 args.rval().setUndefined();
34422 return true;
34423}
34424
34425static const JSJitInfo doEnforceRange_methodinfo = {
34426 { (JSJitGetterOp)doEnforceRange },
34427 { prototypes::id::TestJSImplInterface },
34428 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34429 JSJitInfo::Method,
34430 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34431 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34432 false, /* isInfallible. False in setters. */
34433 false, /* isMovable. Not relevant for setters. */
34434 false, /* isEliminatable. Not relevant for setters. */
34435 false, /* isAlwaysInSlot. Only relevant for getters. */
34436 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34437 false, /* isTypedMethod. Only relevant for methods. */
34438 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34439};
34440
34441MOZ_CAN_RUN_SCRIPT static bool
34442doEnforceRangeNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34443{
34444 BindingCallContext cx(cx_, "TestJSImplInterface.doEnforceRangeNullable");
34445 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34448( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34446 "TestJSImplInterface", "doEnforceRangeNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34448( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34447 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34448( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34448 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34448( cx, "TestJSImplInterface"
, "doEnforceRangeNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34449
34450 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34451 if (!args.requireAtLeast(cx, "TestJSImplInterface.doEnforceRangeNullable", 1)) {
34452 return false;
34453 }
34454 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34455 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34456 if (objIsXray) {
34457 unwrappedObj.emplace(cx, obj);
34458 }
34459 Nullable<int8_t> arg0;
34460 if (args[0].isNullOrUndefined()) {
34461 arg0.SetNull();
34462 } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Argument 1", &arg0.SetValue())) {
34463 return false;
34464 }
34465 if (objIsXray) {
34466 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34467 // we know Xrays have no dynamic unwrap behavior.
34468 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34469 if (!unwrappedObj.ref()) {
34470 return false;
34471 }
34472 }
34473 FastErrorResult rv;
34474 // NOTE: This assert does NOT call the function.
34475 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DoEnforceRangeNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34476 MOZ_KnownLive(self)(self)->DoEnforceRangeNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34477 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doEnforceRangeNullable"
)), 0))
) {
34478 return false;
34479 }
34480 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34480); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34480; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34481 args.rval().setUndefined();
34482 return true;
34483}
34484
34485static const JSJitInfo doEnforceRangeNullable_methodinfo = {
34486 { (JSJitGetterOp)doEnforceRangeNullable },
34487 { prototypes::id::TestJSImplInterface },
34488 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34489 JSJitInfo::Method,
34490 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34491 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34492 false, /* isInfallible. False in setters. */
34493 false, /* isMovable. Not relevant for setters. */
34494 false, /* isEliminatable. Not relevant for setters. */
34495 false, /* isAlwaysInSlot. Only relevant for getters. */
34496 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34497 false, /* isTypedMethod. Only relevant for methods. */
34498 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34499};
34500
34501MOZ_CAN_RUN_SCRIPT static bool
34502doClamp(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34503{
34504 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34507( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34505 "TestJSImplInterface", "doClamp", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34507( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34506 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34507( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
34507 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34507( cx, "TestJSImplInterface"
, "doClamp", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
34508
34509 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34510 if (!args.requireAtLeast(cx, "TestJSImplInterface.doClamp", 1)) {
34511 return false;
34512 }
34513 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34514 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34515 if (objIsXray) {
34516 unwrappedObj.emplace(cx, obj);
34517 }
34518 int8_t arg0;
34519 if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0)) {
34520 return false;
34521 }
34522 if (objIsXray) {
34523 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34524 // we know Xrays have no dynamic unwrap behavior.
34525 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34526 if (!unwrappedObj.ref()) {
34527 return false;
34528 }
34529 }
34530 FastErrorResult rv;
34531 // NOTE: This assert does NOT call the function.
34532 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DoClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34533 MOZ_KnownLive(self)(self)->DoClamp(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34534 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClamp"
)), 0))
) {
34535 return false;
34536 }
34537 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34537); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34537; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34538 args.rval().setUndefined();
34539 return true;
34540}
34541
34542static const JSJitInfo doClamp_methodinfo = {
34543 { (JSJitGetterOp)doClamp },
34544 { prototypes::id::TestJSImplInterface },
34545 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34546 JSJitInfo::Method,
34547 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34548 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34549 false, /* isInfallible. False in setters. */
34550 false, /* isMovable. Not relevant for setters. */
34551 false, /* isEliminatable. Not relevant for setters. */
34552 false, /* isAlwaysInSlot. Only relevant for getters. */
34553 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34554 false, /* isTypedMethod. Only relevant for methods. */
34555 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34556};
34557
34558MOZ_CAN_RUN_SCRIPT static bool
34559doClampNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
34560{
34561 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34564( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34562 "TestJSImplInterface", "doClampNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34564( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34563 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject34564( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34564 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34564( cx, "TestJSImplInterface"
, "doClampNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34565
34566 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34567 if (!args.requireAtLeast(cx, "TestJSImplInterface.doClampNullable", 1)) {
34568 return false;
34569 }
34570 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34571 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34572 if (objIsXray) {
34573 unwrappedObj.emplace(cx, obj);
34574 }
34575 Nullable<int8_t> arg0;
34576 if (args[0].isNullOrUndefined()) {
34577 arg0.SetNull();
34578 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Argument 1", &arg0.SetValue())) {
34579 return false;
34580 }
34581 if (objIsXray) {
34582 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34583 // we know Xrays have no dynamic unwrap behavior.
34584 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34585 if (!unwrappedObj.ref()) {
34586 return false;
34587 }
34588 }
34589 FastErrorResult rv;
34590 // NOTE: This assert does NOT call the function.
34591 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DoClampNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34592 MOZ_KnownLive(self)(self)->DoClampNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34593 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.doClampNullable"
)), 0))
) {
34594 return false;
34595 }
34596 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34596); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34596; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34597 args.rval().setUndefined();
34598 return true;
34599}
34600
34601static const JSJitInfo doClampNullable_methodinfo = {
34602 { (JSJitGetterOp)doClampNullable },
34603 { prototypes::id::TestJSImplInterface },
34604 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34605 JSJitInfo::Method,
34606 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34607 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34608 false, /* isInfallible. False in setters. */
34609 false, /* isMovable. Not relevant for setters. */
34610 false, /* isEliminatable. Not relevant for setters. */
34611 false, /* isAlwaysInSlot. Only relevant for getters. */
34612 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34613 false, /* isTypedMethod. Only relevant for methods. */
34614 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34615};
34616
34617MOZ_CAN_RUN_SCRIPT static bool
34618get_enforcedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34619{
34620 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34623( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34621 "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34623( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34622 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34623( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34623 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34623( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34624
34625 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34626 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34627 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34628 if (objIsXray) {
34629 unwrappedObj.emplace(cx, obj);
34630 }
34631 if (objIsXray) {
34632 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34633 // we know Xrays have no dynamic unwrap behavior.
34634 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34635 if (!unwrappedObj.ref()) {
34636 return false;
34637 }
34638 }
34639 FastErrorResult rv;
34640 int8_t result(MOZ_KnownLive(self)(self)->GetEnforcedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
34641 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte getter"
)), 0))
) {
34642 return false;
34643 }
34644 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34644); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34644; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34645 args.rval().setInt32(int32_t(result));
34646 return true;
34647}
34648
34649MOZ_CAN_RUN_SCRIPT static bool
34650set_enforcedByte(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34651{
34652 BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByte setter");
34653 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34654 "TestJSImplInterface", "enforcedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34655 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34656 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34656( cx, "TestJSImplInterface"
, "enforcedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34657
34658 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34659 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34660 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34661 if (objIsXray) {
34662 unwrappedObj.emplace(cx, obj);
34663 }
34664 int8_t arg0;
34665 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0)) {
34666 return false;
34667 }
34668 if (objIsXray) {
34669 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34670 // we know Xrays have no dynamic unwrap behavior.
34671 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34672 if (!unwrappedObj.ref()) {
34673 return false;
34674 }
34675 }
34676 FastErrorResult rv;
34677 // NOTE: This assert does NOT call the function.
34678 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetEnforcedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34679 MOZ_KnownLive(self)(self)->SetEnforcedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34680 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByte setter"
)), 0))
) {
34681 return false;
34682 }
34683 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34683); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34683; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34684
34685 return true;
34686}
34687
34688static const JSJitInfo enforcedByte_getterinfo = {
34689 { get_enforcedByte },
34690 { prototypes::id::TestJSImplInterface },
34691 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34692 JSJitInfo::Getter,
34693 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34694 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
34695 false, /* isInfallible. False in setters. */
34696 false, /* isMovable. Not relevant for setters. */
34697 false, /* isEliminatable. Not relevant for setters. */
34698 false, /* isAlwaysInSlot. Only relevant for getters. */
34699 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34700 false, /* isTypedMethod. Only relevant for methods. */
34701 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34702};
34703static const JSJitInfo enforcedByte_setterinfo = {
34704 { (JSJitGetterOp)set_enforcedByte },
34705 { prototypes::id::TestJSImplInterface },
34706 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34707 JSJitInfo::Setter,
34708 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34709 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34710 false, /* isInfallible. False in setters. */
34711 false, /* isMovable. Not relevant for setters. */
34712 false, /* isEliminatable. Not relevant for setters. */
34713 false, /* isAlwaysInSlot. Only relevant for getters. */
34714 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34715 false, /* isTypedMethod. Only relevant for methods. */
34716 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34717};
34718
34719MOZ_CAN_RUN_SCRIPT static bool
34720get_enforcedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34721{
34722 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34725( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34723 "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34725( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34724 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34725( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34725 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34725( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34726
34727 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34728 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34729 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34730 if (objIsXray
0.1
'objIsXray' is false
0.1
'objIsXray' is false
) {
1
Taking false branch
34731 unwrappedObj.emplace(cx, obj);
34732 }
34733 if (objIsXray
1.1
'objIsXray' is false
1.1
'objIsXray' is false
) {
2
Taking false branch
34734 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34735 // we know Xrays have no dynamic unwrap behavior.
34736 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34737 if (!unwrappedObj.ref()) {
34738 return false;
34739 }
34740 }
34741 FastErrorResult rv;
34742 Nullable<int8_t> result(MOZ_KnownLive(self)(self)->GetEnforcedByteNullable(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
3
'?' condition is false
4
Calling 'TestJSImplInterface::GetEnforcedByteNullable'
34743 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable getter"
)), 0))
) {
34744 return false;
34745 }
34746 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34746); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34746; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34747 if (result.IsNull()) {
34748 args.rval().setNull();
34749 return true;
34750 }
34751 args.rval().setInt32(int32_t(result.Value()));
34752 return true;
34753}
34754
34755MOZ_CAN_RUN_SCRIPT static bool
34756set_enforcedByteNullable(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34757{
34758 BindingCallContext cx(cx_, "TestJSImplInterface.enforcedByteNullable setter");
34759 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34762( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34760 "TestJSImplInterface", "enforcedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34762( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34761 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34762( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34762 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34762( cx, "TestJSImplInterface"
, "enforcedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34763
34764 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34765 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34766 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34767 if (objIsXray) {
34768 unwrappedObj.emplace(cx, obj);
34769 }
34770 Nullable<int8_t> arg0;
34771 if (args[0].isNullOrUndefined()) {
34772 arg0.SetNull();
34773 } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
34774 return false;
34775 }
34776 if (objIsXray) {
34777 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34778 // we know Xrays have no dynamic unwrap behavior.
34779 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34780 if (!unwrappedObj.ref()) {
34781 return false;
34782 }
34783 }
34784 FastErrorResult rv;
34785 // NOTE: This assert does NOT call the function.
34786 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetEnforcedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34787 MOZ_KnownLive(self)(self)->SetEnforcedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34788 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.enforcedByteNullable setter"
)), 0))
) {
34789 return false;
34790 }
34791 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34791); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34791; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34792
34793 return true;
34794}
34795
34796static const JSJitInfo enforcedByteNullable_getterinfo = {
34797 { get_enforcedByteNullable },
34798 { prototypes::id::TestJSImplInterface },
34799 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34800 JSJitInfo::Getter,
34801 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34802 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
34803 false, /* isInfallible. False in setters. */
34804 false, /* isMovable. Not relevant for setters. */
34805 false, /* isEliminatable. Not relevant for setters. */
34806 false, /* isAlwaysInSlot. Only relevant for getters. */
34807 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34808 false, /* isTypedMethod. Only relevant for methods. */
34809 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34810};
34811static const JSJitInfo enforcedByteNullable_setterinfo = {
34812 { (JSJitGetterOp)set_enforcedByteNullable },
34813 { prototypes::id::TestJSImplInterface },
34814 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34815 JSJitInfo::Setter,
34816 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34817 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34818 false, /* isInfallible. False in setters. */
34819 false, /* isMovable. Not relevant for setters. */
34820 false, /* isEliminatable. Not relevant for setters. */
34821 false, /* isAlwaysInSlot. Only relevant for getters. */
34822 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34823 false, /* isTypedMethod. Only relevant for methods. */
34824 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34825};
34826
34827MOZ_CAN_RUN_SCRIPT static bool
34828get_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34829{
34830 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34833( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34831 "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34833( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34832 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34833( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34833 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34833( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34834
34835 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34836 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34837 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34838 if (objIsXray) {
34839 unwrappedObj.emplace(cx, obj);
34840 }
34841 if (objIsXray) {
34842 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34843 // we know Xrays have no dynamic unwrap behavior.
34844 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34845 if (!unwrappedObj.ref()) {
34846 return false;
34847 }
34848 }
34849 FastErrorResult rv;
34850 int8_t result(MOZ_KnownLive(self)(self)->GetClampedByte(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
34851 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte getter"
)), 0))
) {
34852 return false;
34853 }
34854 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34854); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34854; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34855 args.rval().setInt32(int32_t(result));
34856 return true;
34857}
34858
34859MOZ_CAN_RUN_SCRIPT static bool
34860set_clampedByte(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34861{
34862 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34865( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34863 "TestJSImplInterface", "clampedByte", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34865( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34864 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34865( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34865 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34865( cx, "TestJSImplInterface"
, "clampedByte", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34866
34867 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34868 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34869 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34870 if (objIsXray) {
34871 unwrappedObj.emplace(cx, obj);
34872 }
34873 int8_t arg0;
34874 if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0)) {
34875 return false;
34876 }
34877 if (objIsXray) {
34878 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34879 // we know Xrays have no dynamic unwrap behavior.
34880 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34881 if (!unwrappedObj.ref()) {
34882 return false;
34883 }
34884 }
34885 FastErrorResult rv;
34886 // NOTE: This assert does NOT call the function.
34887 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetClampedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34888 MOZ_KnownLive(self)(self)->SetClampedByte(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34889 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByte setter"
)), 0))
) {
34890 return false;
34891 }
34892 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34892); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34892; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34893
34894 return true;
34895}
34896
34897static const JSJitInfo clampedByte_getterinfo = {
34898 { get_clampedByte },
34899 { prototypes::id::TestJSImplInterface },
34900 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34901 JSJitInfo::Getter,
34902 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34903 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
34904 false, /* isInfallible. False in setters. */
34905 false, /* isMovable. Not relevant for setters. */
34906 false, /* isEliminatable. Not relevant for setters. */
34907 false, /* isAlwaysInSlot. Only relevant for getters. */
34908 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34909 false, /* isTypedMethod. Only relevant for methods. */
34910 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34911};
34912static const JSJitInfo clampedByte_setterinfo = {
34913 { (JSJitGetterOp)set_clampedByte },
34914 { prototypes::id::TestJSImplInterface },
34915 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
34916 JSJitInfo::Setter,
34917 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
34918 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
34919 false, /* isInfallible. False in setters. */
34920 false, /* isMovable. Not relevant for setters. */
34921 false, /* isEliminatable. Not relevant for setters. */
34922 false, /* isAlwaysInSlot. Only relevant for getters. */
34923 false, /* isLazilyCachedInSlot. Only relevant for getters. */
34924 false, /* isTypedMethod. Only relevant for methods. */
34925 0 /* Reserved slot index, if we're stored in a slot, else 0. */
34926};
34927
34928MOZ_CAN_RUN_SCRIPT static bool
34929get_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
34930{
34931 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34934( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34932 "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34934( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34933 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject34934( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34934 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34934( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34935
34936 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34937 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34938 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34939 if (objIsXray) {
34940 unwrappedObj.emplace(cx, obj);
34941 }
34942 if (objIsXray) {
34943 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34944 // we know Xrays have no dynamic unwrap behavior.
34945 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34946 if (!unwrappedObj.ref()) {
34947 return false;
34948 }
34949 }
34950 FastErrorResult rv;
34951 Nullable<int8_t> result(MOZ_KnownLive(self)(self)->GetClampedByteNullable(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
34952 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable getter"
)), 0))
) {
34953 return false;
34954 }
34955 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34955); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34955; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
34956 if (result.IsNull()) {
34957 args.rval().setNull();
34958 return true;
34959 }
34960 args.rval().setInt32(int32_t(result.Value()));
34961 return true;
34962}
34963
34964MOZ_CAN_RUN_SCRIPT static bool
34965set_clampedByteNullable(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
34966{
34967 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject34970( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34968 "TestJSImplInterface", "clampedByteNullable", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject34970( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34969 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject34970( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
34970 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject34970( cx, "TestJSImplInterface"
, "clampedByteNullable", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
34971
34972 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
34973 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
34974 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
34975 if (objIsXray) {
34976 unwrappedObj.emplace(cx, obj);
34977 }
34978 Nullable<int8_t> arg0;
34979 if (args[0].isNullOrUndefined()) {
34980 arg0.SetNull();
34981 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, args[0], "Value being assigned", &arg0.SetValue())) {
34982 return false;
34983 }
34984 if (objIsXray) {
34985 // Since our object is an Xray, we can just CheckedUnwrapStatic:
34986 // we know Xrays have no dynamic unwrap behavior.
34987 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
34988 if (!unwrappedObj.ref()) {
34989 return false;
34990 }
34991 }
34992 FastErrorResult rv;
34993 // NOTE: This assert does NOT call the function.
34994 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetClampedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
34995 MOZ_KnownLive(self)(self)->SetClampedByteNullable(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
34996 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.clampedByteNullable setter"
)), 0))
) {
34997 return false;
34998 }
34999 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 34999); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 34999; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35000
35001 return true;
35002}
35003
35004static const JSJitInfo clampedByteNullable_getterinfo = {
35005 { get_clampedByteNullable },
35006 { prototypes::id::TestJSImplInterface },
35007 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35008 JSJitInfo::Getter,
35009 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35010 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
35011 false, /* isInfallible. False in setters. */
35012 false, /* isMovable. Not relevant for setters. */
35013 false, /* isEliminatable. Not relevant for setters. */
35014 false, /* isAlwaysInSlot. Only relevant for getters. */
35015 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35016 false, /* isTypedMethod. Only relevant for methods. */
35017 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35018};
35019static const JSJitInfo clampedByteNullable_setterinfo = {
35020 { (JSJitGetterOp)set_clampedByteNullable },
35021 { prototypes::id::TestJSImplInterface },
35022 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35023 JSJitInfo::Setter,
35024 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35025 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35026 false, /* isInfallible. False in setters. */
35027 false, /* isMovable. Not relevant for setters. */
35028 false, /* isEliminatable. Not relevant for setters. */
35029 false, /* isAlwaysInSlot. Only relevant for getters. */
35030 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35031 false, /* isTypedMethod. Only relevant for methods. */
35032 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35033};
35034
35035MOZ_CAN_RUN_SCRIPT static bool
35036exerciseTypedefInterfaces1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35037{
35038 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces1");
35039 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35042( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35040 "TestJSImplInterface", "exerciseTypedefInterfaces1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35042( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35041 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35042( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35042 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35042( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35043
35044 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35045 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces1", 1)) {
35046 return false;
35047 }
35048 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35049 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35050 if (objIsXray) {
35051 unwrappedObj.emplace(cx, obj);
35052 }
35053 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35054 if (args[0].isObject()) {
35055 {
35056 // Our JSContext should be in the right global to do unwrapping in.
35057 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35058 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35059 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35060 return false;
35061 }
35062 }
35063 } else {
35064 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35065 return false;
35066 }
35067 if (objIsXray) {
35068 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35069 // we know Xrays have no dynamic unwrap behavior.
35070 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35071 if (!unwrappedObj.ref()) {
35072 return false;
35073 }
35074 }
35075 FastErrorResult rv;
35076 // NOTE: This assert does NOT call the function.
35077 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35078 MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35079 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces1"
)), 0))
) {
35080 return false;
35081 }
35082 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35082; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35083 args.rval().setUndefined();
35084 return true;
35085}
35086
35087static const JSJitInfo exerciseTypedefInterfaces1_methodinfo = {
35088 { (JSJitGetterOp)exerciseTypedefInterfaces1 },
35089 { prototypes::id::TestJSImplInterface },
35090 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35091 JSJitInfo::Method,
35092 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35093 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35094 false, /* isInfallible. False in setters. */
35095 false, /* isMovable. Not relevant for setters. */
35096 false, /* isEliminatable. Not relevant for setters. */
35097 false, /* isAlwaysInSlot. Only relevant for getters. */
35098 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35099 false, /* isTypedMethod. Only relevant for methods. */
35100 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35101};
35102
35103MOZ_CAN_RUN_SCRIPT static bool
35104exerciseTypedefInterfaces2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35105{
35106 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces2");
35107 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35110( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35108 "TestJSImplInterface", "exerciseTypedefInterfaces2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35110( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35109 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35110( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35110 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35110( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35111
35112 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35113 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces2", 1)) {
35114 return false;
35115 }
35116 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35117 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35118 if (objIsXray) {
35119 unwrappedObj.emplace(cx, obj);
35120 }
35121 mozilla::dom::TestJSImplInterface* arg0;
35122 if (args[0].isObject()) {
35123 {
35124 // Our JSContext should be in the right global to do unwrapping in.
35125 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35126 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35127 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35128 return false;
35129 }
35130 }
35131 } else if (args[0].isNullOrUndefined()) {
35132 arg0 = nullptr;
35133 } else {
35134 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35135 return false;
35136 }
35137 if (objIsXray) {
35138 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35139 // we know Xrays have no dynamic unwrap behavior.
35140 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35141 if (!unwrappedObj.ref()) {
35142 return false;
35143 }
35144 }
35145 FastErrorResult rv;
35146 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces2(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
35147 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces2"
)), 0))
) {
35148 return false;
35149 }
35150 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35150); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35150; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35151 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
35152 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35152); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 35152; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
35153 return false;
35154 }
35155 return true;
35156}
35157
35158static const JSJitInfo exerciseTypedefInterfaces2_methodinfo = {
35159 { (JSJitGetterOp)exerciseTypedefInterfaces2 },
35160 { prototypes::id::TestJSImplInterface },
35161 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35162 JSJitInfo::Method,
35163 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35164 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
35165 false, /* isInfallible. False in setters. */
35166 false, /* isMovable. Not relevant for setters. */
35167 false, /* isEliminatable. Not relevant for setters. */
35168 false, /* isAlwaysInSlot. Only relevant for getters. */
35169 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35170 false, /* isTypedMethod. Only relevant for methods. */
35171 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35172};
35173
35174MOZ_CAN_RUN_SCRIPT static bool
35175exerciseTypedefInterfaces3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35176{
35177 BindingCallContext cx(cx_, "TestJSImplInterface.exerciseTypedefInterfaces3");
35178 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35181( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35179 "TestJSImplInterface", "exerciseTypedefInterfaces3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35181( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35180 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35181( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35181 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35181( cx, "TestJSImplInterface"
, "exerciseTypedefInterfaces3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35182
35183 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35184 if (!args.requireAtLeast(cx, "TestJSImplInterface.exerciseTypedefInterfaces3", 1)) {
35185 return false;
35186 }
35187 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35188 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35189 if (objIsXray) {
35190 unwrappedObj.emplace(cx, obj);
35191 }
35192 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35193 if (args[0].isObject()) {
35194 {
35195 // Our JSContext should be in the right global to do unwrapping in.
35196 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35197 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35198 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35199 return false;
35200 }
35201 }
35202 } else {
35203 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35204 return false;
35205 }
35206 if (objIsXray) {
35207 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35208 // we know Xrays have no dynamic unwrap behavior.
35209 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35210 if (!unwrappedObj.ref()) {
35211 return false;
35212 }
35213 }
35214 FastErrorResult rv;
35215 // NOTE: This assert does NOT call the function.
35216 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35217 MOZ_KnownLive(self)(self)->ExerciseTypedefInterfaces3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35218 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.exerciseTypedefInterfaces3"
)), 0))
) {
35219 return false;
35220 }
35221 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35221); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35221; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35222 args.rval().setUndefined();
35223 return true;
35224}
35225
35226static const JSJitInfo exerciseTypedefInterfaces3_methodinfo = {
35227 { (JSJitGetterOp)exerciseTypedefInterfaces3 },
35228 { prototypes::id::TestJSImplInterface },
35229 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35230 JSJitInfo::Method,
35231 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35232 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35233 false, /* isInfallible. False in setters. */
35234 false, /* isMovable. Not relevant for setters. */
35235 false, /* isEliminatable. Not relevant for setters. */
35236 false, /* isAlwaysInSlot. Only relevant for getters. */
35237 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35238 false, /* isTypedMethod. Only relevant for methods. */
35239 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35240};
35241
35242MOZ_CAN_RUN_SCRIPT static bool
35243get_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
35244{
35245 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35248( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35246 "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35248( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35247 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject35248( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35248 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35248( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35249
35250 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35251 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35252 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35253 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35254 if (objIsXray) {
35255 unwrappedObj.emplace(cx, obj);
35256 }
35257 if (objIsXray) {
35258 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35259 // we know Xrays have no dynamic unwrap behavior.
35260 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35261 if (!unwrappedObj.ref()) {
35262 return false;
35263 }
35264 }
35265 FastErrorResult rv;
35266 int8_t result(MOZ_KnownLive(self)(self)->GetDeprecatedAttribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35267 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute getter"
)), 0))
) {
35268 return false;
35269 }
35270 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35270); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35270; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35271 args.rval().setInt32(int32_t(result));
35272 return true;
35273}
35274
35275MOZ_CAN_RUN_SCRIPT static bool
35276set_deprecatedAttribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
35277{
35278 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35281( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35279 "TestJSImplInterface", "deprecatedAttribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35281( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35280 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject35281( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35281 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35281( cx, "TestJSImplInterface"
, "deprecatedAttribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35282
35283 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35284 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35285 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35286 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35287 if (objIsXray) {
35288 unwrappedObj.emplace(cx, obj);
35289 }
35290 int8_t arg0;
35291 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
35292 return false;
35293 }
35294 if (objIsXray) {
35295 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35296 // we know Xrays have no dynamic unwrap behavior.
35297 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35298 if (!unwrappedObj.ref()) {
35299 return false;
35300 }
35301 }
35302 FastErrorResult rv;
35303 // NOTE: This assert does NOT call the function.
35304 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetDeprecatedAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35305 MOZ_KnownLive(self)(self)->SetDeprecatedAttribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35306 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedAttribute setter"
)), 0))
) {
35307 return false;
35308 }
35309 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35309); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35309; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35310
35311 return true;
35312}
35313
35314static const JSJitInfo deprecatedAttribute_getterinfo = {
35315 { get_deprecatedAttribute },
35316 { prototypes::id::TestJSImplInterface },
35317 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35318 JSJitInfo::Getter,
35319 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35320 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
35321 false, /* isInfallible. False in setters. */
35322 false, /* isMovable. Not relevant for setters. */
35323 false, /* isEliminatable. Not relevant for setters. */
35324 false, /* isAlwaysInSlot. Only relevant for getters. */
35325 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35326 false, /* isTypedMethod. Only relevant for methods. */
35327 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35328};
35329static const JSJitInfo deprecatedAttribute_setterinfo = {
35330 { (JSJitGetterOp)set_deprecatedAttribute },
35331 { prototypes::id::TestJSImplInterface },
35332 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35333 JSJitInfo::Setter,
35334 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35335 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35336 false, /* isInfallible. False in setters. */
35337 false, /* isMovable. Not relevant for setters. */
35338 false, /* isEliminatable. Not relevant for setters. */
35339 false, /* isAlwaysInSlot. Only relevant for getters. */
35340 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35341 false, /* isTypedMethod. Only relevant for methods. */
35342 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35343};
35344
35345MOZ_CAN_RUN_SCRIPT static bool
35346deprecatedMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35347{
35348 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35351( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35349 "TestJSImplInterface", "deprecatedMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35351( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35350 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35351( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
35351 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35351( cx, "TestJSImplInterface"
, "deprecatedMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
35352
35353 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35354 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35355 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35356 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35357 if (objIsXray) {
35358 unwrappedObj.emplace(cx, obj);
35359 }
35360 if (objIsXray) {
35361 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35362 // we know Xrays have no dynamic unwrap behavior.
35363 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35364 if (!unwrappedObj.ref()) {
35365 return false;
35366 }
35367 }
35368 FastErrorResult rv;
35369 int8_t result(MOZ_KnownLive(self)(self)->DeprecatedMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35370 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethod"
)), 0))
) {
35371 return false;
35372 }
35373 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35373); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35373; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35374 args.rval().setInt32(int32_t(result));
35375 return true;
35376}
35377
35378static const JSJitInfo deprecatedMethod_methodinfo = {
35379 { (JSJitGetterOp)deprecatedMethod },
35380 { prototypes::id::TestJSImplInterface },
35381 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35382 JSJitInfo::Method,
35383 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35384 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
35385 false, /* isInfallible. False in setters. */
35386 false, /* isMovable. Not relevant for setters. */
35387 false, /* isEliminatable. Not relevant for setters. */
35388 false, /* isAlwaysInSlot. Only relevant for getters. */
35389 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35390 false, /* isTypedMethod. Only relevant for methods. */
35391 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35392};
35393
35394MOZ_CAN_RUN_SCRIPT static bool
35395deprecatedMethodWithContext(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35396{
35397 BindingCallContext cx(cx_, "TestJSImplInterface.deprecatedMethodWithContext");
35398 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35401( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35399 "TestJSImplInterface", "deprecatedMethodWithContext", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35401( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35400 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35401( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
35401 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35401( cx, "TestJSImplInterface"
, "deprecatedMethodWithContext", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
35402
35403 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35404 if (!args.requireAtLeast(cx, "TestJSImplInterface.deprecatedMethodWithContext", 1)) {
35405 return false;
35406 }
35407 DeprecationWarning(cx, obj, DeprecatedOperations::eComponents);
35408 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35409 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35410 if (objIsXray) {
35411 unwrappedObj.emplace(cx, obj);
35412 }
35413 JS::Rooted<JS::Value> arg0(cx);
35414#ifdef __clang__1
35415#pragma clang diagnostic push
35416#pragma clang diagnostic ignored "-Wunreachable-code"
35417#pragma clang diagnostic ignored "-Wunreachable-code-return"
35418#endif // __clang__
35419 if ((true) && !CallerSubsumes(args[0])) {
35420 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
35421 return false;
35422 }
35423#ifdef __clang__1
35424#pragma clang diagnostic pop
35425#endif // __clang__
35426 arg0 = args[0];
35427 if (objIsXray) {
35428 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35429 // we know Xrays have no dynamic unwrap behavior.
35430 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35431 if (!unwrappedObj.ref()) {
35432 return false;
35433 }
35434 }
35435 FastErrorResult rv;
35436 // NOTE: This assert does NOT call the function.
35437 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->DeprecatedMethodWithContext(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35438 MOZ_KnownLive(self)(self)->DeprecatedMethodWithContext(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35439 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.deprecatedMethodWithContext"
)), 0))
) {
35440 return false;
35441 }
35442 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35442); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35442; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35443 args.rval().setUndefined();
35444 return true;
35445}
35446
35447static const JSJitInfo deprecatedMethodWithContext_methodinfo = {
35448 { (JSJitGetterOp)deprecatedMethodWithContext },
35449 { prototypes::id::TestJSImplInterface },
35450 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35451 JSJitInfo::Method,
35452 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35453 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35454 false, /* isInfallible. False in setters. */
35455 false, /* isMovable. Not relevant for setters. */
35456 false, /* isEliminatable. Not relevant for setters. */
35457 false, /* isAlwaysInSlot. Only relevant for getters. */
35458 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35459 false, /* isTypedMethod. Only relevant for methods. */
35460 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35461};
35462
35463MOZ_CAN_RUN_SCRIPT static bool
35464overload1(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35465{
35466 BindingCallContext cx(cx_, "TestJSImplInterface.overload1");
35467 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35470( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35468 "TestJSImplInterface", "overload1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35470( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35469 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35470( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35470 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35470( cx, "TestJSImplInterface"
, "overload1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35471
35472 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35473 unsigned argcount = std::min(args.length(), 2u);
35474 switch (argcount) {
35475 case 1: {
35476 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35477 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35478 if (objIsXray) {
35479 unwrappedObj.emplace(cx, obj);
35480 }
35481 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35482 if (args[0].isObject()) {
35483 {
35484 // Our JSContext should be in the right global to do unwrapping in.
35485 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35486 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35487 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestJSImplInterface");
35488 return false;
35489 }
35490 }
35491 } else {
35492 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
35493 return false;
35494 }
35495 if (objIsXray) {
35496 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35497 // we know Xrays have no dynamic unwrap behavior.
35498 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35499 if (!unwrappedObj.ref()) {
35500 return false;
35501 }
35502 }
35503 FastErrorResult rv;
35504 bool result(MOZ_KnownLive(self)(self)->Overload1(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
35505 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"
)), 0))
) {
35506 return false;
35507 }
35508 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35508; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35509 args.rval().setBoolean(result);
35510 return true;
35511 break;
35512 }
35513 case 2: {
35514 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35515 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35516 if (objIsXray) {
35517 unwrappedObj.emplace(cx, obj);
35518 }
35519 binding_detail::FakeString<char16_t> arg0;
35520 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
35521 return false;
35522 }
35523 NonNull<mozilla::dom::TestJSImplInterface> arg1;
35524 if (args[1].isObject()) {
35525 {
35526 // Our JSContext should be in the right global to do unwrapping in.
35527 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[1], arg1, cx);
35528 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35529 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestJSImplInterface");
35530 return false;
35531 }
35532 }
35533 } else {
35534 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
35535 return false;
35536 }
35537 if (objIsXray) {
35538 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35539 // we know Xrays have no dynamic unwrap behavior.
35540 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35541 if (!unwrappedObj.ref()) {
35542 return false;
35543 }
35544 }
35545 FastErrorResult rv;
35546 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->Overload1(NonNullHelper(Constify(arg0)), MOZ_KnownLive(NonNullHelper(arg1))(NonNullHelper(arg1)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
35547 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload1"
)), 0))
) {
35548 return false;
35549 }
35550 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35550); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35550; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35551 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
35552 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 35552; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
35553 return false;
35554 }
35555 return true;
35556 break;
35557 }
35558 default: {
35559 // Using nsPrintfCString here would require including that
35560 // header. Let's not worry about it.
35561 nsAutoCString argCountStr;
35562 argCountStr.AppendPrintf("%u", args.length());
35563 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
35564 }
35565 }
35566 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 35566); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 35566; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
35567 return false;
35568}
35569
35570static const JSJitInfo overload1_methodinfo = {
35571 { (JSJitGetterOp)overload1 },
35572 { prototypes::id::TestJSImplInterface },
35573 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35574 JSJitInfo::Method,
35575 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35576 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
35577 false, /* isInfallible. False in setters. */
35578 false, /* isMovable. Not relevant for setters. */
35579 false, /* isEliminatable. Not relevant for setters. */
35580 false, /* isAlwaysInSlot. Only relevant for getters. */
35581 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35582 false, /* isTypedMethod. Only relevant for methods. */
35583 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35584};
35585
35586MOZ_CAN_RUN_SCRIPT static bool
35587overload2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35588{
35589 BindingCallContext cx(cx_, "TestJSImplInterface.overload2");
35590 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35593( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35591 "TestJSImplInterface", "overload2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35593( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35592 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35593( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35593 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35593( cx, "TestJSImplInterface"
, "overload2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35594
35595 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35596 unsigned argcount = std::min(args.length(), 1u);
35597 switch (argcount) {
35598 case 0: {
35599 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35600 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35601 if (objIsXray) {
35602 unwrappedObj.emplace(cx, obj);
35603 }
35604 RootedDictionary<binding_detail::FastDict> arg0(cx);
35605 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
35606 return false;
35607 }
35608 if (objIsXray) {
35609 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35610 // we know Xrays have no dynamic unwrap behavior.
35611 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35612 if (!unwrappedObj.ref()) {
35613 return false;
35614 }
35615 }
35616 FastErrorResult rv;
35617 // NOTE: This assert does NOT call the function.
35618 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35619 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35620 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35621 return false;
35622 }
35623 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35623); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35623; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35624 args.rval().setUndefined();
35625 return true;
35626 break;
35627 }
35628 case 1: {
35629 if (args[0].isNullOrUndefined()) {
35630 RootedDictionary<binding_detail::FastDict> arg0(cx);
35631 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
35632 return false;
35633 }
35634 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35635 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35636 if (objIsXray) {
35637 unwrappedObj.emplace(cx, obj);
35638 }
35639 if (objIsXray) {
35640 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35641 // we know Xrays have no dynamic unwrap behavior.
35642 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35643 if (!unwrappedObj.ref()) {
35644 return false;
35645 }
35646 }
35647 FastErrorResult rv;
35648 // NOTE: This assert does NOT call the function.
35649 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35650 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35651 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35652 return false;
35653 }
35654 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35654); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35654; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35655 args.rval().setUndefined();
35656 return true;
35657 }
35658 if (args[0].isObject()) {
35659 do {
35660 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35661 {
35662 // Our JSContext should be in the right global to do unwrapping in.
35663 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35664 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35665 break;
35666 }
35667 }
35668 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35669 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35670 if (objIsXray) {
35671 unwrappedObj.emplace(cx, obj);
35672 }
35673 if (objIsXray) {
35674 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35675 // we know Xrays have no dynamic unwrap behavior.
35676 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35677 if (!unwrappedObj.ref()) {
35678 return false;
35679 }
35680 }
35681 FastErrorResult rv;
35682 // NOTE: This assert does NOT call the function.
35683 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35684 MOZ_KnownLive(self)(self)->Overload2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35685 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35686 return false;
35687 }
35688 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35688); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35688; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35689 args.rval().setUndefined();
35690 return true;
35691 } while (false);
35692 do {
35693 RootedDictionary<binding_detail::FastDict> arg0(cx);
35694 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
35695 return false;
35696 }
35697 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35698 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35699 if (objIsXray) {
35700 unwrappedObj.emplace(cx, obj);
35701 }
35702 if (objIsXray) {
35703 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35704 // we know Xrays have no dynamic unwrap behavior.
35705 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35706 if (!unwrappedObj.ref()) {
35707 return false;
35708 }
35709 }
35710 FastErrorResult rv;
35711 // NOTE: This assert does NOT call the function.
35712 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35713 MOZ_KnownLive(self)(self)->Overload2(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35714 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35715 return false;
35716 }
35717 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35717); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35717; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35718 args.rval().setUndefined();
35719 return true;
35720 } while (false);
35721 }
35722 if (args[0].isBoolean()) {
35723 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35724 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35725 if (objIsXray) {
35726 unwrappedObj.emplace(cx, obj);
35727 }
35728 bool arg0;
35729 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
35730 return false;
35731 }
35732 if (objIsXray) {
35733 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35734 // we know Xrays have no dynamic unwrap behavior.
35735 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35736 if (!unwrappedObj.ref()) {
35737 return false;
35738 }
35739 }
35740 FastErrorResult rv;
35741 // NOTE: This assert does NOT call the function.
35742 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35743 MOZ_KnownLive(self)(self)->Overload2(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35744 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35745 return false;
35746 }
35747 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35747); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35747; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35748 args.rval().setUndefined();
35749 return true;
35750 }
35751 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35752 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35753 if (objIsXray) {
35754 unwrappedObj.emplace(cx, obj);
35755 }
35756 binding_detail::FakeString<char16_t> arg0;
35757 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
35758 return false;
35759 }
35760 if (objIsXray) {
35761 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35762 // we know Xrays have no dynamic unwrap behavior.
35763 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35764 if (!unwrappedObj.ref()) {
35765 return false;
35766 }
35767 }
35768 FastErrorResult rv;
35769 // NOTE: This assert does NOT call the function.
35770 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload2(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35771 MOZ_KnownLive(self)(self)->Overload2(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35772 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload2"
)), 0))
) {
35773 return false;
35774 }
35775 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35775); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35775; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35776 args.rval().setUndefined();
35777 return true;
35778 break;
35779 }
35780 default: {
35781 // Using nsPrintfCString here would require including that
35782 // header. Let's not worry about it.
35783 nsAutoCString argCountStr;
35784 argCountStr.AppendPrintf("%u", args.length());
35785 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
35786 }
35787 }
35788 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 35788); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 35788; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
35789 return false;
35790}
35791
35792static const JSJitInfo overload2_methodinfo = {
35793 { (JSJitGetterOp)overload2 },
35794 { prototypes::id::TestJSImplInterface },
35795 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35796 JSJitInfo::Method,
35797 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35798 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35799 false, /* isInfallible. False in setters. */
35800 false, /* isMovable. Not relevant for setters. */
35801 false, /* isEliminatable. Not relevant for setters. */
35802 false, /* isAlwaysInSlot. Only relevant for getters. */
35803 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35804 false, /* isTypedMethod. Only relevant for methods. */
35805 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35806};
35807
35808MOZ_CAN_RUN_SCRIPT static bool
35809overload3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35810{
35811 BindingCallContext cx(cx_, "TestJSImplInterface.overload3");
35812 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35815( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35813 "TestJSImplInterface", "overload3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35815( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35814 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35815( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35815 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35815( cx, "TestJSImplInterface"
, "overload3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35816
35817 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35818 unsigned argcount = std::min(args.length(), 1u);
35819 switch (argcount) {
35820 case 1: {
35821 if (args[0].isObject()) {
35822 do {
35823 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35824 {
35825 // Our JSContext should be in the right global to do unwrapping in.
35826 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35827 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35828 break;
35829 }
35830 }
35831 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35832 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35833 if (objIsXray) {
35834 unwrappedObj.emplace(cx, obj);
35835 }
35836 if (objIsXray) {
35837 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35838 // we know Xrays have no dynamic unwrap behavior.
35839 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35840 if (!unwrappedObj.ref()) {
35841 return false;
35842 }
35843 }
35844 FastErrorResult rv;
35845 // NOTE: This assert does NOT call the function.
35846 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35847 MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35848 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
35849 return false;
35850 }
35851 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35851); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35851; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35852 args.rval().setUndefined();
35853 return true;
35854 } while (false);
35855 do {
35856 RootedCallback<OwningNonNull<binding_detail::FastMyTestCallback>> arg0(cx);
35857 if (JS::IsCallable(&args[0].toObject())) {
35858 { // scope for tempRoot and tempGlobalRoot if needed
35859 arg0 = new binding_detail::FastMyTestCallback(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
35860 }
35861 } else {
35862 break;
35863 }
35864 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35865 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35866 if (objIsXray) {
35867 unwrappedObj.emplace(cx, obj);
35868 }
35869 if (objIsXray) {
35870 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35871 // we know Xrays have no dynamic unwrap behavior.
35872 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35873 if (!unwrappedObj.ref()) {
35874 return false;
35875 }
35876 }
35877 FastErrorResult rv;
35878 // NOTE: This assert does NOT call the function.
35879 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35880 MOZ_KnownLive(self)(self)->Overload3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35881 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
35882 return false;
35883 }
35884 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35884); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35884; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35885 args.rval().setUndefined();
35886 return true;
35887 } while (false);
35888 }
35889 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35890 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35891 if (objIsXray) {
35892 unwrappedObj.emplace(cx, obj);
35893 }
35894 bool arg0;
35895 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
35896 return false;
35897 }
35898 if (objIsXray) {
35899 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35900 // we know Xrays have no dynamic unwrap behavior.
35901 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35902 if (!unwrappedObj.ref()) {
35903 return false;
35904 }
35905 }
35906 FastErrorResult rv;
35907 // NOTE: This assert does NOT call the function.
35908 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload3(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35909 MOZ_KnownLive(self)(self)->Overload3(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35910 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload3"
)), 0))
) {
35911 return false;
35912 }
35913 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35913); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35913; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35914 args.rval().setUndefined();
35915 return true;
35916 break;
35917 }
35918 default: {
35919 // Using nsPrintfCString here would require including that
35920 // header. Let's not worry about it.
35921 nsAutoCString argCountStr;
35922 argCountStr.AppendPrintf("%u", args.length());
35923 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
35924 }
35925 }
35926 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 35926); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 35926; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
35927 return false;
35928}
35929
35930static const JSJitInfo overload3_methodinfo = {
35931 { (JSJitGetterOp)overload3 },
35932 { prototypes::id::TestJSImplInterface },
35933 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
35934 JSJitInfo::Method,
35935 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
35936 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
35937 false, /* isInfallible. False in setters. */
35938 false, /* isMovable. Not relevant for setters. */
35939 false, /* isEliminatable. Not relevant for setters. */
35940 false, /* isAlwaysInSlot. Only relevant for getters. */
35941 false, /* isLazilyCachedInSlot. Only relevant for getters. */
35942 false, /* isTypedMethod. Only relevant for methods. */
35943 0 /* Reserved slot index, if we're stored in a slot, else 0. */
35944};
35945
35946MOZ_CAN_RUN_SCRIPT static bool
35947overload4(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
35948{
35949 BindingCallContext cx(cx_, "TestJSImplInterface.overload4");
35950 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject35953( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35951 "TestJSImplInterface", "overload4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject35953( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35952 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject35953( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
35953 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject35953( cx, "TestJSImplInterface"
, "overload4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
35954
35955 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
35956 unsigned argcount = std::min(args.length(), 1u);
35957 switch (argcount) {
35958 case 1: {
35959 if (args[0].isObject()) {
35960 do {
35961 NonNull<mozilla::dom::TestJSImplInterface> arg0;
35962 {
35963 // Our JSContext should be in the right global to do unwrapping in.
35964 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
35965 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
35966 break;
35967 }
35968 }
35969 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35970 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
35971 if (objIsXray) {
35972 unwrappedObj.emplace(cx, obj);
35973 }
35974 if (objIsXray) {
35975 // Since our object is an Xray, we can just CheckedUnwrapStatic:
35976 // we know Xrays have no dynamic unwrap behavior.
35977 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
35978 if (!unwrappedObj.ref()) {
35979 return false;
35980 }
35981 }
35982 FastErrorResult rv;
35983 // NOTE: This assert does NOT call the function.
35984 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
35985 MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
35986 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
35987 return false;
35988 }
35989 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 35989); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 35989; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
35990 args.rval().setUndefined();
35991 return true;
35992 } while (false);
35993 do {
35994 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
35995 { // scope for tempRoot and tempGlobalRoot if needed
35996 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
35997 }
35998 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
35999 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36000 if (objIsXray) {
36001 unwrappedObj.emplace(cx, obj);
36002 }
36003 if (objIsXray) {
36004 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36005 // we know Xrays have no dynamic unwrap behavior.
36006 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36007 if (!unwrappedObj.ref()) {
36008 return false;
36009 }
36010 }
36011 FastErrorResult rv;
36012 // NOTE: This assert does NOT call the function.
36013 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36014 MOZ_KnownLive(self)(self)->Overload4(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36015 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
36016 return false;
36017 }
36018 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36018); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36018; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36019 args.rval().setUndefined();
36020 return true;
36021 } while (false);
36022 }
36023 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36024 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36025 if (objIsXray) {
36026 unwrappedObj.emplace(cx, obj);
36027 }
36028 binding_detail::FakeString<char16_t> arg0;
36029 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
36030 return false;
36031 }
36032 if (objIsXray) {
36033 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36034 // we know Xrays have no dynamic unwrap behavior.
36035 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36036 if (!unwrappedObj.ref()) {
36037 return false;
36038 }
36039 }
36040 FastErrorResult rv;
36041 // NOTE: This assert does NOT call the function.
36042 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload4(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36043 MOZ_KnownLive(self)(self)->Overload4(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36044 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload4"
)), 0))
) {
36045 return false;
36046 }
36047 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36047); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36047; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36048 args.rval().setUndefined();
36049 return true;
36050 break;
36051 }
36052 default: {
36053 // Using nsPrintfCString here would require including that
36054 // header. Let's not worry about it.
36055 nsAutoCString argCountStr;
36056 argCountStr.AppendPrintf("%u", args.length());
36057 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36058 }
36059 }
36060 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36060); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36060; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36061 return false;
36062}
36063
36064static const JSJitInfo overload4_methodinfo = {
36065 { (JSJitGetterOp)overload4 },
36066 { prototypes::id::TestJSImplInterface },
36067 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36068 JSJitInfo::Method,
36069 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36070 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36071 false, /* isInfallible. False in setters. */
36072 false, /* isMovable. Not relevant for setters. */
36073 false, /* isEliminatable. Not relevant for setters. */
36074 false, /* isAlwaysInSlot. Only relevant for getters. */
36075 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36076 false, /* isTypedMethod. Only relevant for methods. */
36077 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36078};
36079
36080MOZ_CAN_RUN_SCRIPT static bool
36081overload5(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36082{
36083 BindingCallContext cx(cx_, "TestJSImplInterface.overload5");
36084 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36087( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36085 "TestJSImplInterface", "overload5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36087( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36086 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36087( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36087 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36087( cx, "TestJSImplInterface"
, "overload5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36088
36089 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36090 unsigned argcount = std::min(args.length(), 1u);
36091 switch (argcount) {
36092 case 1: {
36093 if (args[0].isNumber()) {
36094 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36095 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36096 if (objIsXray) {
36097 unwrappedObj.emplace(cx, obj);
36098 }
36099 int32_t arg0;
36100 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36101 return false;
36102 }
36103 if (objIsXray) {
36104 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36105 // we know Xrays have no dynamic unwrap behavior.
36106 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36107 if (!unwrappedObj.ref()) {
36108 return false;
36109 }
36110 }
36111 FastErrorResult rv;
36112 // NOTE: This assert does NOT call the function.
36113 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36114 MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36115 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"
)), 0))
) {
36116 return false;
36117 }
36118 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36118); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36118; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36119 args.rval().setUndefined();
36120 return true;
36121 }
36122 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36123 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36124 if (objIsXray) {
36125 unwrappedObj.emplace(cx, obj);
36126 }
36127 MyTestEnum arg0;
36128 {
36129 int index;
36130 if (!binding_detail::FindEnumStringIndex<true>(cx, args[0],
36131 binding_detail::EnumStrings<MyTestEnum>::Values,
36132 "MyTestEnum", "argument 1",
36133 &index)) {
36134 return false;
36135 }
36136 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 36136); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 36136; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
36137 arg0 = static_cast<MyTestEnum>(index);
36138 }
36139 if (objIsXray) {
36140 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36141 // we know Xrays have no dynamic unwrap behavior.
36142 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36143 if (!unwrappedObj.ref()) {
36144 return false;
36145 }
36146 }
36147 FastErrorResult rv;
36148 // NOTE: This assert does NOT call the function.
36149 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36150 MOZ_KnownLive(self)(self)->Overload5(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36151 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload5"
)), 0))
) {
36152 return false;
36153 }
36154 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36154); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36154; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36155 args.rval().setUndefined();
36156 return true;
36157 break;
36158 }
36159 default: {
36160 // Using nsPrintfCString here would require including that
36161 // header. Let's not worry about it.
36162 nsAutoCString argCountStr;
36163 argCountStr.AppendPrintf("%u", args.length());
36164 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36165 }
36166 }
36167 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36167); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36167; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36168 return false;
36169}
36170
36171static const JSJitInfo overload5_methodinfo = {
36172 { (JSJitGetterOp)overload5 },
36173 { prototypes::id::TestJSImplInterface },
36174 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36175 JSJitInfo::Method,
36176 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36177 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36178 false, /* isInfallible. False in setters. */
36179 false, /* isMovable. Not relevant for setters. */
36180 false, /* isEliminatable. Not relevant for setters. */
36181 false, /* isAlwaysInSlot. Only relevant for getters. */
36182 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36183 false, /* isTypedMethod. Only relevant for methods. */
36184 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36185};
36186
36187MOZ_CAN_RUN_SCRIPT static bool
36188overload6(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36189{
36190 BindingCallContext cx(cx_, "TestJSImplInterface.overload6");
36191 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36194( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36192 "TestJSImplInterface", "overload6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36194( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36193 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36194( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36194 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36194( cx, "TestJSImplInterface"
, "overload6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36195
36196 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36197 unsigned argcount = std::min(args.length(), 1u);
36198 switch (argcount) {
36199 case 1: {
36200 if (args[0].isBoolean()) {
36201 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36202 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36203 if (objIsXray) {
36204 unwrappedObj.emplace(cx, obj);
36205 }
36206 bool arg0;
36207 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36208 return false;
36209 }
36210 if (objIsXray) {
36211 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36212 // we know Xrays have no dynamic unwrap behavior.
36213 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36214 if (!unwrappedObj.ref()) {
36215 return false;
36216 }
36217 }
36218 FastErrorResult rv;
36219 // NOTE: This assert does NOT call the function.
36220 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36221 MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36222 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"
)), 0))
) {
36223 return false;
36224 }
36225 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36225; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36226 args.rval().setUndefined();
36227 return true;
36228 }
36229 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36230 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36231 if (objIsXray) {
36232 unwrappedObj.emplace(cx, obj);
36233 }
36234 int32_t arg0;
36235 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36236 return false;
36237 }
36238 if (objIsXray) {
36239 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36240 // we know Xrays have no dynamic unwrap behavior.
36241 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36242 if (!unwrappedObj.ref()) {
36243 return false;
36244 }
36245 }
36246 FastErrorResult rv;
36247 // NOTE: This assert does NOT call the function.
36248 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36249 MOZ_KnownLive(self)(self)->Overload6(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36250 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload6"
)), 0))
) {
36251 return false;
36252 }
36253 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36253; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36254 args.rval().setUndefined();
36255 return true;
36256 break;
36257 }
36258 default: {
36259 // Using nsPrintfCString here would require including that
36260 // header. Let's not worry about it.
36261 nsAutoCString argCountStr;
36262 argCountStr.AppendPrintf("%u", args.length());
36263 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36264 }
36265 }
36266 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36266); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36266; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36267 return false;
36268}
36269
36270static const JSJitInfo overload6_methodinfo = {
36271 { (JSJitGetterOp)overload6 },
36272 { prototypes::id::TestJSImplInterface },
36273 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36274 JSJitInfo::Method,
36275 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36276 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36277 false, /* isInfallible. False in setters. */
36278 false, /* isMovable. Not relevant for setters. */
36279 false, /* isEliminatable. Not relevant for setters. */
36280 false, /* isAlwaysInSlot. Only relevant for getters. */
36281 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36282 false, /* isTypedMethod. Only relevant for methods. */
36283 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36284};
36285
36286MOZ_CAN_RUN_SCRIPT static bool
36287overload7(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36288{
36289 BindingCallContext cx(cx_, "TestJSImplInterface.overload7");
36290 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36293( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36291 "TestJSImplInterface", "overload7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36293( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36292 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36293( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36293 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36293( cx, "TestJSImplInterface"
, "overload7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36294
36295 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36296 unsigned argcount = std::min(args.length(), 1u);
36297 switch (argcount) {
36298 case 1: {
36299 if (args[0].isBoolean()) {
36300 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36301 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36302 if (objIsXray) {
36303 unwrappedObj.emplace(cx, obj);
36304 }
36305 bool arg0;
36306 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36307 return false;
36308 }
36309 if (objIsXray) {
36310 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36311 // we know Xrays have no dynamic unwrap behavior.
36312 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36313 if (!unwrappedObj.ref()) {
36314 return false;
36315 }
36316 }
36317 FastErrorResult rv;
36318 // NOTE: This assert does NOT call the function.
36319 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36320 MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36321 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36322 return false;
36323 }
36324 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36324); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36324; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36325 args.rval().setUndefined();
36326 return true;
36327 }
36328 if (args[0].isNumber()) {
36329 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36330 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36331 if (objIsXray) {
36332 unwrappedObj.emplace(cx, obj);
36333 }
36334 int32_t arg0;
36335 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36336 return false;
36337 }
36338 if (objIsXray) {
36339 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36340 // we know Xrays have no dynamic unwrap behavior.
36341 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36342 if (!unwrappedObj.ref()) {
36343 return false;
36344 }
36345 }
36346 FastErrorResult rv;
36347 // NOTE: This assert does NOT call the function.
36348 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36349 MOZ_KnownLive(self)(self)->Overload7(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36350 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36351 return false;
36352 }
36353 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36353); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36353; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36354 args.rval().setUndefined();
36355 return true;
36356 }
36357 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36358 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36359 if (objIsXray) {
36360 unwrappedObj.emplace(cx, obj);
36361 }
36362 nsCString arg0;
36363 if (!ConvertJSValueToByteString(cx, args[0], false, "argument 1", arg0)) {
36364 return false;
36365 }
36366 if (objIsXray) {
36367 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36368 // we know Xrays have no dynamic unwrap behavior.
36369 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36370 if (!unwrappedObj.ref()) {
36371 return false;
36372 }
36373 }
36374 FastErrorResult rv;
36375 // NOTE: This assert does NOT call the function.
36376 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36377 MOZ_KnownLive(self)(self)->Overload7(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36378 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload7"
)), 0))
) {
36379 return false;
36380 }
36381 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36381); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36381; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36382 args.rval().setUndefined();
36383 return true;
36384 break;
36385 }
36386 default: {
36387 // Using nsPrintfCString here would require including that
36388 // header. Let's not worry about it.
36389 nsAutoCString argCountStr;
36390 argCountStr.AppendPrintf("%u", args.length());
36391 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36392 }
36393 }
36394 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36394); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36394; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36395 return false;
36396}
36397
36398static const JSJitInfo overload7_methodinfo = {
36399 { (JSJitGetterOp)overload7 },
36400 { prototypes::id::TestJSImplInterface },
36401 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36402 JSJitInfo::Method,
36403 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36404 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36405 false, /* isInfallible. False in setters. */
36406 false, /* isMovable. Not relevant for setters. */
36407 false, /* isEliminatable. Not relevant for setters. */
36408 false, /* isAlwaysInSlot. Only relevant for getters. */
36409 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36410 false, /* isTypedMethod. Only relevant for methods. */
36411 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36412};
36413
36414MOZ_CAN_RUN_SCRIPT static bool
36415overload8(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36416{
36417 BindingCallContext cx(cx_, "TestJSImplInterface.overload8");
36418 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36421( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36419 "TestJSImplInterface", "overload8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36421( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36420 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36421( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36421 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36421( cx, "TestJSImplInterface"
, "overload8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36422
36423 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36424 unsigned argcount = std::min(args.length(), 1u);
36425 switch (argcount) {
36426 case 1: {
36427 if (args[0].isObject()) {
36428 do {
36429 NonNull<mozilla::dom::TestJSImplInterface> arg0;
36430 {
36431 // Our JSContext should be in the right global to do unwrapping in.
36432 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[0], arg0, cx);
36433 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
36434 break;
36435 }
36436 }
36437 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36438 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36439 if (objIsXray) {
36440 unwrappedObj.emplace(cx, obj);
36441 }
36442 if (objIsXray) {
36443 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36444 // we know Xrays have no dynamic unwrap behavior.
36445 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36446 if (!unwrappedObj.ref()) {
36447 return false;
36448 }
36449 }
36450 FastErrorResult rv;
36451 // NOTE: This assert does NOT call the function.
36452 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload8(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36453 MOZ_KnownLive(self)(self)->Overload8(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36454 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"
)), 0))
) {
36455 return false;
36456 }
36457 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36457); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36457; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36458 args.rval().setUndefined();
36459 return true;
36460 } while (false);
36461 }
36462 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36463 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36464 if (objIsXray) {
36465 unwrappedObj.emplace(cx, obj);
36466 }
36467 int32_t arg0;
36468 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36469 return false;
36470 }
36471 if (objIsXray) {
36472 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36473 // we know Xrays have no dynamic unwrap behavior.
36474 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36475 if (!unwrappedObj.ref()) {
36476 return false;
36477 }
36478 }
36479 FastErrorResult rv;
36480 // NOTE: This assert does NOT call the function.
36481 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload8(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36482 MOZ_KnownLive(self)(self)->Overload8(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36483 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload8"
)), 0))
) {
36484 return false;
36485 }
36486 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36486); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36486; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36487 args.rval().setUndefined();
36488 return true;
36489 break;
36490 }
36491 default: {
36492 // Using nsPrintfCString here would require including that
36493 // header. Let's not worry about it.
36494 nsAutoCString argCountStr;
36495 argCountStr.AppendPrintf("%u", args.length());
36496 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36497 }
36498 }
36499 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36499); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36499; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36500 return false;
36501}
36502
36503static const JSJitInfo overload8_methodinfo = {
36504 { (JSJitGetterOp)overload8 },
36505 { prototypes::id::TestJSImplInterface },
36506 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36507 JSJitInfo::Method,
36508 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36509 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36510 false, /* isInfallible. False in setters. */
36511 false, /* isMovable. Not relevant for setters. */
36512 false, /* isEliminatable. Not relevant for setters. */
36513 false, /* isAlwaysInSlot. Only relevant for getters. */
36514 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36515 false, /* isTypedMethod. Only relevant for methods. */
36516 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36517};
36518
36519MOZ_CAN_RUN_SCRIPT static bool
36520overload9(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36521{
36522 BindingCallContext cx(cx_, "TestJSImplInterface.overload9");
36523 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36526( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36524 "TestJSImplInterface", "overload9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36526( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36525 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36526( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
36526 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36526( cx, "TestJSImplInterface"
, "overload9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
36527
36528 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36529 unsigned argcount = std::min(args.length(), 1u);
36530 switch (argcount) {
36531 case 1: {
36532 if (args[0].isNullOrUndefined()) {
36533 Nullable<int32_t> arg0;
36534 if (args[0].isNullOrUndefined()) {
36535 arg0.SetNull();
36536 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36537 return false;
36538 }
36539 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36540 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36541 if (objIsXray) {
36542 unwrappedObj.emplace(cx, obj);
36543 }
36544 if (objIsXray) {
36545 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36546 // we know Xrays have no dynamic unwrap behavior.
36547 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36548 if (!unwrappedObj.ref()) {
36549 return false;
36550 }
36551 }
36552 FastErrorResult rv;
36553 // NOTE: This assert does NOT call the function.
36554 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36555 MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36556 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36557 return false;
36558 }
36559 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36559); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36559; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36560 args.rval().setUndefined();
36561 return true;
36562 }
36563 if (args[0].isNumber()) {
36564 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36565 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36566 if (objIsXray) {
36567 unwrappedObj.emplace(cx, obj);
36568 }
36569 Nullable<int32_t> arg0;
36570 if (args[0].isNullOrUndefined()) {
36571 arg0.SetNull();
36572 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36573 return false;
36574 }
36575 if (objIsXray) {
36576 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36577 // we know Xrays have no dynamic unwrap behavior.
36578 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36579 if (!unwrappedObj.ref()) {
36580 return false;
36581 }
36582 }
36583 FastErrorResult rv;
36584 // NOTE: This assert does NOT call the function.
36585 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36586 MOZ_KnownLive(self)(self)->Overload9(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36587 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36588 return false;
36589 }
36590 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36590); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36590; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36591 args.rval().setUndefined();
36592 return true;
36593 }
36594 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36595 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36596 if (objIsXray) {
36597 unwrappedObj.emplace(cx, obj);
36598 }
36599 binding_detail::FakeString<char16_t> arg0;
36600 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
36601 return false;
36602 }
36603 if (objIsXray) {
36604 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36605 // we know Xrays have no dynamic unwrap behavior.
36606 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36607 if (!unwrappedObj.ref()) {
36608 return false;
36609 }
36610 }
36611 FastErrorResult rv;
36612 // NOTE: This assert does NOT call the function.
36613 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload9(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36614 MOZ_KnownLive(self)(self)->Overload9(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36615 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload9"
)), 0))
) {
36616 return false;
36617 }
36618 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36618); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36618; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36619 args.rval().setUndefined();
36620 return true;
36621 break;
36622 }
36623 default: {
36624 // Using nsPrintfCString here would require including that
36625 // header. Let's not worry about it.
36626 nsAutoCString argCountStr;
36627 argCountStr.AppendPrintf("%u", args.length());
36628 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36629 }
36630 }
36631 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36631); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36631; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36632 return false;
36633}
36634
36635static const JSJitInfo overload9_methodinfo = {
36636 { (JSJitGetterOp)overload9 },
36637 { prototypes::id::TestJSImplInterface },
36638 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36639 JSJitInfo::Method,
36640 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36641 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36642 false, /* isInfallible. False in setters. */
36643 false, /* isMovable. Not relevant for setters. */
36644 false, /* isEliminatable. Not relevant for setters. */
36645 false, /* isAlwaysInSlot. Only relevant for getters. */
36646 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36647 false, /* isTypedMethod. Only relevant for methods. */
36648 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36649};
36650
36651MOZ_CAN_RUN_SCRIPT static bool
36652overload10(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36653{
36654 BindingCallContext cx(cx_, "TestJSImplInterface.overload10");
36655 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36658( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36656 "TestJSImplInterface", "overload10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36658( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36657 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36658( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36658 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36658( cx, "TestJSImplInterface"
, "overload10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36659
36660 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36661 unsigned argcount = std::min(args.length(), 1u);
36662 switch (argcount) {
36663 case 1: {
36664 if (args[0].isObject()) {
36665 do {
36666 JS::Rooted<JSObject*> arg0(cx);
36667#ifdef __clang__1
36668#pragma clang diagnostic push
36669#pragma clang diagnostic ignored "-Wunreachable-code"
36670#pragma clang diagnostic ignored "-Wunreachable-code-return"
36671#endif // __clang__
36672 if ((true) && !CallerSubsumes(args[0])) {
36673 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 1");
36674 return false;
36675 }
36676#ifdef __clang__1
36677#pragma clang diagnostic pop
36678#endif // __clang__
36679 arg0 = &args[0].toObject();
36680 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36681 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36682 if (objIsXray) {
36683 unwrappedObj.emplace(cx, obj);
36684 }
36685 if (objIsXray) {
36686 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36687 // we know Xrays have no dynamic unwrap behavior.
36688 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36689 if (!unwrappedObj.ref()) {
36690 return false;
36691 }
36692 }
36693 FastErrorResult rv;
36694 // NOTE: This assert does NOT call the function.
36695 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload10(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36696 MOZ_KnownLive(self)(self)->Overload10(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36697 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"
)), 0))
) {
36698 return false;
36699 }
36700 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36700); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36700; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36701 args.rval().setUndefined();
36702 return true;
36703 } while (false);
36704 }
36705 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36706 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36707 if (objIsXray) {
36708 unwrappedObj.emplace(cx, obj);
36709 }
36710 Nullable<int32_t> arg0;
36711 if (args[0].isNullOrUndefined()) {
36712 arg0.SetNull();
36713 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36714 return false;
36715 }
36716 if (objIsXray) {
36717 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36718 // we know Xrays have no dynamic unwrap behavior.
36719 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36720 if (!unwrappedObj.ref()) {
36721 return false;
36722 }
36723 }
36724 FastErrorResult rv;
36725 // NOTE: This assert does NOT call the function.
36726 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36727 MOZ_KnownLive(self)(self)->Overload10(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36728 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload10"
)), 0))
) {
36729 return false;
36730 }
36731 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36731); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36731; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36732 args.rval().setUndefined();
36733 return true;
36734 break;
36735 }
36736 default: {
36737 // Using nsPrintfCString here would require including that
36738 // header. Let's not worry about it.
36739 nsAutoCString argCountStr;
36740 argCountStr.AppendPrintf("%u", args.length());
36741 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36742 }
36743 }
36744 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36744); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36744; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36745 return false;
36746}
36747
36748static const JSJitInfo overload10_methodinfo = {
36749 { (JSJitGetterOp)overload10 },
36750 { prototypes::id::TestJSImplInterface },
36751 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36752 JSJitInfo::Method,
36753 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36754 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36755 false, /* isInfallible. False in setters. */
36756 false, /* isMovable. Not relevant for setters. */
36757 false, /* isEliminatable. Not relevant for setters. */
36758 false, /* isAlwaysInSlot. Only relevant for getters. */
36759 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36760 false, /* isTypedMethod. Only relevant for methods. */
36761 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36762};
36763
36764MOZ_CAN_RUN_SCRIPT static bool
36765overload11(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36766{
36767 BindingCallContext cx(cx_, "TestJSImplInterface.overload11");
36768 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36771( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36769 "TestJSImplInterface", "overload11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36771( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36770 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36771( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36771 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36771( cx, "TestJSImplInterface"
, "overload11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36772
36773 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36774 unsigned argcount = std::min(args.length(), 1u);
36775 switch (argcount) {
36776 case 1: {
36777 if (args[0].isNumber()) {
36778 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36779 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36780 if (objIsXray) {
36781 unwrappedObj.emplace(cx, obj);
36782 }
36783 int32_t arg0;
36784 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36785 return false;
36786 }
36787 if (objIsXray) {
36788 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36789 // we know Xrays have no dynamic unwrap behavior.
36790 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36791 if (!unwrappedObj.ref()) {
36792 return false;
36793 }
36794 }
36795 FastErrorResult rv;
36796 // NOTE: This assert does NOT call the function.
36797 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload11(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36798 MOZ_KnownLive(self)(self)->Overload11(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36799 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"
)), 0))
) {
36800 return false;
36801 }
36802 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36802); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36802; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36803 args.rval().setUndefined();
36804 return true;
36805 }
36806 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36807 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36808 if (objIsXray) {
36809 unwrappedObj.emplace(cx, obj);
36810 }
36811 binding_detail::FakeString<char16_t> arg0;
36812 if (!ConvertJSValueToString(cx, args[0], eNull, eNull, arg0)) {
36813 return false;
36814 }
36815 if (objIsXray) {
36816 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36817 // we know Xrays have no dynamic unwrap behavior.
36818 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36819 if (!unwrappedObj.ref()) {
36820 return false;
36821 }
36822 }
36823 FastErrorResult rv;
36824 // NOTE: This assert does NOT call the function.
36825 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload11(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36826 MOZ_KnownLive(self)(self)->Overload11(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36827 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload11"
)), 0))
) {
36828 return false;
36829 }
36830 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36830); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36830; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36831 args.rval().setUndefined();
36832 return true;
36833 break;
36834 }
36835 default: {
36836 // Using nsPrintfCString here would require including that
36837 // header. Let's not worry about it.
36838 nsAutoCString argCountStr;
36839 argCountStr.AppendPrintf("%u", args.length());
36840 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36841 }
36842 }
36843 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36843); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36843; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36844 return false;
36845}
36846
36847static const JSJitInfo overload11_methodinfo = {
36848 { (JSJitGetterOp)overload11 },
36849 { prototypes::id::TestJSImplInterface },
36850 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36851 JSJitInfo::Method,
36852 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36853 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36854 false, /* isInfallible. False in setters. */
36855 false, /* isMovable. Not relevant for setters. */
36856 false, /* isEliminatable. Not relevant for setters. */
36857 false, /* isAlwaysInSlot. Only relevant for getters. */
36858 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36859 false, /* isTypedMethod. Only relevant for methods. */
36860 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36861};
36862
36863MOZ_CAN_RUN_SCRIPT static bool
36864overload12(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36865{
36866 BindingCallContext cx(cx_, "TestJSImplInterface.overload12");
36867 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject36870( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36868 "TestJSImplInterface", "overload12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject36870( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36869 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject36870( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
36870 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject36870( cx, "TestJSImplInterface"
, "overload12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
36871
36872 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
36873 unsigned argcount = std::min(args.length(), 1u);
36874 switch (argcount) {
36875 case 1: {
36876 if (args[0].isNullOrUndefined()) {
36877 Nullable<bool> arg0;
36878 if (args[0].isNullOrUndefined()) {
36879 arg0.SetNull();
36880 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36881 return false;
36882 }
36883 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36884 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36885 if (objIsXray) {
36886 unwrappedObj.emplace(cx, obj);
36887 }
36888 if (objIsXray) {
36889 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36890 // we know Xrays have no dynamic unwrap behavior.
36891 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36892 if (!unwrappedObj.ref()) {
36893 return false;
36894 }
36895 }
36896 FastErrorResult rv;
36897 // NOTE: This assert does NOT call the function.
36898 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36899 MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36900 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
36901 return false;
36902 }
36903 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36903); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36903; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36904 args.rval().setUndefined();
36905 return true;
36906 }
36907 if (args[0].isBoolean()) {
36908 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36909 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36910 if (objIsXray) {
36911 unwrappedObj.emplace(cx, obj);
36912 }
36913 Nullable<bool> arg0;
36914 if (args[0].isNullOrUndefined()) {
36915 arg0.SetNull();
36916 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
36917 return false;
36918 }
36919 if (objIsXray) {
36920 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36921 // we know Xrays have no dynamic unwrap behavior.
36922 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36923 if (!unwrappedObj.ref()) {
36924 return false;
36925 }
36926 }
36927 FastErrorResult rv;
36928 // NOTE: This assert does NOT call the function.
36929 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36930 MOZ_KnownLive(self)(self)->Overload12(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36931 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
36932 return false;
36933 }
36934 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36934); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36934; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36935 args.rval().setUndefined();
36936 return true;
36937 }
36938 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
36939 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
36940 if (objIsXray) {
36941 unwrappedObj.emplace(cx, obj);
36942 }
36943 int32_t arg0;
36944 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
36945 return false;
36946 }
36947 if (objIsXray) {
36948 // Since our object is an Xray, we can just CheckedUnwrapStatic:
36949 // we know Xrays have no dynamic unwrap behavior.
36950 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
36951 if (!unwrappedObj.ref()) {
36952 return false;
36953 }
36954 }
36955 FastErrorResult rv;
36956 // NOTE: This assert does NOT call the function.
36957 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload12(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
36958 MOZ_KnownLive(self)(self)->Overload12(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
36959 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload12"
)), 0))
) {
36960 return false;
36961 }
36962 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 36962); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 36962; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
36963 args.rval().setUndefined();
36964 return true;
36965 break;
36966 }
36967 default: {
36968 // Using nsPrintfCString here would require including that
36969 // header. Let's not worry about it.
36970 nsAutoCString argCountStr;
36971 argCountStr.AppendPrintf("%u", args.length());
36972 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
36973 }
36974 }
36975 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 36975); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 36975; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
36976 return false;
36977}
36978
36979static const JSJitInfo overload12_methodinfo = {
36980 { (JSJitGetterOp)overload12 },
36981 { prototypes::id::TestJSImplInterface },
36982 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
36983 JSJitInfo::Method,
36984 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
36985 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
36986 false, /* isInfallible. False in setters. */
36987 false, /* isMovable. Not relevant for setters. */
36988 false, /* isEliminatable. Not relevant for setters. */
36989 false, /* isAlwaysInSlot. Only relevant for getters. */
36990 false, /* isLazilyCachedInSlot. Only relevant for getters. */
36991 false, /* isTypedMethod. Only relevant for methods. */
36992 0 /* Reserved slot index, if we're stored in a slot, else 0. */
36993};
36994
36995MOZ_CAN_RUN_SCRIPT static bool
36996overload13(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
36997{
36998 BindingCallContext cx(cx_, "TestJSImplInterface.overload13");
36999 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37002( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37000 "TestJSImplInterface", "overload13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37002( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37001 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37002( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37002 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37002( cx, "TestJSImplInterface"
, "overload13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37003
37004 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37005 unsigned argcount = std::min(args.length(), 1u);
37006 switch (argcount) {
37007 case 1: {
37008 if (args[0].isBoolean()) {
37009 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37010 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37011 if (objIsXray) {
37012 unwrappedObj.emplace(cx, obj);
37013 }
37014 bool arg0;
37015 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37016 return false;
37017 }
37018 if (objIsXray) {
37019 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37020 // we know Xrays have no dynamic unwrap behavior.
37021 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37022 if (!unwrappedObj.ref()) {
37023 return false;
37024 }
37025 }
37026 FastErrorResult rv;
37027 // NOTE: This assert does NOT call the function.
37028 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload13(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37029 MOZ_KnownLive(self)(self)->Overload13(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37030 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"
)), 0))
) {
37031 return false;
37032 }
37033 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37033); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37033; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37034 args.rval().setUndefined();
37035 return true;
37036 }
37037 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37038 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37039 if (objIsXray) {
37040 unwrappedObj.emplace(cx, obj);
37041 }
37042 Nullable<int32_t> arg0;
37043 if (args[0].isNullOrUndefined()) {
37044 arg0.SetNull();
37045 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.SetValue())) {
37046 return false;
37047 }
37048 if (objIsXray) {
37049 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37050 // we know Xrays have no dynamic unwrap behavior.
37051 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37052 if (!unwrappedObj.ref()) {
37053 return false;
37054 }
37055 }
37056 FastErrorResult rv;
37057 // NOTE: This assert does NOT call the function.
37058 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37059 MOZ_KnownLive(self)(self)->Overload13(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37060 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload13"
)), 0))
) {
37061 return false;
37062 }
37063 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37063); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37063; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37064 args.rval().setUndefined();
37065 return true;
37066 break;
37067 }
37068 default: {
37069 // Using nsPrintfCString here would require including that
37070 // header. Let's not worry about it.
37071 nsAutoCString argCountStr;
37072 argCountStr.AppendPrintf("%u", args.length());
37073 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37074 }
37075 }
37076 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37076); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37076; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37077 return false;
37078}
37079
37080static const JSJitInfo overload13_methodinfo = {
37081 { (JSJitGetterOp)overload13 },
37082 { prototypes::id::TestJSImplInterface },
37083 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37084 JSJitInfo::Method,
37085 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37086 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37087 false, /* isInfallible. False in setters. */
37088 false, /* isMovable. Not relevant for setters. */
37089 false, /* isEliminatable. Not relevant for setters. */
37090 false, /* isAlwaysInSlot. Only relevant for getters. */
37091 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37092 false, /* isTypedMethod. Only relevant for methods. */
37093 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37094};
37095
37096MOZ_CAN_RUN_SCRIPT static bool
37097overload14(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37098{
37099 BindingCallContext cx(cx_, "TestJSImplInterface.overload14");
37100 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37103( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37101 "TestJSImplInterface", "overload14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37103( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37102 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37103( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37103 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37103( cx, "TestJSImplInterface"
, "overload14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37104
37105 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37106 unsigned argcount = std::min(args.length(), 1u);
37107 switch (argcount) {
37108 case 0: {
37109 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37110 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37111 if (objIsXray) {
37112 unwrappedObj.emplace(cx, obj);
37113 }
37114 Optional<int32_t> arg0;
37115 if (args.hasDefined(0)) {
37116 arg0.Construct();
37117 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
37118 return false;
37119 }
37120 }
37121 if (objIsXray) {
37122 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37123 // we know Xrays have no dynamic unwrap behavior.
37124 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37125 if (!unwrappedObj.ref()) {
37126 return false;
37127 }
37128 }
37129 FastErrorResult rv;
37130 // NOTE: This assert does NOT call the function.
37131 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37132 MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37133 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37134 return false;
37135 }
37136 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37136); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37136; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37137 args.rval().setUndefined();
37138 return true;
37139 break;
37140 }
37141 case 1: {
37142 if (args[0].isObject()) {
37143 do {
37144 NonNull<mozilla::dom::TestInterface> arg0;
37145 {
37146 // Our JSContext should be in the right global to do unwrapping in.
37147 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0, cx);
37148 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37149 break;
37150 }
37151 }
37152 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37153 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37154 if (objIsXray) {
37155 unwrappedObj.emplace(cx, obj);
37156 }
37157 if (objIsXray) {
37158 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37159 // we know Xrays have no dynamic unwrap behavior.
37160 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37161 if (!unwrappedObj.ref()) {
37162 return false;
37163 }
37164 }
37165 FastErrorResult rv;
37166 // NOTE: This assert does NOT call the function.
37167 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload14(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37168 MOZ_KnownLive(self)(self)->Overload14(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37169 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37170 return false;
37171 }
37172 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37172); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37172; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37173 args.rval().setUndefined();
37174 return true;
37175 } while (false);
37176 }
37177 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37178 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37179 if (objIsXray) {
37180 unwrappedObj.emplace(cx, obj);
37181 }
37182 Optional<int32_t> arg0;
37183 if (args.hasDefined(0)) {
37184 arg0.Construct();
37185 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
37186 return false;
37187 }
37188 }
37189 if (objIsXray) {
37190 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37191 // we know Xrays have no dynamic unwrap behavior.
37192 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37193 if (!unwrappedObj.ref()) {
37194 return false;
37195 }
37196 }
37197 FastErrorResult rv;
37198 // NOTE: This assert does NOT call the function.
37199 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37200 MOZ_KnownLive(self)(self)->Overload14(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37201 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload14"
)), 0))
) {
37202 return false;
37203 }
37204 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37204); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37204; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37205 args.rval().setUndefined();
37206 return true;
37207 break;
37208 }
37209 default: {
37210 // Using nsPrintfCString here would require including that
37211 // header. Let's not worry about it.
37212 nsAutoCString argCountStr;
37213 argCountStr.AppendPrintf("%u", args.length());
37214 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37215 }
37216 }
37217 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37217); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37217; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37218 return false;
37219}
37220
37221static const JSJitInfo overload14_methodinfo = {
37222 { (JSJitGetterOp)overload14 },
37223 { prototypes::id::TestJSImplInterface },
37224 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37225 JSJitInfo::Method,
37226 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37227 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37228 false, /* isInfallible. False in setters. */
37229 false, /* isMovable. Not relevant for setters. */
37230 false, /* isEliminatable. Not relevant for setters. */
37231 false, /* isAlwaysInSlot. Only relevant for getters. */
37232 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37233 false, /* isTypedMethod. Only relevant for methods. */
37234 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37235};
37236
37237MOZ_CAN_RUN_SCRIPT static bool
37238overload15(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37239{
37240 BindingCallContext cx(cx_, "TestJSImplInterface.overload15");
37241 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37244( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37242 "TestJSImplInterface", "overload15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37244( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37243 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37244( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37244 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37244( cx, "TestJSImplInterface"
, "overload15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37245
37246 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37247 unsigned argcount = std::min(args.length(), 1u);
37248 switch (argcount) {
37249 case 0: {
37250 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37251 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37252 if (objIsXray) {
37253 unwrappedObj.emplace(cx, obj);
37254 }
37255 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37256 if (args.hasDefined(0)) {
37257 arg0.Construct();
37258 if (args[0].isObject()) {
37259 {
37260 // Our JSContext should be in the right global to do unwrapping in.
37261 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37262 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37263 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37264 return false;
37265 }
37266 }
37267 } else {
37268 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37269 return false;
37270 }
37271 }
37272 if (objIsXray) {
37273 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37274 // we know Xrays have no dynamic unwrap behavior.
37275 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37276 if (!unwrappedObj.ref()) {
37277 return false;
37278 }
37279 }
37280 FastErrorResult rv;
37281 // NOTE: This assert does NOT call the function.
37282 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37283 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37284 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37285 return false;
37286 }
37287 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37287); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37287; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37288 args.rval().setUndefined();
37289 return true;
37290 break;
37291 }
37292 case 1: {
37293 if (args[0].isUndefined()) {
37294 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37295 if (args.hasDefined(0)) {
37296 arg0.Construct();
37297 if (args[0].isObject()) {
37298 {
37299 // Our JSContext should be in the right global to do unwrapping in.
37300 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37301 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37302 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37303 return false;
37304 }
37305 }
37306 } else {
37307 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37308 return false;
37309 }
37310 }
37311 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37312 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37313 if (objIsXray) {
37314 unwrappedObj.emplace(cx, obj);
37315 }
37316 if (objIsXray) {
37317 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37318 // we know Xrays have no dynamic unwrap behavior.
37319 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37320 if (!unwrappedObj.ref()) {
37321 return false;
37322 }
37323 }
37324 FastErrorResult rv;
37325 // NOTE: This assert does NOT call the function.
37326 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37327 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37328 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37329 return false;
37330 }
37331 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37331); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37331; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37332 args.rval().setUndefined();
37333 return true;
37334 }
37335 if (args[0].isObject()) {
37336 do {
37337 Optional<NonNull<mozilla::dom::TestInterface>> arg0;
37338 if (args.hasDefined(0)) {
37339 arg0.Construct();
37340 {
37341 // Our JSContext should be in the right global to do unwrapping in.
37342 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37343 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37344 break;
37345 }
37346 }
37347 }
37348 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37349 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37350 if (objIsXray) {
37351 unwrappedObj.emplace(cx, obj);
37352 }
37353 if (objIsXray) {
37354 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37355 // we know Xrays have no dynamic unwrap behavior.
37356 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37357 if (!unwrappedObj.ref()) {
37358 return false;
37359 }
37360 }
37361 FastErrorResult rv;
37362 // NOTE: This assert does NOT call the function.
37363 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37364 MOZ_KnownLive(self)(self)->Overload15(MOZ_KnownLive(NonNullHelper(Constify(arg0)))(NonNullHelper(Constify(arg0))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37365 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37366 return false;
37367 }
37368 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37368); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37368; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37369 args.rval().setUndefined();
37370 return true;
37371 } while (false);
37372 }
37373 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37374 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37375 if (objIsXray) {
37376 unwrappedObj.emplace(cx, obj);
37377 }
37378 int32_t arg0;
37379 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37380 return false;
37381 }
37382 if (objIsXray) {
37383 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37384 // we know Xrays have no dynamic unwrap behavior.
37385 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37386 if (!unwrappedObj.ref()) {
37387 return false;
37388 }
37389 }
37390 FastErrorResult rv;
37391 // NOTE: This assert does NOT call the function.
37392 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload15(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37393 MOZ_KnownLive(self)(self)->Overload15(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37394 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload15"
)), 0))
) {
37395 return false;
37396 }
37397 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37397; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37398 args.rval().setUndefined();
37399 return true;
37400 break;
37401 }
37402 default: {
37403 // Using nsPrintfCString here would require including that
37404 // header. Let's not worry about it.
37405 nsAutoCString argCountStr;
37406 argCountStr.AppendPrintf("%u", args.length());
37407 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37408 }
37409 }
37410 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37410); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37410; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37411 return false;
37412}
37413
37414static const JSJitInfo overload15_methodinfo = {
37415 { (JSJitGetterOp)overload15 },
37416 { prototypes::id::TestJSImplInterface },
37417 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37418 JSJitInfo::Method,
37419 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37420 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37421 false, /* isInfallible. False in setters. */
37422 false, /* isMovable. Not relevant for setters. */
37423 false, /* isEliminatable. Not relevant for setters. */
37424 false, /* isAlwaysInSlot. Only relevant for getters. */
37425 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37426 false, /* isTypedMethod. Only relevant for methods. */
37427 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37428};
37429
37430MOZ_CAN_RUN_SCRIPT static bool
37431overload16(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37432{
37433 BindingCallContext cx(cx_, "TestJSImplInterface.overload16");
37434 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37437( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37435 "TestJSImplInterface", "overload16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37437( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37436 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37437( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37437 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37437( cx, "TestJSImplInterface"
, "overload16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37438
37439 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37440 unsigned argcount = std::min(args.length(), 1u);
37441 switch (argcount) {
37442 case 0: {
37443 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37444 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37445 if (objIsXray) {
37446 unwrappedObj.emplace(cx, obj);
37447 }
37448 Optional<mozilla::dom::TestInterface*> arg0;
37449 if (args.hasDefined(0)) {
37450 arg0.Construct();
37451 if (args[0].isObject()) {
37452 {
37453 // Our JSContext should be in the right global to do unwrapping in.
37454 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37455 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37456 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestInterface");
37457 return false;
37458 }
37459 }
37460 } else if (args[0].isNullOrUndefined()) {
37461 arg0.Value() = nullptr;
37462 } else {
37463 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
37464 return false;
37465 }
37466 }
37467 if (objIsXray) {
37468 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37469 // we know Xrays have no dynamic unwrap behavior.
37470 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37471 if (!unwrappedObj.ref()) {
37472 return false;
37473 }
37474 }
37475 FastErrorResult rv;
37476 // NOTE: This assert does NOT call the function.
37477 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37478 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37479 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37480 return false;
37481 }
37482 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37482); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37482; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37483 args.rval().setUndefined();
37484 return true;
37485 break;
37486 }
37487 case 1: {
37488 if (args[0].isNullOrUndefined()) {
37489 Optional<mozilla::dom::TestInterface*> arg0;
37490 if (args.hasDefined(0)) {
37491 arg0.Construct();
37492 arg0.Value() = nullptr;
37493 }
37494 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37495 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37496 if (objIsXray) {
37497 unwrappedObj.emplace(cx, obj);
37498 }
37499 if (objIsXray) {
37500 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37501 // we know Xrays have no dynamic unwrap behavior.
37502 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37503 if (!unwrappedObj.ref()) {
37504 return false;
37505 }
37506 }
37507 FastErrorResult rv;
37508 // NOTE: This assert does NOT call the function.
37509 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37510 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37511 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37512 return false;
37513 }
37514 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37514); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37514; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37515 args.rval().setUndefined();
37516 return true;
37517 }
37518 if (args[0].isObject()) {
37519 do {
37520 Optional<mozilla::dom::TestInterface*> arg0;
37521 if (args.hasDefined(0)) {
37522 arg0.Construct();
37523 {
37524 // Our JSContext should be in the right global to do unwrapping in.
37525 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[0], arg0.Value(), cx);
37526 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
37527 break;
37528 }
37529 }
37530 }
37531 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37532 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37533 if (objIsXray) {
37534 unwrappedObj.emplace(cx, obj);
37535 }
37536 if (objIsXray) {
37537 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37538 // we know Xrays have no dynamic unwrap behavior.
37539 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37540 if (!unwrappedObj.ref()) {
37541 return false;
37542 }
37543 }
37544 FastErrorResult rv;
37545 // NOTE: This assert does NOT call the function.
37546 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37547 MOZ_KnownLive(self)(self)->Overload16(MOZ_KnownLive(Constify(arg0))(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37548 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37549 return false;
37550 }
37551 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37551; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37552 args.rval().setUndefined();
37553 return true;
37554 } while (false);
37555 }
37556 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37557 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37558 if (objIsXray) {
37559 unwrappedObj.emplace(cx, obj);
37560 }
37561 int32_t arg0;
37562 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0)) {
37563 return false;
37564 }
37565 if (objIsXray) {
37566 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37567 // we know Xrays have no dynamic unwrap behavior.
37568 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37569 if (!unwrappedObj.ref()) {
37570 return false;
37571 }
37572 }
37573 FastErrorResult rv;
37574 // NOTE: This assert does NOT call the function.
37575 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload16(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37576 MOZ_KnownLive(self)(self)->Overload16(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37577 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload16"
)), 0))
) {
37578 return false;
37579 }
37580 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37580); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37580; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37581 args.rval().setUndefined();
37582 return true;
37583 break;
37584 }
37585 default: {
37586 // Using nsPrintfCString here would require including that
37587 // header. Let's not worry about it.
37588 nsAutoCString argCountStr;
37589 argCountStr.AppendPrintf("%u", args.length());
37590 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37591 }
37592 }
37593 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37593); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37593; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37594 return false;
37595}
37596
37597static const JSJitInfo overload16_methodinfo = {
37598 { (JSJitGetterOp)overload16 },
37599 { prototypes::id::TestJSImplInterface },
37600 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37601 JSJitInfo::Method,
37602 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37603 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37604 false, /* isInfallible. False in setters. */
37605 false, /* isMovable. Not relevant for setters. */
37606 false, /* isEliminatable. Not relevant for setters. */
37607 false, /* isAlwaysInSlot. Only relevant for getters. */
37608 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37609 false, /* isTypedMethod. Only relevant for methods. */
37610 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37611};
37612
37613MOZ_CAN_RUN_SCRIPT static bool
37614overload17(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37615{
37616 BindingCallContext cx(cx_, "TestJSImplInterface.overload17");
37617 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37620( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37618 "TestJSImplInterface", "overload17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37620( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37619 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37620( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37620 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37620( cx, "TestJSImplInterface"
, "overload17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37621
37622 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37623 unsigned argcount = std::min(args.length(), 1u);
37624 switch (argcount) {
37625 case 1: {
37626 if (args[0].isObject()) {
37627 do {
37628 binding_detail::AutoSequence<int32_t> arg0;
37629 JS::ForOfIterator iter(cx);
37630 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
37631 return false;
37632 }
37633 if (!iter.valueIsIterable()) {
37634 break;
37635 }
37636 binding_detail::AutoSequence<int32_t> &arr = arg0;
37637 JS::Rooted<JS::Value> temp(cx);
37638 while (true) {
37639 bool done;
37640 if (!iter.next(&temp, &done)) {
37641 return false;
37642 }
37643 if (done) {
37644 break;
37645 }
37646 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
37647 if (!slotPtr) {
37648 JS_ReportOutOfMemory(cx);
37649 return false;
37650 }
37651 int32_t& slot = *slotPtr;
37652 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
37653 return false;
37654 }
37655 }
37656 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37657 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37658 if (objIsXray) {
37659 unwrappedObj.emplace(cx, obj);
37660 }
37661 if (objIsXray) {
37662 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37663 // we know Xrays have no dynamic unwrap behavior.
37664 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37665 if (!unwrappedObj.ref()) {
37666 return false;
37667 }
37668 }
37669 FastErrorResult rv;
37670 // NOTE: This assert does NOT call the function.
37671 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37672 MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37673 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"
)), 0))
) {
37674 return false;
37675 }
37676 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37676); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37676; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37677 args.rval().setUndefined();
37678 return true;
37679 } while (false);
37680 do {
37681 Record<nsString, int32_t> arg0;
37682 auto& recordEntries = arg0.Entries();
37683
37684 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
37685 JS::RootedVector<jsid> ids(cx);
37686 if (!js::GetPropertyKeys(cx, recordObj,
37687 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
37688 return false;
37689 }
37690 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
37691 JS_ReportOutOfMemory(cx);
37692 return false;
37693 }
37694 JS::Rooted<JS::Value> propNameValue(cx);
37695 JS::Rooted<JS::Value> temp(cx);
37696 JS::Rooted<jsid> curId(cx);
37697 JS::Rooted<JS::Value> idVal(cx);
37698 // Use a hashset to keep track of ids seen, to avoid
37699 // introducing nasty O(N^2) behavior scanning for them all the
37700 // time. Ideally we'd use a data structure with O(1) lookup
37701 // _and_ ordering for the MozMap, but we don't have one lying
37702 // around.
37703 nsTHashtable<nsStringHashKey> idsSeen;
37704 for (size_t i = 0; i < ids.length(); ++i) {
37705 curId = ids[i];
37706
37707 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
37708 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
37709 &desc)) {
37710 return false;
37711 }
37712
37713 if (desc.isNothing() || !desc->enumerable()) {
37714 continue;
37715 }
37716
37717 idVal = js::IdToValue(curId);
37718 nsString propName;
37719 // This will just throw if idVal is a Symbol, like the spec says
37720 // to do.
37721 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
37722 return false;
37723 }
37724
37725 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
37726 return false;
37727 }
37728
37729 Record<nsString, int32_t>::EntryType* entry;
37730 if (!idsSeen.EnsureInserted(propName)) {
37731 // Find the existing entry.
37732 auto idx = recordEntries.IndexOf(propName);
37733 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 37734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 37734; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
37734 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 37734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 37734; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
37735 // Now blow it away to make it look like it was just added
37736 // to the array, because it's not obvious that it's
37737 // safe to write to its already-initialized mValue via our
37738 // normal codegen conversions. For example, the value
37739 // could be a union and this would change its type, but
37740 // codegen assumes we won't do that.
37741 entry = recordEntries.ReconstructElementAt(idx);
37742 } else {
37743 // Safe to do an infallible append here, because we did a
37744 // SetCapacity above to the right capacity.
37745 entry = recordEntries.AppendElement();
37746 }
37747 entry->mKey = propName;
37748 int32_t& slot = entry->mValue;
37749 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in argument 1", &slot)) {
37750 return false;
37751 }
37752 }
37753 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37754 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37755 if (objIsXray) {
37756 unwrappedObj.emplace(cx, obj);
37757 }
37758 if (objIsXray) {
37759 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37760 // we know Xrays have no dynamic unwrap behavior.
37761 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37762 if (!unwrappedObj.ref()) {
37763 return false;
37764 }
37765 }
37766 FastErrorResult rv;
37767 // NOTE: This assert does NOT call the function.
37768 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37769 MOZ_KnownLive(self)(self)->Overload17(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37770 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload17"
)), 0))
) {
37771 return false;
37772 }
37773 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37773); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37773; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37774 args.rval().setUndefined();
37775 return true;
37776 } while (false);
37777 }
37778 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
37779 break;
37780 }
37781 default: {
37782 // Using nsPrintfCString here would require including that
37783 // header. Let's not worry about it.
37784 nsAutoCString argCountStr;
37785 argCountStr.AppendPrintf("%u", args.length());
37786 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37787 }
37788 }
37789 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37789); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37789; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37790 return false;
37791}
37792
37793static const JSJitInfo overload17_methodinfo = {
37794 { (JSJitGetterOp)overload17 },
37795 { prototypes::id::TestJSImplInterface },
37796 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37797 JSJitInfo::Method,
37798 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37799 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37800 false, /* isInfallible. False in setters. */
37801 false, /* isMovable. Not relevant for setters. */
37802 false, /* isEliminatable. Not relevant for setters. */
37803 false, /* isAlwaysInSlot. Only relevant for getters. */
37804 false, /* isLazilyCachedInSlot. Only relevant for getters. */
37805 false, /* isTypedMethod. Only relevant for methods. */
37806 0 /* Reserved slot index, if we're stored in a slot, else 0. */
37807};
37808
37809MOZ_CAN_RUN_SCRIPT static bool
37810overload18(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
37811{
37812 BindingCallContext cx(cx_, "TestJSImplInterface.overload18");
37813 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject37816( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37814 "TestJSImplInterface", "overload18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject37816( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37815 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject37816( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
37816 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject37816( cx, "TestJSImplInterface"
, "overload18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
37817
37818 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
37819 unsigned argcount = std::min(args.length(), 1u);
37820 switch (argcount) {
37821 case 1: {
37822 if (args[0].isObject()) {
37823 do {
37824 binding_detail::AutoSequence<nsString> arg0;
37825 JS::ForOfIterator iter(cx);
37826 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
37827 return false;
37828 }
37829 if (!iter.valueIsIterable()) {
37830 break;
37831 }
37832 binding_detail::AutoSequence<nsString> &arr = arg0;
37833 JS::Rooted<JS::Value> temp(cx);
37834 while (true) {
37835 bool done;
37836 if (!iter.next(&temp, &done)) {
37837 return false;
37838 }
37839 if (done) {
37840 break;
37841 }
37842 nsString* slotPtr = arr.AppendElement(mozilla::fallible);
37843 if (!slotPtr) {
37844 JS_ReportOutOfMemory(cx);
37845 return false;
37846 }
37847 nsString& slot = *slotPtr;
37848 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
37849 return false;
37850 }
37851 }
37852 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37853 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37854 if (objIsXray) {
37855 unwrappedObj.emplace(cx, obj);
37856 }
37857 if (objIsXray) {
37858 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37859 // we know Xrays have no dynamic unwrap behavior.
37860 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37861 if (!unwrappedObj.ref()) {
37862 return false;
37863 }
37864 }
37865 FastErrorResult rv;
37866 // NOTE: This assert does NOT call the function.
37867 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37868 MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37869 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"
)), 0))
) {
37870 return false;
37871 }
37872 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37872); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37872; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37873 args.rval().setUndefined();
37874 return true;
37875 } while (false);
37876 do {
37877 Record<nsString, nsString> arg0;
37878 auto& recordEntries = arg0.Entries();
37879
37880 JS::Rooted<JSObject*> recordObj(cx, &args[0].toObject());
37881 JS::RootedVector<jsid> ids(cx);
37882 if (!js::GetPropertyKeys(cx, recordObj,
37883 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
37884 return false;
37885 }
37886 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
37887 JS_ReportOutOfMemory(cx);
37888 return false;
37889 }
37890 JS::Rooted<JS::Value> propNameValue(cx);
37891 JS::Rooted<JS::Value> temp(cx);
37892 JS::Rooted<jsid> curId(cx);
37893 JS::Rooted<JS::Value> idVal(cx);
37894 // Use a hashset to keep track of ids seen, to avoid
37895 // introducing nasty O(N^2) behavior scanning for them all the
37896 // time. Ideally we'd use a data structure with O(1) lookup
37897 // _and_ ordering for the MozMap, but we don't have one lying
37898 // around.
37899 nsTHashtable<nsStringHashKey> idsSeen;
37900 for (size_t i = 0; i < ids.length(); ++i) {
37901 curId = ids[i];
37902
37903 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
37904 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
37905 &desc)) {
37906 return false;
37907 }
37908
37909 if (desc.isNothing() || !desc->enumerable()) {
37910 continue;
37911 }
37912
37913 idVal = js::IdToValue(curId);
37914 nsString propName;
37915 // This will just throw if idVal is a Symbol, like the spec says
37916 // to do.
37917 if (!ConvertJSValueToString(cx, idVal, "key of argument 1", propName)) {
37918 return false;
37919 }
37920
37921 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
37922 return false;
37923 }
37924
37925 Record<nsString, nsString>::EntryType* entry;
37926 if (!idsSeen.EnsureInserted(propName)) {
37927 // Find the existing entry.
37928 auto idx = recordEntries.IndexOf(propName);
37929 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 37930); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 37930; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
37930 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 37930); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 37930; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
37931 // Now blow it away to make it look like it was just added
37932 // to the array, because it's not obvious that it's
37933 // safe to write to its already-initialized mValue via our
37934 // normal codegen conversions. For example, the value
37935 // could be a union and this would change its type, but
37936 // codegen assumes we won't do that.
37937 entry = recordEntries.ReconstructElementAt(idx);
37938 } else {
37939 // Safe to do an infallible append here, because we did a
37940 // SetCapacity above to the right capacity.
37941 entry = recordEntries.AppendElement();
37942 }
37943 entry->mKey = propName;
37944 nsString& slot = entry->mValue;
37945 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
37946 return false;
37947 }
37948 }
37949 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
37950 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
37951 if (objIsXray) {
37952 unwrappedObj.emplace(cx, obj);
37953 }
37954 if (objIsXray) {
37955 // Since our object is an Xray, we can just CheckedUnwrapStatic:
37956 // we know Xrays have no dynamic unwrap behavior.
37957 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
37958 if (!unwrappedObj.ref()) {
37959 return false;
37960 }
37961 }
37962 FastErrorResult rv;
37963 // NOTE: This assert does NOT call the function.
37964 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
37965 MOZ_KnownLive(self)(self)->Overload18(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
37966 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload18"
)), 0))
) {
37967 return false;
37968 }
37969 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 37969); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 37969; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
37970 args.rval().setUndefined();
37971 return true;
37972 } while (false);
37973 }
37974 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
37975 break;
37976 }
37977 default: {
37978 // Using nsPrintfCString here would require including that
37979 // header. Let's not worry about it.
37980 nsAutoCString argCountStr;
37981 argCountStr.AppendPrintf("%u", args.length());
37982 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
37983 }
37984 }
37985 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 37985); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 37985; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
37986 return false;
37987}
37988
37989static const JSJitInfo overload18_methodinfo = {
37990 { (JSJitGetterOp)overload18 },
37991 { prototypes::id::TestJSImplInterface },
37992 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
37993 JSJitInfo::Method,
37994 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
37995 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
37996 false, /* isInfallible. False in setters. */
37997 false, /* isMovable. Not relevant for setters. */
37998 false, /* isEliminatable. Not relevant for setters. */
37999 false, /* isAlwaysInSlot. Only relevant for getters. */
38000 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38001 false, /* isTypedMethod. Only relevant for methods. */
38002 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38003};
38004
38005MOZ_CAN_RUN_SCRIPT static bool
38006overload19(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38007{
38008 BindingCallContext cx(cx_, "TestJSImplInterface.overload19");
38009 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38012( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38010 "TestJSImplInterface", "overload19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38012( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38011 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38012( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38012 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38012( cx, "TestJSImplInterface"
, "overload19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38013
38014 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38015 unsigned argcount = std::min(args.length(), 1u);
38016 switch (argcount) {
38017 case 0: {
38018 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38019 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38020 if (objIsXray) {
38021 unwrappedObj.emplace(cx, obj);
38022 }
38023 RootedDictionary<binding_detail::FastDict> arg0(cx);
38024 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
38025 return false;
38026 }
38027 if (objIsXray) {
38028 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38029 // we know Xrays have no dynamic unwrap behavior.
38030 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38031 if (!unwrappedObj.ref()) {
38032 return false;
38033 }
38034 }
38035 FastErrorResult rv;
38036 // NOTE: This assert does NOT call the function.
38037 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38038 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38039 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38040 return false;
38041 }
38042 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38042); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38042; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38043 args.rval().setUndefined();
38044 return true;
38045 break;
38046 }
38047 case 1: {
38048 if (args[0].isNullOrUndefined()) {
38049 RootedDictionary<binding_detail::FastDict> arg0(cx);
38050 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38051 return false;
38052 }
38053 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38054 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38055 if (objIsXray) {
38056 unwrappedObj.emplace(cx, obj);
38057 }
38058 if (objIsXray) {
38059 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38060 // we know Xrays have no dynamic unwrap behavior.
38061 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38062 if (!unwrappedObj.ref()) {
38063 return false;
38064 }
38065 }
38066 FastErrorResult rv;
38067 // NOTE: This assert does NOT call the function.
38068 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38069 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38070 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38071 return false;
38072 }
38073 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38073); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38073; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38074 args.rval().setUndefined();
38075 return true;
38076 }
38077 if (args[0].isObject()) {
38078 do {
38079 binding_detail::AutoSequence<int32_t> arg0;
38080 JS::ForOfIterator iter(cx);
38081 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
38082 return false;
38083 }
38084 if (!iter.valueIsIterable()) {
38085 break;
38086 }
38087 binding_detail::AutoSequence<int32_t> &arr = arg0;
38088 JS::Rooted<JS::Value> temp(cx);
38089 while (true) {
38090 bool done;
38091 if (!iter.next(&temp, &done)) {
38092 return false;
38093 }
38094 if (done) {
38095 break;
38096 }
38097 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
38098 if (!slotPtr) {
38099 JS_ReportOutOfMemory(cx);
38100 return false;
38101 }
38102 int32_t& slot = *slotPtr;
38103 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
38104 return false;
38105 }
38106 }
38107 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38108 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38109 if (objIsXray) {
38110 unwrappedObj.emplace(cx, obj);
38111 }
38112 if (objIsXray) {
38113 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38114 // we know Xrays have no dynamic unwrap behavior.
38115 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38116 if (!unwrappedObj.ref()) {
38117 return false;
38118 }
38119 }
38120 FastErrorResult rv;
38121 // NOTE: This assert does NOT call the function.
38122 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38123 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38124 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38125 return false;
38126 }
38127 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38127); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38127; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38128 args.rval().setUndefined();
38129 return true;
38130 } while (false);
38131 do {
38132 RootedDictionary<binding_detail::FastDict> arg0(cx);
38133 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38134 return false;
38135 }
38136 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38137 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38138 if (objIsXray) {
38139 unwrappedObj.emplace(cx, obj);
38140 }
38141 if (objIsXray) {
38142 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38143 // we know Xrays have no dynamic unwrap behavior.
38144 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38145 if (!unwrappedObj.ref()) {
38146 return false;
38147 }
38148 }
38149 FastErrorResult rv;
38150 // NOTE: This assert does NOT call the function.
38151 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38152 MOZ_KnownLive(self)(self)->Overload19(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38153 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload19"
)), 0))
) {
38154 return false;
38155 }
38156 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38156; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38157 args.rval().setUndefined();
38158 return true;
38159 } while (false);
38160 }
38161 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
38162 break;
38163 }
38164 default: {
38165 // Using nsPrintfCString here would require including that
38166 // header. Let's not worry about it.
38167 nsAutoCString argCountStr;
38168 argCountStr.AppendPrintf("%u", args.length());
38169 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
38170 }
38171 }
38172 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 38172); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 38172; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
38173 return false;
38174}
38175
38176static const JSJitInfo overload19_methodinfo = {
38177 { (JSJitGetterOp)overload19 },
38178 { prototypes::id::TestJSImplInterface },
38179 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38180 JSJitInfo::Method,
38181 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38182 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38183 false, /* isInfallible. False in setters. */
38184 false, /* isMovable. Not relevant for setters. */
38185 false, /* isEliminatable. Not relevant for setters. */
38186 false, /* isAlwaysInSlot. Only relevant for getters. */
38187 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38188 false, /* isTypedMethod. Only relevant for methods. */
38189 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38190};
38191
38192MOZ_CAN_RUN_SCRIPT static bool
38193overload20(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38194{
38195 BindingCallContext cx(cx_, "TestJSImplInterface.overload20");
38196 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38199( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38197 "TestJSImplInterface", "overload20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38199( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38198 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38199( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38199 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38199( cx, "TestJSImplInterface"
, "overload20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38200
38201 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38202 unsigned argcount = std::min(args.length(), 1u);
38203 switch (argcount) {
38204 case 0: {
38205 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38206 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38207 if (objIsXray) {
38208 unwrappedObj.emplace(cx, obj);
38209 }
38210 RootedDictionary<binding_detail::FastDict> arg0(cx);
38211 if (!arg0.Init(cx, (args.hasDefined(0)) ? args[0] : JS::NullHandleValue, "Argument 1", true)) {
38212 return false;
38213 }
38214 if (objIsXray) {
38215 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38216 // we know Xrays have no dynamic unwrap behavior.
38217 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38218 if (!unwrappedObj.ref()) {
38219 return false;
38220 }
38221 }
38222 FastErrorResult rv;
38223 // NOTE: This assert does NOT call the function.
38224 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38225 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38226 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38227 return false;
38228 }
38229 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38229); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38229; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38230 args.rval().setUndefined();
38231 return true;
38232 break;
38233 }
38234 case 1: {
38235 if (args[0].isNullOrUndefined()) {
38236 RootedDictionary<binding_detail::FastDict> arg0(cx);
38237 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38238 return false;
38239 }
38240 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38241 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38242 if (objIsXray) {
38243 unwrappedObj.emplace(cx, obj);
38244 }
38245 if (objIsXray) {
38246 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38247 // we know Xrays have no dynamic unwrap behavior.
38248 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38249 if (!unwrappedObj.ref()) {
38250 return false;
38251 }
38252 }
38253 FastErrorResult rv;
38254 // NOTE: This assert does NOT call the function.
38255 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38256 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38257 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38258 return false;
38259 }
38260 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38260); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38260; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38261 args.rval().setUndefined();
38262 return true;
38263 }
38264 if (args[0].isObject()) {
38265 do {
38266 binding_detail::AutoSequence<int32_t> arg0;
38267 JS::ForOfIterator iter(cx);
38268 if (!iter.init(args[0], JS::ForOfIterator::AllowNonIterable)) {
38269 return false;
38270 }
38271 if (!iter.valueIsIterable()) {
38272 break;
38273 }
38274 binding_detail::AutoSequence<int32_t> &arr = arg0;
38275 JS::Rooted<JS::Value> temp(cx);
38276 while (true) {
38277 bool done;
38278 if (!iter.next(&temp, &done)) {
38279 return false;
38280 }
38281 if (done) {
38282 break;
38283 }
38284 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
38285 if (!slotPtr) {
38286 JS_ReportOutOfMemory(cx);
38287 return false;
38288 }
38289 int32_t& slot = *slotPtr;
38290 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of argument 1", &slot)) {
38291 return false;
38292 }
38293 }
38294 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38295 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38296 if (objIsXray) {
38297 unwrappedObj.emplace(cx, obj);
38298 }
38299 if (objIsXray) {
38300 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38301 // we know Xrays have no dynamic unwrap behavior.
38302 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38303 if (!unwrappedObj.ref()) {
38304 return false;
38305 }
38306 }
38307 FastErrorResult rv;
38308 // NOTE: This assert does NOT call the function.
38309 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38310 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38311 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38312 return false;
38313 }
38314 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38314); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38314; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38315 args.rval().setUndefined();
38316 return true;
38317 } while (false);
38318 do {
38319 RootedDictionary<binding_detail::FastDict> arg0(cx);
38320 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
38321 return false;
38322 }
38323 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38324 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38325 if (objIsXray) {
38326 unwrappedObj.emplace(cx, obj);
38327 }
38328 if (objIsXray) {
38329 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38330 // we know Xrays have no dynamic unwrap behavior.
38331 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38332 if (!unwrappedObj.ref()) {
38333 return false;
38334 }
38335 }
38336 FastErrorResult rv;
38337 // NOTE: This assert does NOT call the function.
38338 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38339 MOZ_KnownLive(self)(self)->Overload20(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38340 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.overload20"
)), 0))
) {
38341 return false;
38342 }
38343 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38343); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38343; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38344 args.rval().setUndefined();
38345 return true;
38346 } while (false);
38347 }
38348 return cx.ThrowErrorMessage<MSG_OVERLOAD_RESOLUTION_FAILED>("1", "1");
38349 break;
38350 }
38351 default: {
38352 // Using nsPrintfCString here would require including that
38353 // header. Let's not worry about it.
38354 nsAutoCString argCountStr;
38355 argCountStr.AppendPrintf("%u", args.length());
38356 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
38357 }
38358 }
38359 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 38359); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 38359; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
38360 return false;
38361}
38362
38363static const JSJitInfo overload20_methodinfo = {
38364 { (JSJitGetterOp)overload20 },
38365 { prototypes::id::TestJSImplInterface },
38366 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38367 JSJitInfo::Method,
38368 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38369 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38370 false, /* isInfallible. False in setters. */
38371 false, /* isMovable. Not relevant for setters. */
38372 false, /* isEliminatable. Not relevant for setters. */
38373 false, /* isAlwaysInSlot. Only relevant for getters. */
38374 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38375 false, /* isTypedMethod. Only relevant for methods. */
38376 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38377};
38378
38379MOZ_CAN_RUN_SCRIPT static bool
38380passVariadicThirdArg(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38381{
38382 BindingCallContext cx(cx_, "TestJSImplInterface.passVariadicThirdArg");
38383 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38386( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38384 "TestJSImplInterface", "passVariadicThirdArg", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38386( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38385 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38386( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38386 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38386( cx, "TestJSImplInterface"
, "passVariadicThirdArg", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38387
38388 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38389 if (!args.requireAtLeast(cx, "TestJSImplInterface.passVariadicThirdArg", 2)) {
38390 return false;
38391 }
38392 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38393 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38394 if (objIsXray) {
38395 unwrappedObj.emplace(cx, obj);
38396 }
38397 binding_detail::FakeString<char16_t> arg0;
38398 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
38399 return false;
38400 }
38401 int32_t arg1;
38402 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
38403 return false;
38404 }
38405 AutoSequence<OwningNonNull<mozilla::dom::TestJSImplInterface>> arg2;
38406 if (args.length() > 2) {
38407 if (!arg2.SetCapacity(args.length() - 2, mozilla::fallible)) {
38408 JS_ReportOutOfMemory(cx);
38409 return false;
38410 }
38411 for (uint32_t variadicArg = 2; variadicArg < args.length(); ++variadicArg) {
38412 // OK to do infallible append here, since we ensured capacity already.
38413 OwningNonNull<mozilla::dom::TestJSImplInterface>& slot = *arg2.AppendElement();
38414 if (args[variadicArg].isObject()) {
38415 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
38416 {
38417 // Our JSContext should be in the right global to do unwrapping in.
38418 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(args[variadicArg], slot, cx);
38419 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
38420 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 3", "TestJSImplInterface");
38421 return false;
38422 }
38423 }
38424 } else {
38425 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 3");
38426 return false;
38427 }
38428 }
38429 }
38430 if (objIsXray) {
38431 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38432 // we know Xrays have no dynamic unwrap behavior.
38433 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38434 if (!unwrappedObj.ref()) {
38435 return false;
38436 }
38437 }
38438 FastErrorResult rv;
38439 // NOTE: This assert does NOT call the function.
38440 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassVariadicThirdArg(NonNullHelper(Constify(arg0)), arg1, MOZ_KnownLive(NonNullHelper(Constify(arg2)))(NonNullHelper(Constify(arg2))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38441 MOZ_KnownLive(self)(self)->PassVariadicThirdArg(NonNullHelper(Constify(arg0)), arg1, MOZ_KnownLive(NonNullHelper(Constify(arg2)))(NonNullHelper(Constify(arg2))), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38442 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passVariadicThirdArg"
)), 0))
) {
38443 return false;
38444 }
38445 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38445); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38445; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38446 args.rval().setUndefined();
38447 return true;
38448}
38449
38450static const JSJitInfo passVariadicThirdArg_methodinfo = {
38451 { (JSJitGetterOp)passVariadicThirdArg },
38452 { prototypes::id::TestJSImplInterface },
38453 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38454 JSJitInfo::Method,
38455 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38456 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38457 false, /* isInfallible. False in setters. */
38458 false, /* isMovable. Not relevant for setters. */
38459 false, /* isEliminatable. Not relevant for setters. */
38460 false, /* isAlwaysInSlot. Only relevant for getters. */
38461 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38462 false, /* isTypedMethod. Only relevant for methods. */
38463 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38464};
38465
38466MOZ_CAN_RUN_SCRIPT static bool
38467get_prefable1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38468{
38469 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38472( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38470 "TestJSImplInterface", "prefable1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38472( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38471 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38472( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38472 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38472( cx, "TestJSImplInterface"
, "prefable1", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38473
38474 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38475 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38476 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38477 if (objIsXray) {
38478 unwrappedObj.emplace(cx, obj);
38479 }
38480 if (objIsXray) {
38481 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38482 // we know Xrays have no dynamic unwrap behavior.
38483 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38484 if (!unwrappedObj.ref()) {
38485 return false;
38486 }
38487 }
38488 FastErrorResult rv;
38489 bool result(MOZ_KnownLive(self)(self)->GetPrefable1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38490 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable1 getter"
)), 0))
) {
38491 return false;
38492 }
38493 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38493; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38494 args.rval().setBoolean(result);
38495 return true;
38496}
38497
38498static const JSJitInfo prefable1_getterinfo = {
38499 { get_prefable1 },
38500 { prototypes::id::TestJSImplInterface },
38501 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38502 JSJitInfo::Getter,
38503 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38504 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38505 false, /* isInfallible. False in setters. */
38506 false, /* isMovable. Not relevant for setters. */
38507 false, /* isEliminatable. Not relevant for setters. */
38508 false, /* isAlwaysInSlot. Only relevant for getters. */
38509 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38510 false, /* isTypedMethod. Only relevant for methods. */
38511 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38512};
38513
38514MOZ_CAN_RUN_SCRIPT static bool
38515get_prefable2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38516{
38517 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38520( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38518 "TestJSImplInterface", "prefable2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38520( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38519 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38520( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38520 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38520( cx, "TestJSImplInterface"
, "prefable2", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38521
38522 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38523 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38524 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38525 if (objIsXray) {
38526 unwrappedObj.emplace(cx, obj);
38527 }
38528 if (objIsXray) {
38529 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38530 // we know Xrays have no dynamic unwrap behavior.
38531 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38532 if (!unwrappedObj.ref()) {
38533 return false;
38534 }
38535 }
38536 FastErrorResult rv;
38537 bool result(MOZ_KnownLive(self)(self)->GetPrefable2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38538 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable2 getter"
)), 0))
) {
38539 return false;
38540 }
38541 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38541); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38541; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38542 args.rval().setBoolean(result);
38543 return true;
38544}
38545
38546static const JSJitInfo prefable2_getterinfo = {
38547 { get_prefable2 },
38548 { prototypes::id::TestJSImplInterface },
38549 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38550 JSJitInfo::Getter,
38551 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38552 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38553 false, /* isInfallible. False in setters. */
38554 false, /* isMovable. Not relevant for setters. */
38555 false, /* isEliminatable. Not relevant for setters. */
38556 false, /* isAlwaysInSlot. Only relevant for getters. */
38557 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38558 false, /* isTypedMethod. Only relevant for methods. */
38559 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38560};
38561
38562MOZ_CAN_RUN_SCRIPT static bool
38563get_prefable3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38564{
38565 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38568( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38566 "TestJSImplInterface", "prefable3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38568( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38567 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38568( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38568 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38568( cx, "TestJSImplInterface"
, "prefable3", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38569
38570 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38571 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38572 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38573 if (objIsXray) {
38574 unwrappedObj.emplace(cx, obj);
38575 }
38576 if (objIsXray) {
38577 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38578 // we know Xrays have no dynamic unwrap behavior.
38579 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38580 if (!unwrappedObj.ref()) {
38581 return false;
38582 }
38583 }
38584 FastErrorResult rv;
38585 bool result(MOZ_KnownLive(self)(self)->GetPrefable3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38586 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable3 getter"
)), 0))
) {
38587 return false;
38588 }
38589 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38589); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38589; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38590 args.rval().setBoolean(result);
38591 return true;
38592}
38593
38594static const JSJitInfo prefable3_getterinfo = {
38595 { get_prefable3 },
38596 { prototypes::id::TestJSImplInterface },
38597 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38598 JSJitInfo::Getter,
38599 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38600 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38601 false, /* isInfallible. False in setters. */
38602 false, /* isMovable. Not relevant for setters. */
38603 false, /* isEliminatable. Not relevant for setters. */
38604 false, /* isAlwaysInSlot. Only relevant for getters. */
38605 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38606 false, /* isTypedMethod. Only relevant for methods. */
38607 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38608};
38609
38610MOZ_CAN_RUN_SCRIPT static bool
38611get_prefable4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38612{
38613 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38616( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38614 "TestJSImplInterface", "prefable4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38616( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38615 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38616( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38616 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38616( cx, "TestJSImplInterface"
, "prefable4", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38617
38618 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38619 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38620 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38621 if (objIsXray) {
38622 unwrappedObj.emplace(cx, obj);
38623 }
38624 if (objIsXray) {
38625 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38626 // we know Xrays have no dynamic unwrap behavior.
38627 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38628 if (!unwrappedObj.ref()) {
38629 return false;
38630 }
38631 }
38632 FastErrorResult rv;
38633 bool result(MOZ_KnownLive(self)(self)->GetPrefable4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38634 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable4 getter"
)), 0))
) {
38635 return false;
38636 }
38637 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38637); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38637; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38638 args.rval().setBoolean(result);
38639 return true;
38640}
38641
38642static const JSJitInfo prefable4_getterinfo = {
38643 { get_prefable4 },
38644 { prototypes::id::TestJSImplInterface },
38645 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38646 JSJitInfo::Getter,
38647 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38648 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38649 false, /* isInfallible. False in setters. */
38650 false, /* isMovable. Not relevant for setters. */
38651 false, /* isEliminatable. Not relevant for setters. */
38652 false, /* isAlwaysInSlot. Only relevant for getters. */
38653 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38654 false, /* isTypedMethod. Only relevant for methods. */
38655 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38656};
38657
38658MOZ_CAN_RUN_SCRIPT static bool
38659get_prefable5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38660{
38661 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38664( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38662 "TestJSImplInterface", "prefable5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38664( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38663 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38664( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38664 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38664( cx, "TestJSImplInterface"
, "prefable5", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38665
38666 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38667 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38668 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38669 if (objIsXray) {
38670 unwrappedObj.emplace(cx, obj);
38671 }
38672 if (objIsXray) {
38673 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38674 // we know Xrays have no dynamic unwrap behavior.
38675 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38676 if (!unwrappedObj.ref()) {
38677 return false;
38678 }
38679 }
38680 FastErrorResult rv;
38681 bool result(MOZ_KnownLive(self)(self)->GetPrefable5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38682 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable5 getter"
)), 0))
) {
38683 return false;
38684 }
38685 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38685); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38685; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38686 args.rval().setBoolean(result);
38687 return true;
38688}
38689
38690static const JSJitInfo prefable5_getterinfo = {
38691 { get_prefable5 },
38692 { prototypes::id::TestJSImplInterface },
38693 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38694 JSJitInfo::Getter,
38695 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38696 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38697 false, /* isInfallible. False in setters. */
38698 false, /* isMovable. Not relevant for setters. */
38699 false, /* isEliminatable. Not relevant for setters. */
38700 false, /* isAlwaysInSlot. Only relevant for getters. */
38701 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38702 false, /* isTypedMethod. Only relevant for methods. */
38703 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38704};
38705
38706MOZ_CAN_RUN_SCRIPT static bool
38707get_prefable6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38708{
38709 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38712( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38710 "TestJSImplInterface", "prefable6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38712( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38711 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38712( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38712 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38712( cx, "TestJSImplInterface"
, "prefable6", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38713
38714 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38715 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38716 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38717 if (objIsXray) {
38718 unwrappedObj.emplace(cx, obj);
38719 }
38720 if (objIsXray) {
38721 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38722 // we know Xrays have no dynamic unwrap behavior.
38723 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38724 if (!unwrappedObj.ref()) {
38725 return false;
38726 }
38727 }
38728 FastErrorResult rv;
38729 bool result(MOZ_KnownLive(self)(self)->GetPrefable6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38730 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable6 getter"
)), 0))
) {
38731 return false;
38732 }
38733 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38733); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38733; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38734 args.rval().setBoolean(result);
38735 return true;
38736}
38737
38738static const JSJitInfo prefable6_getterinfo = {
38739 { get_prefable6 },
38740 { prototypes::id::TestJSImplInterface },
38741 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38742 JSJitInfo::Getter,
38743 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38744 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38745 false, /* isInfallible. False in setters. */
38746 false, /* isMovable. Not relevant for setters. */
38747 false, /* isEliminatable. Not relevant for setters. */
38748 false, /* isAlwaysInSlot. Only relevant for getters. */
38749 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38750 false, /* isTypedMethod. Only relevant for methods. */
38751 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38752};
38753
38754MOZ_CAN_RUN_SCRIPT static bool
38755get_prefable7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38756{
38757 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38760( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38758 "TestJSImplInterface", "prefable7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38760( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38759 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38760( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38760 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38760( cx, "TestJSImplInterface"
, "prefable7", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38761
38762 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38763 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38764 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38765 if (objIsXray) {
38766 unwrappedObj.emplace(cx, obj);
38767 }
38768 if (objIsXray) {
38769 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38770 // we know Xrays have no dynamic unwrap behavior.
38771 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38772 if (!unwrappedObj.ref()) {
38773 return false;
38774 }
38775 }
38776 FastErrorResult rv;
38777 bool result(MOZ_KnownLive(self)(self)->GetPrefable7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38778 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable7 getter"
)), 0))
) {
38779 return false;
38780 }
38781 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38781); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38781; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38782 args.rval().setBoolean(result);
38783 return true;
38784}
38785
38786static const JSJitInfo prefable7_getterinfo = {
38787 { get_prefable7 },
38788 { prototypes::id::TestJSImplInterface },
38789 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38790 JSJitInfo::Getter,
38791 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38792 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38793 false, /* isInfallible. False in setters. */
38794 false, /* isMovable. Not relevant for setters. */
38795 false, /* isEliminatable. Not relevant for setters. */
38796 false, /* isAlwaysInSlot. Only relevant for getters. */
38797 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38798 false, /* isTypedMethod. Only relevant for methods. */
38799 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38800};
38801
38802MOZ_CAN_RUN_SCRIPT static bool
38803get_prefable8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38804{
38805 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38808( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38806 "TestJSImplInterface", "prefable8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38808( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38807 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38808( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38808 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38808( cx, "TestJSImplInterface"
, "prefable8", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38809
38810 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38811 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38812 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38813 if (objIsXray) {
38814 unwrappedObj.emplace(cx, obj);
38815 }
38816 if (objIsXray) {
38817 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38818 // we know Xrays have no dynamic unwrap behavior.
38819 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38820 if (!unwrappedObj.ref()) {
38821 return false;
38822 }
38823 }
38824 FastErrorResult rv;
38825 bool result(MOZ_KnownLive(self)(self)->GetPrefable8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38826 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable8 getter"
)), 0))
) {
38827 return false;
38828 }
38829 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38829); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38829; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38830 args.rval().setBoolean(result);
38831 return true;
38832}
38833
38834static const JSJitInfo prefable8_getterinfo = {
38835 { get_prefable8 },
38836 { prototypes::id::TestJSImplInterface },
38837 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38838 JSJitInfo::Getter,
38839 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38840 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38841 false, /* isInfallible. False in setters. */
38842 false, /* isMovable. Not relevant for setters. */
38843 false, /* isEliminatable. Not relevant for setters. */
38844 false, /* isAlwaysInSlot. Only relevant for getters. */
38845 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38846 false, /* isTypedMethod. Only relevant for methods. */
38847 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38848};
38849
38850MOZ_CAN_RUN_SCRIPT static bool
38851get_prefable9(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
38852{
38853 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38856( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38854 "TestJSImplInterface", "prefable9", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38856( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38855 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject38856( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
38856 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38856( cx, "TestJSImplInterface"
, "prefable9", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_GETTER) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
38857
38858 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38859 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38860 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38861 if (objIsXray) {
38862 unwrappedObj.emplace(cx, obj);
38863 }
38864 if (objIsXray) {
38865 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38866 // we know Xrays have no dynamic unwrap behavior.
38867 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38868 if (!unwrappedObj.ref()) {
38869 return false;
38870 }
38871 }
38872 FastErrorResult rv;
38873 bool result(MOZ_KnownLive(self)(self)->GetPrefable9(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
38874 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable9 getter"
)), 0))
) {
38875 return false;
38876 }
38877 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38877); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38877; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38878 args.rval().setBoolean(result);
38879 return true;
38880}
38881
38882static const JSJitInfo prefable9_getterinfo = {
38883 { get_prefable9 },
38884 { prototypes::id::TestJSImplInterface },
38885 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38886 JSJitInfo::Getter,
38887 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38888 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
38889 false, /* isInfallible. False in setters. */
38890 false, /* isMovable. Not relevant for setters. */
38891 false, /* isEliminatable. Not relevant for setters. */
38892 false, /* isAlwaysInSlot. Only relevant for getters. */
38893 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38894 false, /* isTypedMethod. Only relevant for methods. */
38895 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38896};
38897
38898MOZ_CAN_RUN_SCRIPT static bool
38899prefable10(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38900{
38901 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38904( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38902 "TestJSImplInterface", "prefable10", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38904( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38903 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38904( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38904 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38904( cx, "TestJSImplInterface"
, "prefable10", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38905
38906 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38907 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38908 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38909 if (objIsXray) {
38910 unwrappedObj.emplace(cx, obj);
38911 }
38912 if (objIsXray) {
38913 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38914 // we know Xrays have no dynamic unwrap behavior.
38915 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38916 if (!unwrappedObj.ref()) {
38917 return false;
38918 }
38919 }
38920 FastErrorResult rv;
38921 // NOTE: This assert does NOT call the function.
38922 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable10(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38923 MOZ_KnownLive(self)(self)->Prefable10(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38924 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable10"
)), 0))
) {
38925 return false;
38926 }
38927 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38927); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38927; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38928 args.rval().setUndefined();
38929 return true;
38930}
38931
38932static const JSJitInfo prefable10_methodinfo = {
38933 { (JSJitGetterOp)prefable10 },
38934 { prototypes::id::TestJSImplInterface },
38935 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38936 JSJitInfo::Method,
38937 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38938 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38939 false, /* isInfallible. False in setters. */
38940 false, /* isMovable. Not relevant for setters. */
38941 false, /* isEliminatable. Not relevant for setters. */
38942 false, /* isAlwaysInSlot. Only relevant for getters. */
38943 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38944 false, /* isTypedMethod. Only relevant for methods. */
38945 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38946};
38947
38948MOZ_CAN_RUN_SCRIPT static bool
38949prefable11(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
38950{
38951 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject38954( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38952 "TestJSImplInterface", "prefable11", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject38954( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38953 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject38954( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
38954 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject38954( cx, "TestJSImplInterface"
, "prefable11", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
38955
38956 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
38957 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
38958 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
38959 if (objIsXray) {
38960 unwrappedObj.emplace(cx, obj);
38961 }
38962 if (objIsXray) {
38963 // Since our object is an Xray, we can just CheckedUnwrapStatic:
38964 // we know Xrays have no dynamic unwrap behavior.
38965 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
38966 if (!unwrappedObj.ref()) {
38967 return false;
38968 }
38969 }
38970 FastErrorResult rv;
38971 // NOTE: This assert does NOT call the function.
38972 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable11(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
38973 MOZ_KnownLive(self)(self)->Prefable11(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
38974 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable11"
)), 0))
) {
38975 return false;
38976 }
38977 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 38977); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 38977; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
38978 args.rval().setUndefined();
38979 return true;
38980}
38981
38982static const JSJitInfo prefable11_methodinfo = {
38983 { (JSJitGetterOp)prefable11 },
38984 { prototypes::id::TestJSImplInterface },
38985 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
38986 JSJitInfo::Method,
38987 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
38988 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
38989 false, /* isInfallible. False in setters. */
38990 false, /* isMovable. Not relevant for setters. */
38991 false, /* isEliminatable. Not relevant for setters. */
38992 false, /* isAlwaysInSlot. Only relevant for getters. */
38993 false, /* isLazilyCachedInSlot. Only relevant for getters. */
38994 false, /* isTypedMethod. Only relevant for methods. */
38995 0 /* Reserved slot index, if we're stored in a slot, else 0. */
38996};
38997
38998MOZ_CAN_RUN_SCRIPT static bool
38999get_prefable12(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39000{
39001 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39004( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39002 "TestJSImplInterface", "prefable12", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39004( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39003 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39004( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39004 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39004( cx, "TestJSImplInterface"
, "prefable12", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39005
39006 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39007 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39008 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39009 if (objIsXray) {
39010 unwrappedObj.emplace(cx, obj);
39011 }
39012 if (objIsXray) {
39013 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39014 // we know Xrays have no dynamic unwrap behavior.
39015 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39016 if (!unwrappedObj.ref()) {
39017 return false;
39018 }
39019 }
39020 FastErrorResult rv;
39021 bool result(MOZ_KnownLive(self)(self)->GetPrefable12(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39022 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable12 getter"
)), 0))
) {
39023 return false;
39024 }
39025 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39025); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39025; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39026 args.rval().setBoolean(result);
39027 return true;
39028}
39029
39030static const JSJitInfo prefable12_getterinfo = {
39031 { get_prefable12 },
39032 { prototypes::id::TestJSImplInterface },
39033 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39034 JSJitInfo::Getter,
39035 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39036 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39037 false, /* isInfallible. False in setters. */
39038 false, /* isMovable. Not relevant for setters. */
39039 false, /* isEliminatable. Not relevant for setters. */
39040 false, /* isAlwaysInSlot. Only relevant for getters. */
39041 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39042 false, /* isTypedMethod. Only relevant for methods. */
39043 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39044};
39045
39046MOZ_CAN_RUN_SCRIPT static bool
39047prefable13(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39048{
39049 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39052( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39050 "TestJSImplInterface", "prefable13", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39052( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39051 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39052( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39052 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39052( cx, "TestJSImplInterface"
, "prefable13", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39053
39054 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39055 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39056 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39057 if (objIsXray) {
39058 unwrappedObj.emplace(cx, obj);
39059 }
39060 if (objIsXray) {
39061 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39062 // we know Xrays have no dynamic unwrap behavior.
39063 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39064 if (!unwrappedObj.ref()) {
39065 return false;
39066 }
39067 }
39068 FastErrorResult rv;
39069 // NOTE: This assert does NOT call the function.
39070 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable13(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39071 MOZ_KnownLive(self)(self)->Prefable13(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39072 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable13"
)), 0))
) {
39073 return false;
39074 }
39075 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39075); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39075; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39076 args.rval().setUndefined();
39077 return true;
39078}
39079
39080static const JSJitInfo prefable13_methodinfo = {
39081 { (JSJitGetterOp)prefable13 },
39082 { prototypes::id::TestJSImplInterface },
39083 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39084 JSJitInfo::Method,
39085 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39086 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39087 false, /* isInfallible. False in setters. */
39088 false, /* isMovable. Not relevant for setters. */
39089 false, /* isEliminatable. Not relevant for setters. */
39090 false, /* isAlwaysInSlot. Only relevant for getters. */
39091 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39092 false, /* isTypedMethod. Only relevant for methods. */
39093 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39094};
39095
39096MOZ_CAN_RUN_SCRIPT static bool
39097get_prefable14(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39098{
39099 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39102( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39100 "TestJSImplInterface", "prefable14", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39102( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39101 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39102( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39102 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39102( cx, "TestJSImplInterface"
, "prefable14", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39103
39104 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39105 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39106 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39107 if (objIsXray) {
39108 unwrappedObj.emplace(cx, obj);
39109 }
39110 if (objIsXray) {
39111 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39112 // we know Xrays have no dynamic unwrap behavior.
39113 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39114 if (!unwrappedObj.ref()) {
39115 return false;
39116 }
39117 }
39118 FastErrorResult rv;
39119 bool result(MOZ_KnownLive(self)(self)->GetPrefable14(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39120 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable14 getter"
)), 0))
) {
39121 return false;
39122 }
39123 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39123); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39123; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39124 args.rval().setBoolean(result);
39125 return true;
39126}
39127
39128static const JSJitInfo prefable14_getterinfo = {
39129 { get_prefable14 },
39130 { prototypes::id::TestJSImplInterface },
39131 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39132 JSJitInfo::Getter,
39133 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39134 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39135 false, /* isInfallible. False in setters. */
39136 false, /* isMovable. Not relevant for setters. */
39137 false, /* isEliminatable. Not relevant for setters. */
39138 false, /* isAlwaysInSlot. Only relevant for getters. */
39139 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39140 false, /* isTypedMethod. Only relevant for methods. */
39141 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39142};
39143
39144MOZ_CAN_RUN_SCRIPT static bool
39145get_prefable15(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39146{
39147 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39150( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39148 "TestJSImplInterface", "prefable15", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39150( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39149 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39150( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39150 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39150( cx, "TestJSImplInterface"
, "prefable15", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39151
39152 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39153 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39154 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39155 if (objIsXray) {
39156 unwrappedObj.emplace(cx, obj);
39157 }
39158 if (objIsXray) {
39159 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39160 // we know Xrays have no dynamic unwrap behavior.
39161 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39162 if (!unwrappedObj.ref()) {
39163 return false;
39164 }
39165 }
39166 FastErrorResult rv;
39167 bool result(MOZ_KnownLive(self)(self)->GetPrefable15(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39168 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable15 getter"
)), 0))
) {
39169 return false;
39170 }
39171 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39171; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39172 args.rval().setBoolean(result);
39173 return true;
39174}
39175
39176static const JSJitInfo prefable15_getterinfo = {
39177 { get_prefable15 },
39178 { prototypes::id::TestJSImplInterface },
39179 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39180 JSJitInfo::Getter,
39181 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39182 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39183 false, /* isInfallible. False in setters. */
39184 false, /* isMovable. Not relevant for setters. */
39185 false, /* isEliminatable. Not relevant for setters. */
39186 false, /* isAlwaysInSlot. Only relevant for getters. */
39187 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39188 false, /* isTypedMethod. Only relevant for methods. */
39189 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39190};
39191
39192MOZ_CAN_RUN_SCRIPT static bool
39193get_prefable16(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39194{
39195 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39198( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39196 "TestJSImplInterface", "prefable16", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39198( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39197 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39198( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39198 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39198( cx, "TestJSImplInterface"
, "prefable16", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39199
39200 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39201 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39202 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39203 if (objIsXray) {
39204 unwrappedObj.emplace(cx, obj);
39205 }
39206 if (objIsXray) {
39207 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39208 // we know Xrays have no dynamic unwrap behavior.
39209 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39210 if (!unwrappedObj.ref()) {
39211 return false;
39212 }
39213 }
39214 FastErrorResult rv;
39215 bool result(MOZ_KnownLive(self)(self)->GetPrefable16(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39216 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable16 getter"
)), 0))
) {
39217 return false;
39218 }
39219 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39219); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39219; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39220 args.rval().setBoolean(result);
39221 return true;
39222}
39223
39224static const JSJitInfo prefable16_getterinfo = {
39225 { get_prefable16 },
39226 { prototypes::id::TestJSImplInterface },
39227 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39228 JSJitInfo::Getter,
39229 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39230 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39231 false, /* isInfallible. False in setters. */
39232 false, /* isMovable. Not relevant for setters. */
39233 false, /* isEliminatable. Not relevant for setters. */
39234 false, /* isAlwaysInSlot. Only relevant for getters. */
39235 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39236 false, /* isTypedMethod. Only relevant for methods. */
39237 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39238};
39239
39240MOZ_CAN_RUN_SCRIPT static bool
39241prefable17(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39242{
39243 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39246( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39244 "TestJSImplInterface", "prefable17", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39246( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39245 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39246( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39246 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39246( cx, "TestJSImplInterface"
, "prefable17", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39247
39248 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39249 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39250 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39251 if (objIsXray) {
39252 unwrappedObj.emplace(cx, obj);
39253 }
39254 if (objIsXray) {
39255 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39256 // we know Xrays have no dynamic unwrap behavior.
39257 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39258 if (!unwrappedObj.ref()) {
39259 return false;
39260 }
39261 }
39262 FastErrorResult rv;
39263 // NOTE: This assert does NOT call the function.
39264 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable17(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39265 MOZ_KnownLive(self)(self)->Prefable17(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39266 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable17"
)), 0))
) {
39267 return false;
39268 }
39269 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39269); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39269; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39270 args.rval().setUndefined();
39271 return true;
39272}
39273
39274static const JSJitInfo prefable17_methodinfo = {
39275 { (JSJitGetterOp)prefable17 },
39276 { prototypes::id::TestJSImplInterface },
39277 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39278 JSJitInfo::Method,
39279 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39280 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39281 false, /* isInfallible. False in setters. */
39282 false, /* isMovable. Not relevant for setters. */
39283 false, /* isEliminatable. Not relevant for setters. */
39284 false, /* isAlwaysInSlot. Only relevant for getters. */
39285 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39286 false, /* isTypedMethod. Only relevant for methods. */
39287 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39288};
39289
39290MOZ_CAN_RUN_SCRIPT static bool
39291prefable18(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39292{
39293 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39296( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39294 "TestJSImplInterface", "prefable18", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39296( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39295 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39296( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39296 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39296( cx, "TestJSImplInterface"
, "prefable18", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39297
39298 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39299 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39300 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39301 if (objIsXray) {
39302 unwrappedObj.emplace(cx, obj);
39303 }
39304 if (objIsXray) {
39305 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39306 // we know Xrays have no dynamic unwrap behavior.
39307 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39308 if (!unwrappedObj.ref()) {
39309 return false;
39310 }
39311 }
39312 FastErrorResult rv;
39313 // NOTE: This assert does NOT call the function.
39314 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable18(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39315 MOZ_KnownLive(self)(self)->Prefable18(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39316 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable18"
)), 0))
) {
39317 return false;
39318 }
39319 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39319); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39319; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39320 args.rval().setUndefined();
39321 return true;
39322}
39323
39324static const JSJitInfo prefable18_methodinfo = {
39325 { (JSJitGetterOp)prefable18 },
39326 { prototypes::id::TestJSImplInterface },
39327 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39328 JSJitInfo::Method,
39329 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39330 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39331 false, /* isInfallible. False in setters. */
39332 false, /* isMovable. Not relevant for setters. */
39333 false, /* isEliminatable. Not relevant for setters. */
39334 false, /* isAlwaysInSlot. Only relevant for getters. */
39335 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39336 false, /* isTypedMethod. Only relevant for methods. */
39337 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39338};
39339
39340MOZ_CAN_RUN_SCRIPT static bool
39341prefable19(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39342{
39343 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39346( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39344 "TestJSImplInterface", "prefable19", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39346( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39345 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39346( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39346 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39346( cx, "TestJSImplInterface"
, "prefable19", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39347
39348 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39349 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39350 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39351 if (objIsXray) {
39352 unwrappedObj.emplace(cx, obj);
39353 }
39354 if (objIsXray) {
39355 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39356 // we know Xrays have no dynamic unwrap behavior.
39357 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39358 if (!unwrappedObj.ref()) {
39359 return false;
39360 }
39361 }
39362 FastErrorResult rv;
39363 // NOTE: This assert does NOT call the function.
39364 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable19(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39365 MOZ_KnownLive(self)(self)->Prefable19(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39366 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable19"
)), 0))
) {
39367 return false;
39368 }
39369 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39369); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39369; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39370 args.rval().setUndefined();
39371 return true;
39372}
39373
39374static const JSJitInfo prefable19_methodinfo = {
39375 { (JSJitGetterOp)prefable19 },
39376 { prototypes::id::TestJSImplInterface },
39377 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39378 JSJitInfo::Method,
39379 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39380 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39381 false, /* isInfallible. False in setters. */
39382 false, /* isMovable. Not relevant for setters. */
39383 false, /* isEliminatable. Not relevant for setters. */
39384 false, /* isAlwaysInSlot. Only relevant for getters. */
39385 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39386 false, /* isTypedMethod. Only relevant for methods. */
39387 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39388};
39389
39390MOZ_CAN_RUN_SCRIPT static bool
39391prefable20(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39392{
39393 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39396( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39394 "TestJSImplInterface", "prefable20", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39396( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39395 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39396( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39396 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39396( cx, "TestJSImplInterface"
, "prefable20", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39397
39398 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39399 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39400 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39401 if (objIsXray) {
39402 unwrappedObj.emplace(cx, obj);
39403 }
39404 if (objIsXray) {
39405 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39406 // we know Xrays have no dynamic unwrap behavior.
39407 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39408 if (!unwrappedObj.ref()) {
39409 return false;
39410 }
39411 }
39412 FastErrorResult rv;
39413 // NOTE: This assert does NOT call the function.
39414 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Prefable20(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39415 MOZ_KnownLive(self)(self)->Prefable20(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39416 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.prefable20"
)), 0))
) {
39417 return false;
39418 }
39419 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39419; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39420 args.rval().setUndefined();
39421 return true;
39422}
39423
39424static const JSJitInfo prefable20_methodinfo = {
39425 { (JSJitGetterOp)prefable20 },
39426 { prototypes::id::TestJSImplInterface },
39427 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39428 JSJitInfo::Method,
39429 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39430 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39431 false, /* isInfallible. False in setters. */
39432 false, /* isMovable. Not relevant for setters. */
39433 false, /* isEliminatable. Not relevant for setters. */
39434 false, /* isAlwaysInSlot. Only relevant for getters. */
39435 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39436 false, /* isTypedMethod. Only relevant for methods. */
39437 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39438};
39439
39440MOZ_CAN_RUN_SCRIPT static bool
39441get_conditionalOnSecureContext1(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39442{
39443 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39446( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39444 "TestJSImplInterface", "conditionalOnSecureContext1", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39446( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39445 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39446( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39446 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39446( cx, "TestJSImplInterface"
, "conditionalOnSecureContext1", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39447
39448 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39449 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39450 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39451 if (objIsXray) {
39452 unwrappedObj.emplace(cx, obj);
39453 }
39454 if (objIsXray) {
39455 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39456 // we know Xrays have no dynamic unwrap behavior.
39457 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39458 if (!unwrappedObj.ref()) {
39459 return false;
39460 }
39461 }
39462 FastErrorResult rv;
39463 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext1(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39464 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext1 getter"
)), 0))
) {
39465 return false;
39466 }
39467 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39467); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39467; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39468 args.rval().setBoolean(result);
39469 return true;
39470}
39471
39472static const JSJitInfo conditionalOnSecureContext1_getterinfo = {
39473 { get_conditionalOnSecureContext1 },
39474 { prototypes::id::TestJSImplInterface },
39475 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39476 JSJitInfo::Getter,
39477 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39478 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39479 false, /* isInfallible. False in setters. */
39480 false, /* isMovable. Not relevant for setters. */
39481 false, /* isEliminatable. Not relevant for setters. */
39482 false, /* isAlwaysInSlot. Only relevant for getters. */
39483 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39484 false, /* isTypedMethod. Only relevant for methods. */
39485 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39486};
39487
39488MOZ_CAN_RUN_SCRIPT static bool
39489get_conditionalOnSecureContext2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39490{
39491 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39494( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39492 "TestJSImplInterface", "conditionalOnSecureContext2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39494( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39493 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39494( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39494 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39494( cx, "TestJSImplInterface"
, "conditionalOnSecureContext2", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39495
39496 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39497 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39498 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39499 if (objIsXray) {
39500 unwrappedObj.emplace(cx, obj);
39501 }
39502 if (objIsXray) {
39503 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39504 // we know Xrays have no dynamic unwrap behavior.
39505 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39506 if (!unwrappedObj.ref()) {
39507 return false;
39508 }
39509 }
39510 FastErrorResult rv;
39511 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39512 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext2 getter"
)), 0))
) {
39513 return false;
39514 }
39515 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39515); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39515; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39516 args.rval().setBoolean(result);
39517 return true;
39518}
39519
39520static const JSJitInfo conditionalOnSecureContext2_getterinfo = {
39521 { get_conditionalOnSecureContext2 },
39522 { prototypes::id::TestJSImplInterface },
39523 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39524 JSJitInfo::Getter,
39525 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39526 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39527 false, /* isInfallible. False in setters. */
39528 false, /* isMovable. Not relevant for setters. */
39529 false, /* isEliminatable. Not relevant for setters. */
39530 false, /* isAlwaysInSlot. Only relevant for getters. */
39531 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39532 false, /* isTypedMethod. Only relevant for methods. */
39533 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39534};
39535
39536MOZ_CAN_RUN_SCRIPT static bool
39537get_conditionalOnSecureContext3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39538{
39539 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39542( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39540 "TestJSImplInterface", "conditionalOnSecureContext3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39542( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39541 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39542( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39542 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39542( cx, "TestJSImplInterface"
, "conditionalOnSecureContext3", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39543
39544 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39545 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39546 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39547 if (objIsXray) {
39548 unwrappedObj.emplace(cx, obj);
39549 }
39550 if (objIsXray) {
39551 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39552 // we know Xrays have no dynamic unwrap behavior.
39553 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39554 if (!unwrappedObj.ref()) {
39555 return false;
39556 }
39557 }
39558 FastErrorResult rv;
39559 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39560 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext3 getter"
)), 0))
) {
39561 return false;
39562 }
39563 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39563); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39563; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39564 args.rval().setBoolean(result);
39565 return true;
39566}
39567
39568static const JSJitInfo conditionalOnSecureContext3_getterinfo = {
39569 { get_conditionalOnSecureContext3 },
39570 { prototypes::id::TestJSImplInterface },
39571 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39572 JSJitInfo::Getter,
39573 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39574 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39575 false, /* isInfallible. False in setters. */
39576 false, /* isMovable. Not relevant for setters. */
39577 false, /* isEliminatable. Not relevant for setters. */
39578 false, /* isAlwaysInSlot. Only relevant for getters. */
39579 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39580 false, /* isTypedMethod. Only relevant for methods. */
39581 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39582};
39583
39584MOZ_CAN_RUN_SCRIPT static bool
39585get_conditionalOnSecureContext4(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39586{
39587 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39590( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39588 "TestJSImplInterface", "conditionalOnSecureContext4", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39590( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39589 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39590( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39590 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39590( cx, "TestJSImplInterface"
, "conditionalOnSecureContext4", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39591
39592 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39593 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39594 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39595 if (objIsXray) {
39596 unwrappedObj.emplace(cx, obj);
39597 }
39598 if (objIsXray) {
39599 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39600 // we know Xrays have no dynamic unwrap behavior.
39601 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39602 if (!unwrappedObj.ref()) {
39603 return false;
39604 }
39605 }
39606 FastErrorResult rv;
39607 bool result(MOZ_KnownLive(self)(self)->GetConditionalOnSecureContext4(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39608 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext4 getter"
)), 0))
) {
39609 return false;
39610 }
39611 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39611); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39611; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39612 args.rval().setBoolean(result);
39613 return true;
39614}
39615
39616static const JSJitInfo conditionalOnSecureContext4_getterinfo = {
39617 { get_conditionalOnSecureContext4 },
39618 { prototypes::id::TestJSImplInterface },
39619 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39620 JSJitInfo::Getter,
39621 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39622 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
39623 false, /* isInfallible. False in setters. */
39624 false, /* isMovable. Not relevant for setters. */
39625 false, /* isEliminatable. Not relevant for setters. */
39626 false, /* isAlwaysInSlot. Only relevant for getters. */
39627 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39628 false, /* isTypedMethod. Only relevant for methods. */
39629 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39630};
39631
39632MOZ_CAN_RUN_SCRIPT static bool
39633conditionalOnSecureContext5(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39634{
39635 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39638( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39636 "TestJSImplInterface", "conditionalOnSecureContext5", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39638( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39637 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39638( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39638 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39638( cx, "TestJSImplInterface"
, "conditionalOnSecureContext5", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39639
39640 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39641 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39642 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39643 if (objIsXray) {
39644 unwrappedObj.emplace(cx, obj);
39645 }
39646 if (objIsXray) {
39647 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39648 // we know Xrays have no dynamic unwrap behavior.
39649 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39650 if (!unwrappedObj.ref()) {
39651 return false;
39652 }
39653 }
39654 FastErrorResult rv;
39655 // NOTE: This assert does NOT call the function.
39656 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ConditionalOnSecureContext5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39657 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext5(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39658 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext5"
)), 0))
) {
39659 return false;
39660 }
39661 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39661); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39661; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39662 args.rval().setUndefined();
39663 return true;
39664}
39665
39666static const JSJitInfo conditionalOnSecureContext5_methodinfo = {
39667 { (JSJitGetterOp)conditionalOnSecureContext5 },
39668 { prototypes::id::TestJSImplInterface },
39669 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39670 JSJitInfo::Method,
39671 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39672 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39673 false, /* isInfallible. False in setters. */
39674 false, /* isMovable. Not relevant for setters. */
39675 false, /* isEliminatable. Not relevant for setters. */
39676 false, /* isAlwaysInSlot. Only relevant for getters. */
39677 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39678 false, /* isTypedMethod. Only relevant for methods. */
39679 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39680};
39681
39682MOZ_CAN_RUN_SCRIPT static bool
39683conditionalOnSecureContext6(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39684{
39685 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39688( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39686 "TestJSImplInterface", "conditionalOnSecureContext6", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39688( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39687 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39688( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39688 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39688( cx, "TestJSImplInterface"
, "conditionalOnSecureContext6", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39689
39690 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39691 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39692 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39693 if (objIsXray) {
39694 unwrappedObj.emplace(cx, obj);
39695 }
39696 if (objIsXray) {
39697 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39698 // we know Xrays have no dynamic unwrap behavior.
39699 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39700 if (!unwrappedObj.ref()) {
39701 return false;
39702 }
39703 }
39704 FastErrorResult rv;
39705 // NOTE: This assert does NOT call the function.
39706 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ConditionalOnSecureContext6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39707 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext6(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39708 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext6"
)), 0))
) {
39709 return false;
39710 }
39711 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39711); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39711; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39712 args.rval().setUndefined();
39713 return true;
39714}
39715
39716static const JSJitInfo conditionalOnSecureContext6_methodinfo = {
39717 { (JSJitGetterOp)conditionalOnSecureContext6 },
39718 { prototypes::id::TestJSImplInterface },
39719 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39720 JSJitInfo::Method,
39721 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39722 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39723 false, /* isInfallible. False in setters. */
39724 false, /* isMovable. Not relevant for setters. */
39725 false, /* isEliminatable. Not relevant for setters. */
39726 false, /* isAlwaysInSlot. Only relevant for getters. */
39727 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39728 false, /* isTypedMethod. Only relevant for methods. */
39729 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39730};
39731
39732MOZ_CAN_RUN_SCRIPT static bool
39733conditionalOnSecureContext7(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39734{
39735 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39738( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39736 "TestJSImplInterface", "conditionalOnSecureContext7", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39738( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39737 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39738( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39738 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39738( cx, "TestJSImplInterface"
, "conditionalOnSecureContext7", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39739
39740 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39741 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39742 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39743 if (objIsXray) {
39744 unwrappedObj.emplace(cx, obj);
39745 }
39746 if (objIsXray) {
39747 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39748 // we know Xrays have no dynamic unwrap behavior.
39749 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39750 if (!unwrappedObj.ref()) {
39751 return false;
39752 }
39753 }
39754 FastErrorResult rv;
39755 // NOTE: This assert does NOT call the function.
39756 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ConditionalOnSecureContext7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39757 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext7(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39758 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext7"
)), 0))
) {
39759 return false;
39760 }
39761 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39761); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39761; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39762 args.rval().setUndefined();
39763 return true;
39764}
39765
39766static const JSJitInfo conditionalOnSecureContext7_methodinfo = {
39767 { (JSJitGetterOp)conditionalOnSecureContext7 },
39768 { prototypes::id::TestJSImplInterface },
39769 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39770 JSJitInfo::Method,
39771 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39772 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39773 false, /* isInfallible. False in setters. */
39774 false, /* isMovable. Not relevant for setters. */
39775 false, /* isEliminatable. Not relevant for setters. */
39776 false, /* isAlwaysInSlot. Only relevant for getters. */
39777 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39778 false, /* isTypedMethod. Only relevant for methods. */
39779 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39780};
39781
39782MOZ_CAN_RUN_SCRIPT static bool
39783conditionalOnSecureContext8(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39784{
39785 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39788( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39786 "TestJSImplInterface", "conditionalOnSecureContext8", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39788( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39787 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39788( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
39788 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39788( cx, "TestJSImplInterface"
, "conditionalOnSecureContext8", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
39789
39790 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39791 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39792 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39793 if (objIsXray) {
39794 unwrappedObj.emplace(cx, obj);
39795 }
39796 if (objIsXray) {
39797 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39798 // we know Xrays have no dynamic unwrap behavior.
39799 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39800 if (!unwrappedObj.ref()) {
39801 return false;
39802 }
39803 }
39804 FastErrorResult rv;
39805 // NOTE: This assert does NOT call the function.
39806 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ConditionalOnSecureContext8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39807 MOZ_KnownLive(self)(self)->ConditionalOnSecureContext8(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39808 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.conditionalOnSecureContext8"
)), 0))
) {
39809 return false;
39810 }
39811 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39811); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39811; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39812 args.rval().setUndefined();
39813 return true;
39814}
39815
39816static const JSJitInfo conditionalOnSecureContext8_methodinfo = {
39817 { (JSJitGetterOp)conditionalOnSecureContext8 },
39818 { prototypes::id::TestJSImplInterface },
39819 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39820 JSJitInfo::Method,
39821 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39822 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39823 false, /* isInfallible. False in setters. */
39824 false, /* isMovable. Not relevant for setters. */
39825 false, /* isEliminatable. Not relevant for setters. */
39826 false, /* isAlwaysInSlot. Only relevant for getters. */
39827 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39828 false, /* isTypedMethod. Only relevant for methods. */
39829 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39830};
39831
39832MOZ_CAN_RUN_SCRIPT static bool
39833get_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
39834{
39835 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39838( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39836 "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39838( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39837 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject39838( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39838 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39838( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39839
39840 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39841 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39842 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39843 if (objIsXray) {
39844 unwrappedObj.emplace(cx, obj);
39845 }
39846 if (objIsXray) {
39847 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39848 // we know Xrays have no dynamic unwrap behavior.
39849 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39850 if (!unwrappedObj.ref()) {
39851 return false;
39852 }
39853 }
39854 FastErrorResult rv;
39855 int32_t result(MOZ_KnownLive(self)(self)->GetAttrWithLenientThis(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
39856 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis getter"
)), 0))
) {
39857 return false;
39858 }
39859 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39859); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39859; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39860 args.rval().setInt32(int32_t(result));
39861 return true;
39862}
39863
39864MOZ_CAN_RUN_SCRIPT static bool
39865set_attrWithLenientThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
39866{
39867 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39870( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39868 "TestJSImplInterface", "attrWithLenientThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39870( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39869 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject39870( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39870 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39870( cx, "TestJSImplInterface"
, "attrWithLenientThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39871
39872 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39873 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39874 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39875 if (objIsXray) {
39876 unwrappedObj.emplace(cx, obj);
39877 }
39878 int32_t arg0;
39879 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
39880 return false;
39881 }
39882 if (objIsXray) {
39883 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39884 // we know Xrays have no dynamic unwrap behavior.
39885 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39886 if (!unwrappedObj.ref()) {
39887 return false;
39888 }
39889 }
39890 FastErrorResult rv;
39891 // NOTE: This assert does NOT call the function.
39892 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAttrWithLenientThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39893 MOZ_KnownLive(self)(self)->SetAttrWithLenientThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39894 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.attrWithLenientThis setter"
)), 0))
) {
39895 return false;
39896 }
39897 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39897); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39897; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39898
39899 return true;
39900}
39901
39902static const JSJitInfo attrWithLenientThis_getterinfo = {
39903 { get_attrWithLenientThis },
39904 { prototypes::id::TestJSImplInterface },
39905 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39906 JSJitInfo::Getter,
39907 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39908 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
39909 false, /* isInfallible. False in setters. */
39910 false, /* isMovable. Not relevant for setters. */
39911 false, /* isEliminatable. Not relevant for setters. */
39912 false, /* isAlwaysInSlot. Only relevant for getters. */
39913 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39914 false, /* isTypedMethod. Only relevant for methods. */
39915 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39916};
39917static const JSJitInfo attrWithLenientThis_setterinfo = {
39918 { (JSJitGetterOp)set_attrWithLenientThis },
39919 { prototypes::id::TestJSImplInterface },
39920 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39921 JSJitInfo::Setter,
39922 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39923 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39924 false, /* isInfallible. False in setters. */
39925 false, /* isMovable. Not relevant for setters. */
39926 false, /* isEliminatable. Not relevant for setters. */
39927 false, /* isAlwaysInSlot. Only relevant for getters. */
39928 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39929 false, /* isTypedMethod. Only relevant for methods. */
39930 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39931};
39932
39933MOZ_CAN_RUN_SCRIPT static bool
39934passRenamedInterface(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
39935{
39936 BindingCallContext cx(cx_, "TestJSImplInterface.passRenamedInterface");
39937 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject39940( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39938 "TestJSImplInterface", "passRenamedInterface", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject39940( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39939 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject39940( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
39940 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject39940( cx, "TestJSImplInterface"
, "passRenamedInterface", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
39941
39942 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
39943 if (!args.requireAtLeast(cx, "TestJSImplInterface.passRenamedInterface", 1)) {
39944 return false;
39945 }
39946 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
39947 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
39948 if (objIsXray) {
39949 unwrappedObj.emplace(cx, obj);
39950 }
39951 NonNull<nsRenamedInterface> arg0;
39952 if (args[0].isObject()) {
39953 {
39954 // Our JSContext should be in the right global to do unwrapping in.
39955 nsresult rv = UnwrapObject<prototypes::id::TestRenamedInterface, nsRenamedInterface>(args[0], arg0, cx);
39956 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
39957 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "TestRenamedInterface");
39958 return false;
39959 }
39960 }
39961 } else {
39962 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
39963 return false;
39964 }
39965 if (objIsXray) {
39966 // Since our object is an Xray, we can just CheckedUnwrapStatic:
39967 // we know Xrays have no dynamic unwrap behavior.
39968 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
39969 if (!unwrappedObj.ref()) {
39970 return false;
39971 }
39972 }
39973 FastErrorResult rv;
39974 // NOTE: This assert does NOT call the function.
39975 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassRenamedInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
39976 MOZ_KnownLive(self)(self)->PassRenamedInterface(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
39977 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passRenamedInterface"
)), 0))
) {
39978 return false;
39979 }
39980 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 39980); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 39980; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
39981 args.rval().setUndefined();
39982 return true;
39983}
39984
39985static const JSJitInfo passRenamedInterface_methodinfo = {
39986 { (JSJitGetterOp)passRenamedInterface },
39987 { prototypes::id::TestJSImplInterface },
39988 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
39989 JSJitInfo::Method,
39990 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
39991 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
39992 false, /* isInfallible. False in setters. */
39993 false, /* isMovable. Not relevant for setters. */
39994 false, /* isEliminatable. Not relevant for setters. */
39995 false, /* isAlwaysInSlot. Only relevant for getters. */
39996 false, /* isLazilyCachedInSlot. Only relevant for getters. */
39997 false, /* isTypedMethod. Only relevant for methods. */
39998 0 /* Reserved slot index, if we're stored in a slot, else 0. */
39999};
40000
40001MOZ_CAN_RUN_SCRIPT static bool
40002get_putForwardsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40003{
40004 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40007( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40005 "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40007( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40006 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40007( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40007 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40007( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40008
40009 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40010 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40011 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40012 if (objIsXray) {
40013 unwrappedObj.emplace(cx, obj);
40014 }
40015 if (objIsXray) {
40016 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40017 // we know Xrays have no dynamic unwrap behavior.
40018 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40019 if (!unwrappedObj.ref()) {
40020 return false;
40021 }
40022 }
40023 FastErrorResult rv;
40024 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40025 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr getter"
)), 0))
) {
40026 return false;
40027 }
40028 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40028); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40028; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40029 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40030 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40030); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 40030; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
40031 return false;
40032 }
40033 return true;
40034}
40035
40036MOZ_CAN_RUN_SCRIPT static bool
40037set_putForwardsAttr(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40038{
40039 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr setter");
40040 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40043( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40041 "TestJSImplInterface", "putForwardsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40043( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40042 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40043( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40043 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40043( cx, "TestJSImplInterface"
, "putForwardsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40044
40045 JS::Rooted<JS::Value> v(cx);
40046 if (!JS_GetProperty(cx, obj, "putForwardsAttr", &v)) {
40047 return false;
40048 }
40049
40050 if (!v.isObject()) {
40051 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr");
40052 }
40053
40054 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40055 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40056}
40057
40058static const JSJitInfo putForwardsAttr_getterinfo = {
40059 { get_putForwardsAttr },
40060 { prototypes::id::TestJSImplInterface },
40061 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40062 JSJitInfo::Getter,
40063 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40064 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40065 false, /* isInfallible. False in setters. */
40066 false, /* isMovable. Not relevant for setters. */
40067 false, /* isEliminatable. Not relevant for setters. */
40068 false, /* isAlwaysInSlot. Only relevant for getters. */
40069 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40070 false, /* isTypedMethod. Only relevant for methods. */
40071 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40072};
40073static const JSJitInfo putForwardsAttr_setterinfo = {
40074 { (JSJitGetterOp)set_putForwardsAttr },
40075 { prototypes::id::TestJSImplInterface },
40076 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40077 JSJitInfo::Setter,
40078 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40079 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40080 false, /* isInfallible. False in setters. */
40081 false, /* isMovable. Not relevant for setters. */
40082 false, /* isEliminatable. Not relevant for setters. */
40083 false, /* isAlwaysInSlot. Only relevant for getters. */
40084 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40085 false, /* isTypedMethod. Only relevant for methods. */
40086 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40087};
40088
40089MOZ_CAN_RUN_SCRIPT static bool
40090get_putForwardsAttr2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40091{
40092 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40095( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40093 "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40095( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40094 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40095( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40095 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40095( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40096
40097 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40098 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40099 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40100 if (objIsXray) {
40101 unwrappedObj.emplace(cx, obj);
40102 }
40103 if (objIsXray) {
40104 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40105 // we know Xrays have no dynamic unwrap behavior.
40106 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40107 if (!unwrappedObj.ref()) {
40108 return false;
40109 }
40110 }
40111 FastErrorResult rv;
40112 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40113 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr2 getter"
)), 0))
) {
40114 return false;
40115 }
40116 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40116); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40116; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40117 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40118 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40118); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 40118; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
40119 return false;
40120 }
40121 return true;
40122}
40123
40124MOZ_CAN_RUN_SCRIPT static bool
40125set_putForwardsAttr2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40126{
40127 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr2 setter");
40128 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40131( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40129 "TestJSImplInterface", "putForwardsAttr2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40131( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40130 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40131( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40131 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40131( cx, "TestJSImplInterface"
, "putForwardsAttr2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40132
40133 JS::Rooted<JS::Value> v(cx);
40134 if (!JS_GetProperty(cx, obj, "putForwardsAttr2", &v)) {
40135 return false;
40136 }
40137
40138 if (!v.isObject()) {
40139 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr2");
40140 }
40141
40142 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40143 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40144}
40145
40146static const JSJitInfo putForwardsAttr2_getterinfo = {
40147 { get_putForwardsAttr2 },
40148 { prototypes::id::TestJSImplInterface },
40149 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40150 JSJitInfo::Getter,
40151 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40152 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40153 false, /* isInfallible. False in setters. */
40154 false, /* isMovable. Not relevant for setters. */
40155 false, /* isEliminatable. Not relevant for setters. */
40156 false, /* isAlwaysInSlot. Only relevant for getters. */
40157 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40158 false, /* isTypedMethod. Only relevant for methods. */
40159 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40160};
40161static const JSJitInfo putForwardsAttr2_setterinfo = {
40162 { (JSJitGetterOp)set_putForwardsAttr2 },
40163 { prototypes::id::TestJSImplInterface },
40164 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40165 JSJitInfo::Setter,
40166 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40167 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40168 false, /* isInfallible. False in setters. */
40169 false, /* isMovable. Not relevant for setters. */
40170 false, /* isEliminatable. Not relevant for setters. */
40171 false, /* isAlwaysInSlot. Only relevant for getters. */
40172 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40173 false, /* isTypedMethod. Only relevant for methods. */
40174 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40175};
40176
40177MOZ_CAN_RUN_SCRIPT static bool
40178get_putForwardsAttr3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40179{
40180 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40183( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40181 "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40183( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40182 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40183( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40183 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40183( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40184
40185 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40186 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40187 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40188 if (objIsXray) {
40189 unwrappedObj.emplace(cx, obj);
40190 }
40191 if (objIsXray) {
40192 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40193 // we know Xrays have no dynamic unwrap behavior.
40194 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40195 if (!unwrappedObj.ref()) {
40196 return false;
40197 }
40198 }
40199 FastErrorResult rv;
40200 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(MOZ_KnownLive(self)(self)->GetPutForwardsAttr3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
40201 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.putForwardsAttr3 getter"
)), 0))
) {
40202 return false;
40203 }
40204 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40204); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40204; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40205 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
40206 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40206); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 40206; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
40207 return false;
40208 }
40209 return true;
40210}
40211
40212MOZ_CAN_RUN_SCRIPT static bool
40213set_putForwardsAttr3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40214{
40215 BindingCallContext cx(cx_, "TestJSImplInterface.putForwardsAttr3 setter");
40216 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40219( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40217 "TestJSImplInterface", "putForwardsAttr3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40219( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40218 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40219( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40219 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40219( cx, "TestJSImplInterface"
, "putForwardsAttr3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40220
40221 JS::Rooted<JS::Value> v(cx);
40222 if (!JS_GetProperty(cx, obj, "putForwardsAttr3", &v)) {
40223 return false;
40224 }
40225
40226 if (!v.isObject()) {
40227 return cx.ThrowErrorMessage<MSG_NOT_OBJECT>("TestJSImplInterface.putForwardsAttr3");
40228 }
40229
40230 JS::Rooted<JSObject*> targetObj(cx, &v.toObject());
40231 return JS_SetProperty(cx, targetObj, "writableByte", args[0]);
40232}
40233
40234static const JSJitInfo putForwardsAttr3_getterinfo = {
40235 { get_putForwardsAttr3 },
40236 { prototypes::id::TestJSImplInterface },
40237 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40238 JSJitInfo::Getter,
40239 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40240 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
40241 false, /* isInfallible. False in setters. */
40242 false, /* isMovable. Not relevant for setters. */
40243 false, /* isEliminatable. Not relevant for setters. */
40244 false, /* isAlwaysInSlot. Only relevant for getters. */
40245 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40246 false, /* isTypedMethod. Only relevant for methods. */
40247 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40248};
40249static const JSJitInfo putForwardsAttr3_setterinfo = {
40250 { (JSJitGetterOp)set_putForwardsAttr3 },
40251 { prototypes::id::TestJSImplInterface },
40252 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40253 JSJitInfo::Setter,
40254 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40255 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40256 false, /* isInfallible. False in setters. */
40257 false, /* isMovable. Not relevant for setters. */
40258 false, /* isEliminatable. Not relevant for setters. */
40259 false, /* isAlwaysInSlot. Only relevant for getters. */
40260 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40261 false, /* isTypedMethod. Only relevant for methods. */
40262 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40263};
40264
40265MOZ_CAN_RUN_SCRIPT static bool
40266throwingMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40267{
40268 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40271( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40269 "TestJSImplInterface", "throwingMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40271( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40270 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40271( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40271 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40271( cx, "TestJSImplInterface"
, "throwingMethod", JS::ProfilingCategoryPair::DOM, uint32_t(
js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40272
40273 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40274 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40275 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40276 if (objIsXray) {
40277 unwrappedObj.emplace(cx, obj);
40278 }
40279 if (objIsXray) {
40280 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40281 // we know Xrays have no dynamic unwrap behavior.
40282 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40283 if (!unwrappedObj.ref()) {
40284 return false;
40285 }
40286 }
40287 FastErrorResult rv;
40288 // NOTE: This assert does NOT call the function.
40289 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->ThrowingMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40290 MOZ_KnownLive(self)(self)->ThrowingMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40291 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingMethod"
)), 0))
) {
40292 return false;
40293 }
40294 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40294); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40294; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40295 args.rval().setUndefined();
40296 return true;
40297}
40298
40299static const JSJitInfo throwingMethod_methodinfo = {
40300 { (JSJitGetterOp)throwingMethod },
40301 { prototypes::id::TestJSImplInterface },
40302 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40303 JSJitInfo::Method,
40304 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40305 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40306 false, /* isInfallible. False in setters. */
40307 false, /* isMovable. Not relevant for setters. */
40308 false, /* isEliminatable. Not relevant for setters. */
40309 false, /* isAlwaysInSlot. Only relevant for getters. */
40310 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40311 false, /* isTypedMethod. Only relevant for methods. */
40312 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40313};
40314
40315MOZ_CAN_RUN_SCRIPT static bool
40316get_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40317{
40318 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40321( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40319 "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40321( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40320 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40321( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40321 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40321( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40322
40323 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40324 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40325 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40326 if (objIsXray) {
40327 unwrappedObj.emplace(cx, obj);
40328 }
40329 if (objIsXray) {
40330 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40331 // we know Xrays have no dynamic unwrap behavior.
40332 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40333 if (!unwrappedObj.ref()) {
40334 return false;
40335 }
40336 }
40337 FastErrorResult rv;
40338 bool result(MOZ_KnownLive(self)(self)->GetThrowingAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40339 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr getter"
)), 0))
) {
40340 return false;
40341 }
40342 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40342; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40343 args.rval().setBoolean(result);
40344 return true;
40345}
40346
40347MOZ_CAN_RUN_SCRIPT static bool
40348set_throwingAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40349{
40350 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40353( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40351 "TestJSImplInterface", "throwingAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40353( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40352 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40353( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40353 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40353( cx, "TestJSImplInterface"
, "throwingAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40354
40355 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40356 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40357 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40358 if (objIsXray) {
40359 unwrappedObj.emplace(cx, obj);
40360 }
40361 bool arg0;
40362 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40363 return false;
40364 }
40365 if (objIsXray) {
40366 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40367 // we know Xrays have no dynamic unwrap behavior.
40368 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40369 if (!unwrappedObj.ref()) {
40370 return false;
40371 }
40372 }
40373 FastErrorResult rv;
40374 // NOTE: This assert does NOT call the function.
40375 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetThrowingAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40376 MOZ_KnownLive(self)(self)->SetThrowingAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40377 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingAttr setter"
)), 0))
) {
40378 return false;
40379 }
40380 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40380); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40380; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40381
40382 return true;
40383}
40384
40385static const JSJitInfo throwingAttr_getterinfo = {
40386 { get_throwingAttr },
40387 { prototypes::id::TestJSImplInterface },
40388 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40389 JSJitInfo::Getter,
40390 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40391 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40392 false, /* isInfallible. False in setters. */
40393 false, /* isMovable. Not relevant for setters. */
40394 false, /* isEliminatable. Not relevant for setters. */
40395 false, /* isAlwaysInSlot. Only relevant for getters. */
40396 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40397 false, /* isTypedMethod. Only relevant for methods. */
40398 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40399};
40400static const JSJitInfo throwingAttr_setterinfo = {
40401 { (JSJitGetterOp)set_throwingAttr },
40402 { prototypes::id::TestJSImplInterface },
40403 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40404 JSJitInfo::Setter,
40405 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40406 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40407 false, /* isInfallible. False in setters. */
40408 false, /* isMovable. Not relevant for setters. */
40409 false, /* isEliminatable. Not relevant for setters. */
40410 false, /* isAlwaysInSlot. Only relevant for getters. */
40411 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40412 false, /* isTypedMethod. Only relevant for methods. */
40413 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40414};
40415
40416MOZ_CAN_RUN_SCRIPT static bool
40417get_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40418{
40419 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40422( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40420 "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40422( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40421 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40422( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40422 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40422( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40423
40424 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40425 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40426 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40427 if (objIsXray) {
40428 unwrappedObj.emplace(cx, obj);
40429 }
40430 if (objIsXray) {
40431 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40432 // we know Xrays have no dynamic unwrap behavior.
40433 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40434 if (!unwrappedObj.ref()) {
40435 return false;
40436 }
40437 }
40438 FastErrorResult rv;
40439 bool result(MOZ_KnownLive(self)(self)->GetThrowingGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40440 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr getter"
)), 0))
) {
40441 return false;
40442 }
40443 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40443); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40443; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40444 args.rval().setBoolean(result);
40445 return true;
40446}
40447
40448MOZ_CAN_RUN_SCRIPT static bool
40449set_throwingGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40450{
40451 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40454( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40452 "TestJSImplInterface", "throwingGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40454( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40453 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40454( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40454 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40454( cx, "TestJSImplInterface"
, "throwingGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40455
40456 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40457 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40458 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40459 if (objIsXray) {
40460 unwrappedObj.emplace(cx, obj);
40461 }
40462 bool arg0;
40463 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40464 return false;
40465 }
40466 if (objIsXray) {
40467 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40468 // we know Xrays have no dynamic unwrap behavior.
40469 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40470 if (!unwrappedObj.ref()) {
40471 return false;
40472 }
40473 }
40474 FastErrorResult rv;
40475 // NOTE: This assert does NOT call the function.
40476 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetThrowingGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40477 MOZ_KnownLive(self)(self)->SetThrowingGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40478 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingGetterAttr setter"
)), 0))
) {
40479 return false;
40480 }
40481 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40481; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40482
40483 return true;
40484}
40485
40486static const JSJitInfo throwingGetterAttr_getterinfo = {
40487 { get_throwingGetterAttr },
40488 { prototypes::id::TestJSImplInterface },
40489 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40490 JSJitInfo::Getter,
40491 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40492 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40493 false, /* isInfallible. False in setters. */
40494 false, /* isMovable. Not relevant for setters. */
40495 false, /* isEliminatable. Not relevant for setters. */
40496 false, /* isAlwaysInSlot. Only relevant for getters. */
40497 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40498 false, /* isTypedMethod. Only relevant for methods. */
40499 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40500};
40501static const JSJitInfo throwingGetterAttr_setterinfo = {
40502 { (JSJitGetterOp)set_throwingGetterAttr },
40503 { prototypes::id::TestJSImplInterface },
40504 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40505 JSJitInfo::Setter,
40506 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40507 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40508 false, /* isInfallible. False in setters. */
40509 false, /* isMovable. Not relevant for setters. */
40510 false, /* isEliminatable. Not relevant for setters. */
40511 false, /* isAlwaysInSlot. Only relevant for getters. */
40512 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40513 false, /* isTypedMethod. Only relevant for methods. */
40514 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40515};
40516
40517MOZ_CAN_RUN_SCRIPT static bool
40518get_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40519{
40520 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40523( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40521 "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40523( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40522 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40523( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40523 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40523( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40524
40525 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40526 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40527 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40528 if (objIsXray) {
40529 unwrappedObj.emplace(cx, obj);
40530 }
40531 if (objIsXray) {
40532 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40533 // we know Xrays have no dynamic unwrap behavior.
40534 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40535 if (!unwrappedObj.ref()) {
40536 return false;
40537 }
40538 }
40539 FastErrorResult rv;
40540 bool result(MOZ_KnownLive(self)(self)->GetThrowingSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40541 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr getter"
)), 0))
) {
40542 return false;
40543 }
40544 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40544; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40545 args.rval().setBoolean(result);
40546 return true;
40547}
40548
40549MOZ_CAN_RUN_SCRIPT static bool
40550set_throwingSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40551{
40552 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40555( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40553 "TestJSImplInterface", "throwingSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40555( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40554 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40555( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40555 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40555( cx, "TestJSImplInterface"
, "throwingSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40556
40557 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40558 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40559 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40560 if (objIsXray) {
40561 unwrappedObj.emplace(cx, obj);
40562 }
40563 bool arg0;
40564 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40565 return false;
40566 }
40567 if (objIsXray) {
40568 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40569 // we know Xrays have no dynamic unwrap behavior.
40570 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40571 if (!unwrappedObj.ref()) {
40572 return false;
40573 }
40574 }
40575 FastErrorResult rv;
40576 // NOTE: This assert does NOT call the function.
40577 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetThrowingSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40578 MOZ_KnownLive(self)(self)->SetThrowingSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40579 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.throwingSetterAttr setter"
)), 0))
) {
40580 return false;
40581 }
40582 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40582; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40583
40584 return true;
40585}
40586
40587static const JSJitInfo throwingSetterAttr_getterinfo = {
40588 { get_throwingSetterAttr },
40589 { prototypes::id::TestJSImplInterface },
40590 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40591 JSJitInfo::Getter,
40592 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40593 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40594 false, /* isInfallible. False in setters. */
40595 false, /* isMovable. Not relevant for setters. */
40596 false, /* isEliminatable. Not relevant for setters. */
40597 false, /* isAlwaysInSlot. Only relevant for getters. */
40598 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40599 false, /* isTypedMethod. Only relevant for methods. */
40600 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40601};
40602static const JSJitInfo throwingSetterAttr_setterinfo = {
40603 { (JSJitGetterOp)set_throwingSetterAttr },
40604 { prototypes::id::TestJSImplInterface },
40605 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40606 JSJitInfo::Setter,
40607 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40608 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40609 false, /* isInfallible. False in setters. */
40610 false, /* isMovable. Not relevant for setters. */
40611 false, /* isEliminatable. Not relevant for setters. */
40612 false, /* isAlwaysInSlot. Only relevant for getters. */
40613 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40614 false, /* isTypedMethod. Only relevant for methods. */
40615 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40616};
40617
40618MOZ_CAN_RUN_SCRIPT static bool
40619canOOMMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40620{
40621 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40624( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40622 "TestJSImplInterface", "canOOMMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40624( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40623 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40624( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40624 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40624( cx, "TestJSImplInterface"
, "canOOMMethod", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40625
40626 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40627 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40628 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40629 if (objIsXray) {
40630 unwrappedObj.emplace(cx, obj);
40631 }
40632 if (objIsXray) {
40633 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40634 // we know Xrays have no dynamic unwrap behavior.
40635 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40636 if (!unwrappedObj.ref()) {
40637 return false;
40638 }
40639 }
40640 FastErrorResult rv;
40641 // NOTE: This assert does NOT call the function.
40642 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->CanOOMMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40643 MOZ_KnownLive(self)(self)->CanOOMMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40644 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMMethod"
)), 0))
) {
40645 return false;
40646 }
40647 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40647); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40647; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40648 args.rval().setUndefined();
40649 return true;
40650}
40651
40652static const JSJitInfo canOOMMethod_methodinfo = {
40653 { (JSJitGetterOp)canOOMMethod },
40654 { prototypes::id::TestJSImplInterface },
40655 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40656 JSJitInfo::Method,
40657 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40658 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40659 false, /* isInfallible. False in setters. */
40660 false, /* isMovable. Not relevant for setters. */
40661 false, /* isEliminatable. Not relevant for setters. */
40662 false, /* isAlwaysInSlot. Only relevant for getters. */
40663 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40664 false, /* isTypedMethod. Only relevant for methods. */
40665 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40666};
40667
40668MOZ_CAN_RUN_SCRIPT static bool
40669get_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40670{
40671 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40674( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40672 "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40674( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40673 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40674( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40674 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40674( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40675
40676 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40677 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40678 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40679 if (objIsXray) {
40680 unwrappedObj.emplace(cx, obj);
40681 }
40682 if (objIsXray) {
40683 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40684 // we know Xrays have no dynamic unwrap behavior.
40685 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40686 if (!unwrappedObj.ref()) {
40687 return false;
40688 }
40689 }
40690 FastErrorResult rv;
40691 bool result(MOZ_KnownLive(self)(self)->GetCanOOMAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40692 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr getter"
)), 0))
) {
40693 return false;
40694 }
40695 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40695); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40695; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40696 args.rval().setBoolean(result);
40697 return true;
40698}
40699
40700MOZ_CAN_RUN_SCRIPT static bool
40701set_canOOMAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40702{
40703 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40706( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40704 "TestJSImplInterface", "canOOMAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40706( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40705 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40706( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40706 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40706( cx, "TestJSImplInterface"
, "canOOMAttr", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40707
40708 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40709 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40710 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40711 if (objIsXray) {
40712 unwrappedObj.emplace(cx, obj);
40713 }
40714 bool arg0;
40715 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40716 return false;
40717 }
40718 if (objIsXray) {
40719 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40720 // we know Xrays have no dynamic unwrap behavior.
40721 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40722 if (!unwrappedObj.ref()) {
40723 return false;
40724 }
40725 }
40726 FastErrorResult rv;
40727 // NOTE: This assert does NOT call the function.
40728 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetCanOOMAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40729 MOZ_KnownLive(self)(self)->SetCanOOMAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40730 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMAttr setter"
)), 0))
) {
40731 return false;
40732 }
40733 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40733); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40733; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40734
40735 return true;
40736}
40737
40738static const JSJitInfo canOOMAttr_getterinfo = {
40739 { get_canOOMAttr },
40740 { prototypes::id::TestJSImplInterface },
40741 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40742 JSJitInfo::Getter,
40743 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40744 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40745 false, /* isInfallible. False in setters. */
40746 false, /* isMovable. Not relevant for setters. */
40747 false, /* isEliminatable. Not relevant for setters. */
40748 false, /* isAlwaysInSlot. Only relevant for getters. */
40749 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40750 false, /* isTypedMethod. Only relevant for methods. */
40751 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40752};
40753static const JSJitInfo canOOMAttr_setterinfo = {
40754 { (JSJitGetterOp)set_canOOMAttr },
40755 { prototypes::id::TestJSImplInterface },
40756 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40757 JSJitInfo::Setter,
40758 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40759 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40760 false, /* isInfallible. False in setters. */
40761 false, /* isMovable. Not relevant for setters. */
40762 false, /* isEliminatable. Not relevant for setters. */
40763 false, /* isAlwaysInSlot. Only relevant for getters. */
40764 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40765 false, /* isTypedMethod. Only relevant for methods. */
40766 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40767};
40768
40769MOZ_CAN_RUN_SCRIPT static bool
40770get_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40771{
40772 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40775( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40773 "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40775( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40774 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40775( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40775 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40775( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40776
40777 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40778 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40779 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40780 if (objIsXray) {
40781 unwrappedObj.emplace(cx, obj);
40782 }
40783 if (objIsXray) {
40784 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40785 // we know Xrays have no dynamic unwrap behavior.
40786 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40787 if (!unwrappedObj.ref()) {
40788 return false;
40789 }
40790 }
40791 FastErrorResult rv;
40792 bool result(MOZ_KnownLive(self)(self)->GetCanOOMGetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40793 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr getter"
)), 0))
) {
40794 return false;
40795 }
40796 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40796); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40796; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40797 args.rval().setBoolean(result);
40798 return true;
40799}
40800
40801MOZ_CAN_RUN_SCRIPT static bool
40802set_canOOMGetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40803{
40804 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40807( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40805 "TestJSImplInterface", "canOOMGetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40807( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40806 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40807( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40807 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40807( cx, "TestJSImplInterface"
, "canOOMGetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40808
40809 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40810 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40811 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40812 if (objIsXray) {
40813 unwrappedObj.emplace(cx, obj);
40814 }
40815 bool arg0;
40816 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40817 return false;
40818 }
40819 if (objIsXray) {
40820 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40821 // we know Xrays have no dynamic unwrap behavior.
40822 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40823 if (!unwrappedObj.ref()) {
40824 return false;
40825 }
40826 }
40827 FastErrorResult rv;
40828 // NOTE: This assert does NOT call the function.
40829 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetCanOOMGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40830 MOZ_KnownLive(self)(self)->SetCanOOMGetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40831 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMGetterAttr setter"
)), 0))
) {
40832 return false;
40833 }
40834 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40834; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40835
40836 return true;
40837}
40838
40839static const JSJitInfo canOOMGetterAttr_getterinfo = {
40840 { get_canOOMGetterAttr },
40841 { prototypes::id::TestJSImplInterface },
40842 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40843 JSJitInfo::Getter,
40844 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40845 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40846 false, /* isInfallible. False in setters. */
40847 false, /* isMovable. Not relevant for setters. */
40848 false, /* isEliminatable. Not relevant for setters. */
40849 false, /* isAlwaysInSlot. Only relevant for getters. */
40850 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40851 false, /* isTypedMethod. Only relevant for methods. */
40852 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40853};
40854static const JSJitInfo canOOMGetterAttr_setterinfo = {
40855 { (JSJitGetterOp)set_canOOMGetterAttr },
40856 { prototypes::id::TestJSImplInterface },
40857 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40858 JSJitInfo::Setter,
40859 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40860 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40861 false, /* isInfallible. False in setters. */
40862 false, /* isMovable. Not relevant for setters. */
40863 false, /* isEliminatable. Not relevant for setters. */
40864 false, /* isAlwaysInSlot. Only relevant for getters. */
40865 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40866 false, /* isTypedMethod. Only relevant for methods. */
40867 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40868};
40869
40870MOZ_CAN_RUN_SCRIPT static bool
40871get_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
40872{
40873 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40876( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40874 "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40876( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40875 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject40876( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40876 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40876( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40877
40878 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40879 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40880 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40881 if (objIsXray) {
40882 unwrappedObj.emplace(cx, obj);
40883 }
40884 if (objIsXray) {
40885 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40886 // we know Xrays have no dynamic unwrap behavior.
40887 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40888 if (!unwrappedObj.ref()) {
40889 return false;
40890 }
40891 }
40892 FastErrorResult rv;
40893 bool result(MOZ_KnownLive(self)(self)->GetCanOOMSetterAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
40894 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr getter"
)), 0))
) {
40895 return false;
40896 }
40897 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40897); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40897; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40898 args.rval().setBoolean(result);
40899 return true;
40900}
40901
40902MOZ_CAN_RUN_SCRIPT static bool
40903set_canOOMSetterAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
40904{
40905 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40908( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40906 "TestJSImplInterface", "canOOMSetterAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40908( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40907 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject40908( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40908 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40908( cx, "TestJSImplInterface"
, "canOOMSetterAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40909
40910 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40911 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40912 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40913 if (objIsXray) {
40914 unwrappedObj.emplace(cx, obj);
40915 }
40916 bool arg0;
40917 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
40918 return false;
40919 }
40920 if (objIsXray) {
40921 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40922 // we know Xrays have no dynamic unwrap behavior.
40923 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40924 if (!unwrappedObj.ref()) {
40925 return false;
40926 }
40927 }
40928 FastErrorResult rv;
40929 // NOTE: This assert does NOT call the function.
40930 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetCanOOMSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
40931 MOZ_KnownLive(self)(self)->SetCanOOMSetterAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
40932 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.canOOMSetterAttr setter"
)), 0))
) {
40933 return false;
40934 }
40935 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 40935); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 40935; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
40936
40937 return true;
40938}
40939
40940static const JSJitInfo canOOMSetterAttr_getterinfo = {
40941 { get_canOOMSetterAttr },
40942 { prototypes::id::TestJSImplInterface },
40943 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40944 JSJitInfo::Getter,
40945 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40946 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
40947 false, /* isInfallible. False in setters. */
40948 false, /* isMovable. Not relevant for setters. */
40949 false, /* isEliminatable. Not relevant for setters. */
40950 false, /* isAlwaysInSlot. Only relevant for getters. */
40951 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40952 false, /* isTypedMethod. Only relevant for methods. */
40953 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40954};
40955static const JSJitInfo canOOMSetterAttr_setterinfo = {
40956 { (JSJitGetterOp)set_canOOMSetterAttr },
40957 { prototypes::id::TestJSImplInterface },
40958 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
40959 JSJitInfo::Setter,
40960 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
40961 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
40962 false, /* isInfallible. False in setters. */
40963 false, /* isMovable. Not relevant for setters. */
40964 false, /* isEliminatable. Not relevant for setters. */
40965 false, /* isAlwaysInSlot. Only relevant for getters. */
40966 false, /* isLazilyCachedInSlot. Only relevant for getters. */
40967 false, /* isTypedMethod. Only relevant for methods. */
40968 0 /* Reserved slot index, if we're stored in a slot, else 0. */
40969};
40970
40971MOZ_CAN_RUN_SCRIPT static bool
40972ceReactionsMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
40973{
40974 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject40977( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40975 "TestJSImplInterface", "ceReactionsMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject40977( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40976 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject40977( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
40977 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject40977( cx, "TestJSImplInterface"
, "ceReactionsMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
40978
40979 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
40980 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
40981 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
40982 if (objIsXray) {
40983 unwrappedObj.emplace(cx, obj);
40984 }
40985 if (objIsXray) {
40986 // Since our object is an Xray, we can just CheckedUnwrapStatic:
40987 // we know Xrays have no dynamic unwrap behavior.
40988 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
40989 if (!unwrappedObj.ref()) {
40990 return false;
40991 }
40992 }
40993 Maybe<AutoCEReaction> ceReaction;
40994 DocGroup* docGroup = self->GetDocGroup();
40995 if (docGroup) {
40996 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
40997 }
40998 FastErrorResult rv;
40999 // NOTE: This assert does NOT call the function.
41000 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->CeReactionsMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41001 MOZ_KnownLive(self)(self)->CeReactionsMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41002 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethod"
)), 0))
) {
41003 return false;
41004 }
41005 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41005; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41006 args.rval().setUndefined();
41007 return true;
41008}
41009
41010static const JSJitInfo ceReactionsMethod_methodinfo = {
41011 { (JSJitGetterOp)ceReactionsMethod },
41012 { prototypes::id::TestJSImplInterface },
41013 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41014 JSJitInfo::Method,
41015 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41016 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41017 false, /* isInfallible. False in setters. */
41018 false, /* isMovable. Not relevant for setters. */
41019 false, /* isEliminatable. Not relevant for setters. */
41020 false, /* isAlwaysInSlot. Only relevant for getters. */
41021 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41022 false, /* isTypedMethod. Only relevant for methods. */
41023 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41024};
41025
41026MOZ_CAN_RUN_SCRIPT static bool
41027ceReactionsMethodOverload(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41028{
41029 BindingCallContext cx(cx_, "TestJSImplInterface.ceReactionsMethodOverload");
41030 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41033( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41031 "TestJSImplInterface", "ceReactionsMethodOverload", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41033( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41032 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41033( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41033 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41033( cx, "TestJSImplInterface"
, "ceReactionsMethodOverload", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
41034
41035 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41036 unsigned argcount = std::min(args.length(), 1u);
41037 switch (argcount) {
41038 case 0: {
41039 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41040 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41041 if (objIsXray) {
41042 unwrappedObj.emplace(cx, obj);
41043 }
41044 if (objIsXray) {
41045 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41046 // we know Xrays have no dynamic unwrap behavior.
41047 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41048 if (!unwrappedObj.ref()) {
41049 return false;
41050 }
41051 }
41052 Maybe<AutoCEReaction> ceReaction;
41053 DocGroup* docGroup = self->GetDocGroup();
41054 if (docGroup) {
41055 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41056 }
41057 FastErrorResult rv;
41058 // NOTE: This assert does NOT call the function.
41059 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41060 MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41061 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"
)), 0))
) {
41062 return false;
41063 }
41064 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41064; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41065 args.rval().setUndefined();
41066 return true;
41067 break;
41068 }
41069 case 1: {
41070 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41071 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41072 if (objIsXray) {
41073 unwrappedObj.emplace(cx, obj);
41074 }
41075 binding_detail::FakeString<char16_t> arg0;
41076 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
41077 return false;
41078 }
41079 if (objIsXray) {
41080 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41081 // we know Xrays have no dynamic unwrap behavior.
41082 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41083 if (!unwrappedObj.ref()) {
41084 return false;
41085 }
41086 }
41087 Maybe<AutoCEReaction> ceReaction;
41088 DocGroup* docGroup = self->GetDocGroup();
41089 if (docGroup) {
41090 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41091 }
41092 FastErrorResult rv;
41093 // NOTE: This assert does NOT call the function.
41094 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41095 MOZ_KnownLive(self)(self)->CeReactionsMethodOverload(NonNullHelper(Constify(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41096 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsMethodOverload"
)), 0))
) {
41097 return false;
41098 }
41099 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41099; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41100 args.rval().setUndefined();
41101 return true;
41102 break;
41103 }
41104 default: {
41105 // Using nsPrintfCString here would require including that
41106 // header. Let's not worry about it.
41107 nsAutoCString argCountStr;
41108 argCountStr.AppendPrintf("%u", args.length());
41109 return cx.ThrowErrorMessage<MSG_INVALID_OVERLOAD_ARGCOUNT>(argCountStr.get());
41110 }
41111 }
41112 MOZ_CRASH("We have an always-returning default case")do { do { } while (false); MOZ_ReportCrash("" "We have an always-returning default case"
, "../TestJSImplGenBinding.cpp", 41112); AnnotateMozCrashReason
("MOZ_CRASH(" "We have an always-returning default case" ")")
; do { *((volatile int*)__null) = 41112; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
41113 return false;
41114}
41115
41116static const JSJitInfo ceReactionsMethodOverload_methodinfo = {
41117 { (JSJitGetterOp)ceReactionsMethodOverload },
41118 { prototypes::id::TestJSImplInterface },
41119 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41120 JSJitInfo::Method,
41121 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41122 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41123 false, /* isInfallible. False in setters. */
41124 false, /* isMovable. Not relevant for setters. */
41125 false, /* isEliminatable. Not relevant for setters. */
41126 false, /* isAlwaysInSlot. Only relevant for getters. */
41127 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41128 false, /* isTypedMethod. Only relevant for methods. */
41129 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41130};
41131
41132MOZ_CAN_RUN_SCRIPT static bool
41133get_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41134{
41135 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41138( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41136 "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41138( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41137 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41138( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41138 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41138( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41139
41140 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41141 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41142 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41143 if (objIsXray) {
41144 unwrappedObj.emplace(cx, obj);
41145 }
41146 if (objIsXray) {
41147 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41148 // we know Xrays have no dynamic unwrap behavior.
41149 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41150 if (!unwrappedObj.ref()) {
41151 return false;
41152 }
41153 }
41154 FastErrorResult rv;
41155 bool result(MOZ_KnownLive(self)(self)->GetCeReactionsAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41156 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr getter"
)), 0))
) {
41157 return false;
41158 }
41159 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41159); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41159; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41160 args.rval().setBoolean(result);
41161 return true;
41162}
41163
41164MOZ_CAN_RUN_SCRIPT static bool
41165set_ceReactionsAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41166{
41167 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41170( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41168 "TestJSImplInterface", "ceReactionsAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41170( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41169 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41170( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41170 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41170( cx, "TestJSImplInterface"
, "ceReactionsAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41171
41172 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41173 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41174 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41175 if (objIsXray) {
41176 unwrappedObj.emplace(cx, obj);
41177 }
41178 bool arg0;
41179 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41180 return false;
41181 }
41182 if (objIsXray) {
41183 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41184 // we know Xrays have no dynamic unwrap behavior.
41185 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41186 if (!unwrappedObj.ref()) {
41187 return false;
41188 }
41189 }
41190 Maybe<AutoCEReaction> ceReaction;
41191 DocGroup* docGroup = self->GetDocGroup();
41192 if (docGroup) {
41193 ceReaction.emplace(docGroup->CustomElementReactionsStack(), cx);
41194 }
41195 FastErrorResult rv;
41196 // NOTE: This assert does NOT call the function.
41197 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetCeReactionsAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41198 MOZ_KnownLive(self)(self)->SetCeReactionsAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41199 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.ceReactionsAttr setter"
)), 0))
) {
41200 return false;
41201 }
41202 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41202); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41202; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41203
41204 return true;
41205}
41206
41207static const JSJitInfo ceReactionsAttr_getterinfo = {
41208 { get_ceReactionsAttr },
41209 { prototypes::id::TestJSImplInterface },
41210 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41211 JSJitInfo::Getter,
41212 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41213 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
41214 false, /* isInfallible. False in setters. */
41215 false, /* isMovable. Not relevant for setters. */
41216 false, /* isEliminatable. Not relevant for setters. */
41217 false, /* isAlwaysInSlot. Only relevant for getters. */
41218 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41219 false, /* isTypedMethod. Only relevant for methods. */
41220 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41221};
41222static const JSJitInfo ceReactionsAttr_setterinfo = {
41223 { (JSJitGetterOp)set_ceReactionsAttr },
41224 { prototypes::id::TestJSImplInterface },
41225 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41226 JSJitInfo::Setter,
41227 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41228 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41229 false, /* isInfallible. False in setters. */
41230 false, /* isMovable. Not relevant for setters. */
41231 false, /* isEliminatable. Not relevant for setters. */
41232 false, /* isAlwaysInSlot. Only relevant for getters. */
41233 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41234 false, /* isTypedMethod. Only relevant for methods. */
41235 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41236};
41237
41238MOZ_CAN_RUN_SCRIPT static bool
41239passArgsWithDefaults(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41240{
41241 BindingCallContext cx(cx_, "TestJSImplInterface.passArgsWithDefaults");
41242 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41245( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41243 "TestJSImplInterface", "passArgsWithDefaults", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41245( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41244 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41245( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41245 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41245( cx, "TestJSImplInterface"
, "passArgsWithDefaults", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41246
41247 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41248 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41249 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41250 if (objIsXray) {
41251 unwrappedObj.emplace(cx, obj);
41252 }
41253 Optional<int32_t> arg0;
41254 if (args.hasDefined(0)) {
41255 arg0.Construct();
41256 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[0], "Argument 1", &arg0.Value())) {
41257 return false;
41258 }
41259 }
41260 mozilla::dom::TestInterface* arg1;
41261 if (args.hasDefined(1)) {
41262 if (args[1].isObject()) {
41263 {
41264 // Our JSContext should be in the right global to do unwrapping in.
41265 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[1], arg1, cx);
41266 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
41267 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 2", "TestInterface");
41268 return false;
41269 }
41270 }
41271 } else if (args[1].isNullOrUndefined()) {
41272 arg1 = nullptr;
41273 } else {
41274 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
41275 return false;
41276 }
41277 } else {
41278 arg1 = nullptr;
41279 }
41280 RootedDictionary<binding_detail::FastDict> arg2(cx);
41281 if (!arg2.Init(cx, (args.hasDefined(2)) ? args[2] : JS::NullHandleValue, "Argument 3", true)) {
41282 return false;
41283 }
41284 double arg3;
41285 if (args.hasDefined(3)) {
41286 if (!ValueToPrimitive<double, eDefault>(cx, args[3], "Argument 4", &arg3)) {
41287 return false;
41288 } else if (!std::isfinite(arg3)) {
41289 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 4");
41290 return false;
41291 }
41292 } else {
41293 arg3 = 5.0;
41294 }
41295 Optional<float> arg4;
41296 if (args.hasDefined(4)) {
41297 arg4.Construct();
41298 if (!ValueToPrimitive<float, eDefault>(cx, args[4], "Argument 5", &arg4.Value())) {
41299 return false;
41300 } else if (!std::isfinite(arg4.Value())) {
41301 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Argument 5");
41302 return false;
41303 }
41304 }
41305 if (objIsXray) {
41306 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41307 // we know Xrays have no dynamic unwrap behavior.
41308 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41309 if (!unwrappedObj.ref()) {
41310 return false;
41311 }
41312 }
41313 FastErrorResult rv;
41314 // NOTE: This assert does NOT call the function.
41315 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassArgsWithDefaults(Constify(arg0), MOZ_KnownLive(Constify(arg1))(Constify(arg1)), Constify(arg2), arg3, Constify(arg4), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41316 MOZ_KnownLive(self)(self)->PassArgsWithDefaults(Constify(arg0), MOZ_KnownLive(Constify(arg1))(Constify(arg1)), Constify(arg2), arg3, Constify(arg4), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41317 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passArgsWithDefaults"
)), 0))
) {
41318 return false;
41319 }
41320 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41320); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41320; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41321 args.rval().setUndefined();
41322 return true;
41323}
41324
41325static const JSJitInfo passArgsWithDefaults_methodinfo = {
41326 { (JSJitGetterOp)passArgsWithDefaults },
41327 { prototypes::id::TestJSImplInterface },
41328 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41329 JSJitInfo::Method,
41330 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41331 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41332 false, /* isInfallible. False in setters. */
41333 false, /* isMovable. Not relevant for setters. */
41334 false, /* isEliminatable. Not relevant for setters. */
41335 false, /* isAlwaysInSlot. Only relevant for getters. */
41336 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41337 false, /* isTypedMethod. Only relevant for methods. */
41338 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41339};
41340
41341MOZ_CAN_RUN_SCRIPT static bool
41342get_toJSONShouldSkipThis(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41343{
41344 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41347( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41345 "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41347( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41346 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41347( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41347 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41347( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41348
41349 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41350 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41351 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41352 if (objIsXray) {
41353 unwrappedObj.emplace(cx, obj);
41354 }
41355 if (objIsXray) {
41356 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41357 // we know Xrays have no dynamic unwrap behavior.
41358 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41359 if (!unwrappedObj.ref()) {
41360 return false;
41361 }
41362 }
41363 FastErrorResult rv;
41364 JS::Rooted<JS::Value> result(cx);
41365 // NOTE: This assert does NOT call the function.
41366 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41367 MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41368 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis getter"
)), 0))
) {
41369 return false;
41370 }
41371 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41371); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41371; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41372 JS::ExposeValueToActiveJS(result);
41373 args.rval().set(result);
41374 if (!MaybeWrapValue(cx, args.rval())) {
41375 return false;
41376 }
41377 return true;
41378}
41379
41380MOZ_CAN_RUN_SCRIPT static bool
41381set_toJSONShouldSkipThis(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41382{
41383 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis setter");
41384 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41387( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41385 "TestJSImplInterface", "toJSONShouldSkipThis", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41387( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41386 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41387( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41387 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41387( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41388
41389 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41390 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41391 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41392 if (objIsXray) {
41393 unwrappedObj.emplace(cx, obj);
41394 }
41395 JS::Rooted<JS::Value> arg0(cx);
41396#ifdef __clang__1
41397#pragma clang diagnostic push
41398#pragma clang diagnostic ignored "-Wunreachable-code"
41399#pragma clang diagnostic ignored "-Wunreachable-code-return"
41400#endif // __clang__
41401 if ((true) && !CallerSubsumes(args[0])) {
41402 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value being assigned");
41403 return false;
41404 }
41405#ifdef __clang__1
41406#pragma clang diagnostic pop
41407#endif // __clang__
41408 arg0 = args[0];
41409 if (objIsXray) {
41410 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41411 // we know Xrays have no dynamic unwrap behavior.
41412 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41413 if (!unwrappedObj.ref()) {
41414 return false;
41415 }
41416 }
41417 FastErrorResult rv;
41418 // NOTE: This assert does NOT call the function.
41419 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41420 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41421 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis setter"
)), 0))
) {
41422 return false;
41423 }
41424 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41424); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41424; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41425
41426 return true;
41427}
41428
41429static const JSJitInfo toJSONShouldSkipThis_getterinfo = {
41430 { get_toJSONShouldSkipThis },
41431 { prototypes::id::TestJSImplInterface },
41432 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41433 JSJitInfo::Getter,
41434 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41435 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
41436 false, /* isInfallible. False in setters. */
41437 false, /* isMovable. Not relevant for setters. */
41438 false, /* isEliminatable. Not relevant for setters. */
41439 false, /* isAlwaysInSlot. Only relevant for getters. */
41440 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41441 false, /* isTypedMethod. Only relevant for methods. */
41442 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41443};
41444static const JSJitInfo toJSONShouldSkipThis_setterinfo = {
41445 { (JSJitGetterOp)set_toJSONShouldSkipThis },
41446 { prototypes::id::TestJSImplInterface },
41447 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41448 JSJitInfo::Setter,
41449 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41450 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41451 false, /* isInfallible. False in setters. */
41452 false, /* isMovable. Not relevant for setters. */
41453 false, /* isEliminatable. Not relevant for setters. */
41454 false, /* isAlwaysInSlot. Only relevant for getters. */
41455 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41456 false, /* isTypedMethod. Only relevant for methods. */
41457 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41458};
41459
41460MOZ_CAN_RUN_SCRIPT static bool
41461get_toJSONShouldSkipThis2(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41462{
41463 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41466( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41464 "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41466( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41465 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41466( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41466 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41466( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41467
41468 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41469 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41470 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41471 if (objIsXray) {
41472 unwrappedObj.emplace(cx, obj);
41473 }
41474 if (objIsXray) {
41475 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41476 // we know Xrays have no dynamic unwrap behavior.
41477 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41478 if (!unwrappedObj.ref()) {
41479 return false;
41480 }
41481 }
41482 FastErrorResult rv;
41483 auto result(StrongOrRawPtr<mozilla::dom::TestParentInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis2(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
41484 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 getter"
)), 0))
) {
41485 return false;
41486 }
41487 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41487); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41487; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41488 if (!GetOrCreateDOMReflector(cx, result, args.rval())) {
41489 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41489); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 41489; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
41490 return false;
41491 }
41492 return true;
41493}
41494
41495MOZ_CAN_RUN_SCRIPT static bool
41496set_toJSONShouldSkipThis2(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41497{
41498 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis2 setter");
41499 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41502( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41500 "TestJSImplInterface", "toJSONShouldSkipThis2", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41502( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41501 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41502( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41502 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41502( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis2", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41503
41504 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41505 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41506 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41507 if (objIsXray) {
41508 unwrappedObj.emplace(cx, obj);
41509 }
41510 NonNull<mozilla::dom::TestParentInterface> arg0;
41511 if (args[0].isObject()) {
41512 {
41513 // Our JSContext should be in the right global to do unwrapping in.
41514 nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(args[0], arg0, cx);
41515 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
41516 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "TestParentInterface");
41517 return false;
41518 }
41519 }
41520 } else {
41521 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
41522 return false;
41523 }
41524 if (objIsXray) {
41525 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41526 // we know Xrays have no dynamic unwrap behavior.
41527 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41528 if (!unwrappedObj.ref()) {
41529 return false;
41530 }
41531 }
41532 FastErrorResult rv;
41533 // NOTE: This assert does NOT call the function.
41534 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41535 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis2(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41536 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis2 setter"
)), 0))
) {
41537 return false;
41538 }
41539 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41539); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41539; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41540
41541 return true;
41542}
41543
41544static const JSJitInfo toJSONShouldSkipThis2_getterinfo = {
41545 { get_toJSONShouldSkipThis2 },
41546 { prototypes::id::TestJSImplInterface },
41547 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41548 JSJitInfo::Getter,
41549 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41550 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
41551 false, /* isInfallible. False in setters. */
41552 false, /* isMovable. Not relevant for setters. */
41553 false, /* isEliminatable. Not relevant for setters. */
41554 false, /* isAlwaysInSlot. Only relevant for getters. */
41555 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41556 false, /* isTypedMethod. Only relevant for methods. */
41557 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41558};
41559static const JSJitInfo toJSONShouldSkipThis2_setterinfo = {
41560 { (JSJitGetterOp)set_toJSONShouldSkipThis2 },
41561 { prototypes::id::TestJSImplInterface },
41562 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41563 JSJitInfo::Setter,
41564 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41565 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41566 false, /* isInfallible. False in setters. */
41567 false, /* isMovable. Not relevant for setters. */
41568 false, /* isEliminatable. Not relevant for setters. */
41569 false, /* isAlwaysInSlot. Only relevant for getters. */
41570 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41571 false, /* isTypedMethod. Only relevant for methods. */
41572 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41573};
41574
41575MOZ_CAN_RUN_SCRIPT static bool
41576get_toJSONShouldSkipThis3(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41577{
41578 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41581( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41579 "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41581( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41580 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41581( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41581 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41581( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41582
41583 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41584 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41585 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41586 if (objIsXray) {
41587 unwrappedObj.emplace(cx, obj);
41588 }
41589 if (objIsXray) {
41590 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41591 // we know Xrays have no dynamic unwrap behavior.
41592 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41593 if (!unwrappedObj.ref()) {
41594 return false;
41595 }
41596 }
41597 FastErrorResult rv;
41598 auto result(StrongOrRawPtr<mozilla::dom::TestCallbackInterface>(MOZ_KnownLive(self)(self)->GetToJSONShouldSkipThis3(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)))));
41599 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 getter"
)), 0))
) {
41600 return false;
41601 }
41602 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41602); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41602; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41603 args.rval().setObjectOrNull(GetCallbackFromCallbackObject(cx, result));
41604 if (!MaybeWrapObjectValue(cx, args.rval())) {
41605 return false;
41606 }
41607 return true;
41608}
41609
41610MOZ_CAN_RUN_SCRIPT static bool
41611set_toJSONShouldSkipThis3(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41612{
41613 BindingCallContext cx(cx_, "TestJSImplInterface.toJSONShouldSkipThis3 setter");
41614 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41617( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41615 "TestJSImplInterface", "toJSONShouldSkipThis3", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41617( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41616 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41617( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41617 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41617( cx, "TestJSImplInterface"
, "toJSONShouldSkipThis3", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41618
41619 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41620 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41621 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41622 if (objIsXray) {
41623 unwrappedObj.emplace(cx, obj);
41624 }
41625 RootedCallback<OwningNonNull<binding_detail::FastTestCallbackInterface>> arg0(cx);
41626 if (args[0].isObject()) {
41627 { // scope for tempRoot and tempGlobalRoot if needed
41628 arg0 = new binding_detail::FastTestCallbackInterface(&args[0].toObject(), JS::CurrentGlobalOrNull(cx));
41629 }
41630 } else {
41631 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
41632 return false;
41633 }
41634 if (objIsXray) {
41635 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41636 // we know Xrays have no dynamic unwrap behavior.
41637 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41638 if (!unwrappedObj.ref()) {
41639 return false;
41640 }
41641 }
41642 FastErrorResult rv;
41643 // NOTE: This assert does NOT call the function.
41644 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41645 MOZ_KnownLive(self)(self)->SetToJSONShouldSkipThis3(MOZ_KnownLive(NonNullHelper(arg0))(NonNullHelper(arg0)), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41646 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.toJSONShouldSkipThis3 setter"
)), 0))
) {
41647 return false;
41648 }
41649 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41649); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41649; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41650
41651 return true;
41652}
41653
41654static const JSJitInfo toJSONShouldSkipThis3_getterinfo = {
41655 { get_toJSONShouldSkipThis3 },
41656 { prototypes::id::TestJSImplInterface },
41657 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41658 JSJitInfo::Getter,
41659 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41660 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
41661 false, /* isInfallible. False in setters. */
41662 false, /* isMovable. Not relevant for setters. */
41663 false, /* isEliminatable. Not relevant for setters. */
41664 false, /* isAlwaysInSlot. Only relevant for getters. */
41665 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41666 false, /* isTypedMethod. Only relevant for methods. */
41667 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41668};
41669static const JSJitInfo toJSONShouldSkipThis3_setterinfo = {
41670 { (JSJitGetterOp)set_toJSONShouldSkipThis3 },
41671 { prototypes::id::TestJSImplInterface },
41672 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41673 JSJitInfo::Setter,
41674 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41675 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41676 false, /* isInfallible. False in setters. */
41677 false, /* isMovable. Not relevant for setters. */
41678 false, /* isEliminatable. Not relevant for setters. */
41679 false, /* isAlwaysInSlot. Only relevant for getters. */
41680 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41681 false, /* isTypedMethod. Only relevant for methods. */
41682 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41683};
41684
41685MOZ_CAN_RUN_SCRIPT static bool
41686get_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41687{
41688 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41691( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41689 "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41691( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41690 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41691( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41691 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41691( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41692
41693 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41694 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41695 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41696 if (objIsXray) {
41697 unwrappedObj.emplace(cx, obj);
41698 }
41699 if (objIsXray) {
41700 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41701 // we know Xrays have no dynamic unwrap behavior.
41702 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41703 if (!unwrappedObj.ref()) {
41704 return false;
41705 }
41706 }
41707 FastErrorResult rv;
41708 int8_t result(MOZ_KnownLive(self)(self)->GetDashed_attribute(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41709 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute getter"
)), 0))
) {
41710 return false;
41711 }
41712 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41712); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41712; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41713 args.rval().setInt32(int32_t(result));
41714 return true;
41715}
41716
41717MOZ_CAN_RUN_SCRIPT static bool
41718set_dashed_attribute(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41719{
41720 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41723( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41721 "TestJSImplInterface", "dashed-attribute", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41723( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41722 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41723( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41723 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41723( cx, "TestJSImplInterface"
, "dashed-attribute", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41724
41725 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41726 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41727 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41728 if (objIsXray) {
41729 unwrappedObj.emplace(cx, obj);
41730 }
41731 int8_t arg0;
41732 if (!ValueToPrimitive<int8_t, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41733 return false;
41734 }
41735 if (objIsXray) {
41736 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41737 // we know Xrays have no dynamic unwrap behavior.
41738 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41739 if (!unwrappedObj.ref()) {
41740 return false;
41741 }
41742 }
41743 FastErrorResult rv;
41744 // NOTE: This assert does NOT call the function.
41745 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetDashed_attribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41746 MOZ_KnownLive(self)(self)->SetDashed_attribute(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41747 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-attribute setter"
)), 0))
) {
41748 return false;
41749 }
41750 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41750); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41750; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41751
41752 return true;
41753}
41754
41755static const JSJitInfo dashed_attribute_getterinfo = {
41756 { get_dashed_attribute },
41757 { prototypes::id::TestJSImplInterface },
41758 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41759 JSJitInfo::Getter,
41760 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41761 JSVAL_TYPE_INT32, /* returnType. Not relevant for setters. */
41762 false, /* isInfallible. False in setters. */
41763 false, /* isMovable. Not relevant for setters. */
41764 false, /* isEliminatable. Not relevant for setters. */
41765 false, /* isAlwaysInSlot. Only relevant for getters. */
41766 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41767 false, /* isTypedMethod. Only relevant for methods. */
41768 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41769};
41770static const JSJitInfo dashed_attribute_setterinfo = {
41771 { (JSJitGetterOp)set_dashed_attribute },
41772 { prototypes::id::TestJSImplInterface },
41773 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41774 JSJitInfo::Setter,
41775 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41776 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41777 false, /* isInfallible. False in setters. */
41778 false, /* isMovable. Not relevant for setters. */
41779 false, /* isEliminatable. Not relevant for setters. */
41780 false, /* isAlwaysInSlot. Only relevant for getters. */
41781 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41782 false, /* isTypedMethod. Only relevant for methods. */
41783 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41784};
41785
41786MOZ_CAN_RUN_SCRIPT static bool
41787dashed_method(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41788{
41789 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41792( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41790 "TestJSImplInterface", "dashed-method", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41792( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41791 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41792( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41792 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41792( cx, "TestJSImplInterface"
, "dashed-method", JS::ProfilingCategoryPair::DOM, uint32_t(js
::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41793
41794 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41795 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41796 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41797 if (objIsXray) {
41798 unwrappedObj.emplace(cx, obj);
41799 }
41800 if (objIsXray) {
41801 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41802 // we know Xrays have no dynamic unwrap behavior.
41803 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41804 if (!unwrappedObj.ref()) {
41805 return false;
41806 }
41807 }
41808 FastErrorResult rv;
41809 // NOTE: This assert does NOT call the function.
41810 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->Dashed_method(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41811 MOZ_KnownLive(self)(self)->Dashed_method(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41812 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.dashed-method"
)), 0))
) {
41813 return false;
41814 }
41815 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41815; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41816 args.rval().setUndefined();
41817 return true;
41818}
41819
41820static const JSJitInfo dashed_method_methodinfo = {
41821 { (JSJitGetterOp)dashed_method },
41822 { prototypes::id::TestJSImplInterface },
41823 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41824 JSJitInfo::Method,
41825 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41826 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41827 false, /* isInfallible. False in setters. */
41828 false, /* isMovable. Not relevant for setters. */
41829 false, /* isEliminatable. Not relevant for setters. */
41830 false, /* isAlwaysInSlot. Only relevant for getters. */
41831 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41832 false, /* isTypedMethod. Only relevant for methods. */
41833 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41834};
41835
41836MOZ_CAN_RUN_SCRIPT static bool
41837get_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41838{
41839 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41842( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41840 "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41842( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41841 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41842( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41842 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41842( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41843
41844 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41845 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41846 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41847 if (objIsXray) {
41848 unwrappedObj.emplace(cx, obj);
41849 }
41850 if (objIsXray) {
41851 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41852 // we know Xrays have no dynamic unwrap behavior.
41853 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41854 if (!unwrappedObj.ref()) {
41855 return false;
41856 }
41857 }
41858 FastErrorResult rv;
41859 bool result(MOZ_KnownLive(self)(self)->GetNonEnumerableAttr(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))));
41860 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr getter"
)), 0))
) {
41861 return false;
41862 }
41863 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41863); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41863; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41864 args.rval().setBoolean(result);
41865 return true;
41866}
41867
41868MOZ_CAN_RUN_SCRIPT static bool
41869set_nonEnumerableAttr(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
41870{
41871 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41874( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41872 "TestJSImplInterface", "nonEnumerableAttr", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41874( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41873 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject41874( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41874 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41874( cx, "TestJSImplInterface"
, "nonEnumerableAttr", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41875
41876 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41877 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41878 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41879 if (objIsXray) {
41880 unwrappedObj.emplace(cx, obj);
41881 }
41882 bool arg0;
41883 if (!ValueToPrimitive<bool, eDefault>(cx, args[0], "Value being assigned", &arg0)) {
41884 return false;
41885 }
41886 if (objIsXray) {
41887 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41888 // we know Xrays have no dynamic unwrap behavior.
41889 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41890 if (!unwrappedObj.ref()) {
41891 return false;
41892 }
41893 }
41894 FastErrorResult rv;
41895 // NOTE: This assert does NOT call the function.
41896 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetNonEnumerableAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41897 MOZ_KnownLive(self)(self)->SetNonEnumerableAttr(arg0, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41898 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableAttr setter"
)), 0))
) {
41899 return false;
41900 }
41901 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41901); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41901; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41902
41903 return true;
41904}
41905
41906static const JSJitInfo nonEnumerableAttr_getterinfo = {
41907 { get_nonEnumerableAttr },
41908 { prototypes::id::TestJSImplInterface },
41909 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41910 JSJitInfo::Getter,
41911 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41912 JSVAL_TYPE_BOOLEAN, /* returnType. Not relevant for setters. */
41913 false, /* isInfallible. False in setters. */
41914 false, /* isMovable. Not relevant for setters. */
41915 false, /* isEliminatable. Not relevant for setters. */
41916 false, /* isAlwaysInSlot. Only relevant for getters. */
41917 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41918 false, /* isTypedMethod. Only relevant for methods. */
41919 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41920};
41921static const JSJitInfo nonEnumerableAttr_setterinfo = {
41922 { (JSJitGetterOp)set_nonEnumerableAttr },
41923 { prototypes::id::TestJSImplInterface },
41924 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41925 JSJitInfo::Setter,
41926 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41927 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41928 false, /* isInfallible. False in setters. */
41929 false, /* isMovable. Not relevant for setters. */
41930 false, /* isEliminatable. Not relevant for setters. */
41931 false, /* isAlwaysInSlot. Only relevant for getters. */
41932 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41933 false, /* isTypedMethod. Only relevant for methods. */
41934 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41935};
41936
41937MOZ_CAN_RUN_SCRIPT static bool
41938nonEnumerableMethod(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
41939{
41940 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41943( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41941 "TestJSImplInterface", "nonEnumerableMethod", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41943( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41942 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject41943( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
41943 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41943( cx, "TestJSImplInterface"
, "nonEnumerableMethod", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
41944
41945 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41946 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41947 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41948 if (objIsXray) {
41949 unwrappedObj.emplace(cx, obj);
41950 }
41951 if (objIsXray) {
41952 // Since our object is an Xray, we can just CheckedUnwrapStatic:
41953 // we know Xrays have no dynamic unwrap behavior.
41954 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
41955 if (!unwrappedObj.ref()) {
41956 return false;
41957 }
41958 }
41959 FastErrorResult rv;
41960 // NOTE: This assert does NOT call the function.
41961 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->NonEnumerableMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
41962 MOZ_KnownLive(self)(self)->NonEnumerableMethod(rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
41963 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.nonEnumerableMethod"
)), 0))
) {
41964 return false;
41965 }
41966 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 41966); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 41966; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
41967 args.rval().setUndefined();
41968 return true;
41969}
41970
41971static const JSJitInfo nonEnumerableMethod_methodinfo = {
41972 { (JSJitGetterOp)nonEnumerableMethod },
41973 { prototypes::id::TestJSImplInterface },
41974 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
41975 JSJitInfo::Method,
41976 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
41977 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
41978 false, /* isInfallible. False in setters. */
41979 false, /* isMovable. Not relevant for setters. */
41980 false, /* isEliminatable. Not relevant for setters. */
41981 false, /* isAlwaysInSlot. Only relevant for getters. */
41982 false, /* isLazilyCachedInSlot. Only relevant for getters. */
41983 false, /* isTypedMethod. Only relevant for methods. */
41984 0 /* Reserved slot index, if we're stored in a slot, else 0. */
41985};
41986
41987MOZ_CAN_RUN_SCRIPT static bool
41988get_allowSharedArrayBufferViewTypedef(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
41989{
41990 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject41993( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41991 "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject41993( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41992 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject41993( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
41993 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject41993( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
41994
41995 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
41996 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
41997 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
41998 if (objIsXray) {
41999 unwrappedObj.emplace(cx, obj);
42000 }
42001 if (objIsXray) {
42002 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42003 // we know Xrays have no dynamic unwrap behavior.
42004 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42005 if (!unwrappedObj.ref()) {
42006 return false;
42007 }
42008 }
42009 FastErrorResult rv;
42010 JS::Rooted<JSObject*> result(cx);
42011 // NOTE: This assert does NOT call the function.
42012 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferViewTypedef(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42013 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferViewTypedef(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42014 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef getter"
)), 0))
) {
42015 return false;
42016 }
42017 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42017); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42017; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42018 JS::ExposeObjectToActiveJS(result);
42019 args.rval().setObject(*result);
42020 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42021 return false;
42022 }
42023 return true;
42024}
42025
42026MOZ_CAN_RUN_SCRIPT static bool
42027set_allowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42028{
42029 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter");
42030 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42033( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42031 "TestJSImplInterface", "allowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42033( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42032 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42033( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42033 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42033( cx, "TestJSImplInterface"
, "allowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42034
42035 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42036 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42037 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42038 if (objIsXray) {
42039 unwrappedObj.emplace(cx, obj);
42040 }
42041 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42042 if (args[0].isObject()) {
42043 if (!arg0.Init(&args[0].toObject())) {
42044 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView");
42045 return false;
42046 }
42047 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42048 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42049 return false;
42050 }
42051 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42052 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42053 return false;
42054 }
42055 } else {
42056 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42057 return false;
42058 }
42059 if (objIsXray) {
42060 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42061 // we know Xrays have no dynamic unwrap behavior.
42062 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42063 if (!unwrappedObj.ref()) {
42064 return false;
42065 }
42066 }
42067 FastErrorResult rv;
42068 // NOTE: This assert does NOT call the function.
42069 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42070 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42071 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferViewTypedef setter"
)), 0))
) {
42072 return false;
42073 }
42074 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42074); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42074; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42075
42076 return true;
42077}
42078
42079static const JSJitInfo allowSharedArrayBufferViewTypedef_getterinfo = {
42080 { get_allowSharedArrayBufferViewTypedef },
42081 { prototypes::id::TestJSImplInterface },
42082 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42083 JSJitInfo::Getter,
42084 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42085 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42086 false, /* isInfallible. False in setters. */
42087 false, /* isMovable. Not relevant for setters. */
42088 false, /* isEliminatable. Not relevant for setters. */
42089 false, /* isAlwaysInSlot. Only relevant for getters. */
42090 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42091 false, /* isTypedMethod. Only relevant for methods. */
42092 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42093};
42094static const JSJitInfo allowSharedArrayBufferViewTypedef_setterinfo = {
42095 { (JSJitGetterOp)set_allowSharedArrayBufferViewTypedef },
42096 { prototypes::id::TestJSImplInterface },
42097 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42098 JSJitInfo::Setter,
42099 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42100 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42101 false, /* isInfallible. False in setters. */
42102 false, /* isMovable. Not relevant for setters. */
42103 false, /* isEliminatable. Not relevant for setters. */
42104 false, /* isAlwaysInSlot. Only relevant for getters. */
42105 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42106 false, /* isTypedMethod. Only relevant for methods. */
42107 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42108};
42109
42110MOZ_CAN_RUN_SCRIPT static bool
42111get_allowSharedArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42112{
42113 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42116( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42114 "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42116( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42115 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42116( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42116 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42116( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42117
42118 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42119 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42120 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42121 if (objIsXray) {
42122 unwrappedObj.emplace(cx, obj);
42123 }
42124 if (objIsXray) {
42125 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42126 // we know Xrays have no dynamic unwrap behavior.
42127 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42128 if (!unwrappedObj.ref()) {
42129 return false;
42130 }
42131 }
42132 FastErrorResult rv;
42133 JS::Rooted<JSObject*> result(cx);
42134 // NOTE: This assert does NOT call the function.
42135 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42136 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42137 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView getter"
)), 0))
) {
42138 return false;
42139 }
42140 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42140; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42141 JS::ExposeObjectToActiveJS(result);
42142 args.rval().setObject(*result);
42143 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42144 return false;
42145 }
42146 return true;
42147}
42148
42149MOZ_CAN_RUN_SCRIPT static bool
42150set_allowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42151{
42152 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBufferView setter");
42153 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42156( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42154 "TestJSImplInterface", "allowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42156( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42155 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42156( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42156 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42156( cx, "TestJSImplInterface"
, "allowSharedArrayBufferView", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42157
42158 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42159 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42160 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42161 if (objIsXray) {
42162 unwrappedObj.emplace(cx, obj);
42163 }
42164 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42165 if (args[0].isObject()) {
42166 if (!arg0.Init(&args[0].toObject())) {
42167 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferView");
42168 return false;
42169 }
42170 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42171 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42172 return false;
42173 }
42174 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42175 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42176 return false;
42177 }
42178 } else {
42179 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42180 return false;
42181 }
42182 if (objIsXray) {
42183 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42184 // we know Xrays have no dynamic unwrap behavior.
42185 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42186 if (!unwrappedObj.ref()) {
42187 return false;
42188 }
42189 }
42190 FastErrorResult rv;
42191 // NOTE: This assert does NOT call the function.
42192 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42193 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42194 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBufferView setter"
)), 0))
) {
42195 return false;
42196 }
42197 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42197); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42197; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42198
42199 return true;
42200}
42201
42202static const JSJitInfo allowSharedArrayBufferView_getterinfo = {
42203 { get_allowSharedArrayBufferView },
42204 { prototypes::id::TestJSImplInterface },
42205 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42206 JSJitInfo::Getter,
42207 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42208 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42209 false, /* isInfallible. False in setters. */
42210 false, /* isMovable. Not relevant for setters. */
42211 false, /* isEliminatable. Not relevant for setters. */
42212 false, /* isAlwaysInSlot. Only relevant for getters. */
42213 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42214 false, /* isTypedMethod. Only relevant for methods. */
42215 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42216};
42217static const JSJitInfo allowSharedArrayBufferView_setterinfo = {
42218 { (JSJitGetterOp)set_allowSharedArrayBufferView },
42219 { prototypes::id::TestJSImplInterface },
42220 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42221 JSJitInfo::Setter,
42222 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42223 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42224 false, /* isInfallible. False in setters. */
42225 false, /* isMovable. Not relevant for setters. */
42226 false, /* isEliminatable. Not relevant for setters. */
42227 false, /* isAlwaysInSlot. Only relevant for getters. */
42228 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42229 false, /* isTypedMethod. Only relevant for methods. */
42230 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42231};
42232
42233MOZ_CAN_RUN_SCRIPT static bool
42234get_allowSharedNullableArrayBufferView(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42235{
42236 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42239( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42237 "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42239( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42238 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42239( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42239 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42239( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42240
42241 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42242 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42243 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42244 if (objIsXray) {
42245 unwrappedObj.emplace(cx, obj);
42246 }
42247 if (objIsXray) {
42248 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42249 // we know Xrays have no dynamic unwrap behavior.
42250 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42251 if (!unwrappedObj.ref()) {
42252 return false;
42253 }
42254 }
42255 FastErrorResult rv;
42256 JS::Rooted<JSObject*> result(cx);
42257 // NOTE: This assert does NOT call the function.
42258 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42259 MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBufferView(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42260 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView getter"
)), 0))
) {
42261 return false;
42262 }
42263 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42263); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42263; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42264 if (result) {
42265 JS::ExposeObjectToActiveJS(result);
42266 }
42267 args.rval().setObjectOrNull(result);
42268 if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) {
42269 return false;
42270 }
42271 return true;
42272}
42273
42274MOZ_CAN_RUN_SCRIPT static bool
42275set_allowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42276{
42277 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBufferView setter");
42278 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42281( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42279 "TestJSImplInterface", "allowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42281( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42280 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42281( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42281 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42281( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42282
42283 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42284 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42285 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42286 if (objIsXray) {
42287 unwrappedObj.emplace(cx, obj);
42288 }
42289 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx);
42290 if (args[0].isObject()) {
42291 if (!arg0.SetValue().Init(&args[0].toObject())) {
42292 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferViewOrNull");
42293 return false;
42294 }
42295 if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) {
42296 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42297 return false;
42298 }
42299 if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) {
42300 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42301 return false;
42302 }
42303 } else if (args[0].isNullOrUndefined()) {
42304 arg0.SetNull();
42305 } else {
42306 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42307 return false;
42308 }
42309 if (objIsXray) {
42310 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42311 // we know Xrays have no dynamic unwrap behavior.
42312 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42313 if (!unwrappedObj.ref()) {
42314 return false;
42315 }
42316 }
42317 FastErrorResult rv;
42318 // NOTE: This assert does NOT call the function.
42319 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42320 MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42321 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBufferView setter"
)), 0))
) {
42322 return false;
42323 }
42324 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42324); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42324; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42325
42326 return true;
42327}
42328
42329static const JSJitInfo allowSharedNullableArrayBufferView_getterinfo = {
42330 { get_allowSharedNullableArrayBufferView },
42331 { prototypes::id::TestJSImplInterface },
42332 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42333 JSJitInfo::Getter,
42334 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42335 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
42336 false, /* isInfallible. False in setters. */
42337 false, /* isMovable. Not relevant for setters. */
42338 false, /* isEliminatable. Not relevant for setters. */
42339 false, /* isAlwaysInSlot. Only relevant for getters. */
42340 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42341 false, /* isTypedMethod. Only relevant for methods. */
42342 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42343};
42344static const JSJitInfo allowSharedNullableArrayBufferView_setterinfo = {
42345 { (JSJitGetterOp)set_allowSharedNullableArrayBufferView },
42346 { prototypes::id::TestJSImplInterface },
42347 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42348 JSJitInfo::Setter,
42349 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42350 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42351 false, /* isInfallible. False in setters. */
42352 false, /* isMovable. Not relevant for setters. */
42353 false, /* isEliminatable. Not relevant for setters. */
42354 false, /* isAlwaysInSlot. Only relevant for getters. */
42355 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42356 false, /* isTypedMethod. Only relevant for methods. */
42357 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42358};
42359
42360MOZ_CAN_RUN_SCRIPT static bool
42361get_allowSharedArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42362{
42363 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42366( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42364 "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42366( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42365 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42366( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42366 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42366( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42367
42368 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42369 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42370 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42371 if (objIsXray) {
42372 unwrappedObj.emplace(cx, obj);
42373 }
42374 if (objIsXray) {
42375 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42376 // we know Xrays have no dynamic unwrap behavior.
42377 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42378 if (!unwrappedObj.ref()) {
42379 return false;
42380 }
42381 }
42382 FastErrorResult rv;
42383 JS::Rooted<JSObject*> result(cx);
42384 // NOTE: This assert does NOT call the function.
42385 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetAllowSharedArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42386 MOZ_KnownLive(self)(self)->GetAllowSharedArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42387 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer getter"
)), 0))
) {
42388 return false;
42389 }
42390 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42390); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42390; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42391 JS::ExposeObjectToActiveJS(result);
42392 args.rval().setObject(*result);
42393 if (!MaybeWrapNonDOMObjectValue(cx, args.rval())) {
42394 return false;
42395 }
42396 return true;
42397}
42398
42399MOZ_CAN_RUN_SCRIPT static bool
42400set_allowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42401{
42402 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedArrayBuffer setter");
42403 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42406( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42404 "TestJSImplInterface", "allowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42406( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42405 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42406( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42406 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42406( cx, "TestJSImplInterface"
, "allowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42407
42408 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42409 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42410 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42411 if (objIsXray) {
42412 unwrappedObj.emplace(cx, obj);
42413 }
42414 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
42415 if (args[0].isObject()) {
42416 if (!arg0.Init(&args[0].toObject())) {
42417 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBuffer");
42418 return false;
42419 }
42420 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
42421 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42422 return false;
42423 }
42424 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
42425 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42426 return false;
42427 }
42428 } else {
42429 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42430 return false;
42431 }
42432 if (objIsXray) {
42433 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42434 // we know Xrays have no dynamic unwrap behavior.
42435 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42436 if (!unwrappedObj.ref()) {
42437 return false;
42438 }
42439 }
42440 FastErrorResult rv;
42441 // NOTE: This assert does NOT call the function.
42442 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42443 MOZ_KnownLive(self)(self)->SetAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42444 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedArrayBuffer setter"
)), 0))
) {
42445 return false;
42446 }
42447 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42447); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42447; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42448
42449 return true;
42450}
42451
42452static const JSJitInfo allowSharedArrayBuffer_getterinfo = {
42453 { get_allowSharedArrayBuffer },
42454 { prototypes::id::TestJSImplInterface },
42455 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42456 JSJitInfo::Getter,
42457 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42458 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
42459 false, /* isInfallible. False in setters. */
42460 false, /* isMovable. Not relevant for setters. */
42461 false, /* isEliminatable. Not relevant for setters. */
42462 false, /* isAlwaysInSlot. Only relevant for getters. */
42463 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42464 false, /* isTypedMethod. Only relevant for methods. */
42465 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42466};
42467static const JSJitInfo allowSharedArrayBuffer_setterinfo = {
42468 { (JSJitGetterOp)set_allowSharedArrayBuffer },
42469 { prototypes::id::TestJSImplInterface },
42470 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42471 JSJitInfo::Setter,
42472 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42473 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42474 false, /* isInfallible. False in setters. */
42475 false, /* isMovable. Not relevant for setters. */
42476 false, /* isEliminatable. Not relevant for setters. */
42477 false, /* isAlwaysInSlot. Only relevant for getters. */
42478 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42479 false, /* isTypedMethod. Only relevant for methods. */
42480 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42481};
42482
42483MOZ_CAN_RUN_SCRIPT static bool
42484get_allowSharedNullableArrayBuffer(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, JSJitGetterCallArgs args)
42485{
42486 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42489( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42487 "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42489( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42488 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER) |mozilla::AutoProfilerLabelHot raiiObject42489( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42489 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42489( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_GETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42490
42491 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42492 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42493 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42494 if (objIsXray) {
42495 unwrappedObj.emplace(cx, obj);
42496 }
42497 if (objIsXray) {
42498 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42499 // we know Xrays have no dynamic unwrap behavior.
42500 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42501 if (!unwrappedObj.ref()) {
42502 return false;
42503 }
42504 }
42505 FastErrorResult rv;
42506 JS::Rooted<JSObject*> result(cx);
42507 // NOTE: This assert does NOT call the function.
42508 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42509 MOZ_KnownLive(self)(self)->GetAllowSharedNullableArrayBuffer(&result, rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42510 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer getter"
)), 0))
) {
42511 return false;
42512 }
42513 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42513; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42514 if (result) {
42515 JS::ExposeObjectToActiveJS(result);
42516 }
42517 args.rval().setObjectOrNull(result);
42518 if (!MaybeWrapNonDOMObjectOrNullValue(cx, args.rval())) {
42519 return false;
42520 }
42521 return true;
42522}
42523
42524MOZ_CAN_RUN_SCRIPT static bool
42525set_allowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, JSJitSetterCallArgs args)
42526{
42527 BindingCallContext cx(cx_, "TestJSImplInterface.allowSharedNullableArrayBuffer setter");
42528 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42531( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42529 "TestJSImplInterface", "allowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42531( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42530 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER) |mozilla::AutoProfilerLabelHot raiiObject42531( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42531 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42531( cx, "TestJSImplInterface"
, "allowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_SETTER
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42532
42533 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42534 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42535 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42536 if (objIsXray) {
42537 unwrappedObj.emplace(cx, obj);
42538 }
42539 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
42540 if (args[0].isObject()) {
42541 if (!arg0.SetValue().Init(&args[0].toObject())) {
42542 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Value being assigned", "ArrayBufferOrNull");
42543 return false;
42544 }
42545 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42546 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Value being assigned");
42547 return false;
42548 }
42549 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42550 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Value being assigned");
42551 return false;
42552 }
42553 } else if (args[0].isNullOrUndefined()) {
42554 arg0.SetNull();
42555 } else {
42556 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Value being assigned");
42557 return false;
42558 }
42559 if (objIsXray) {
42560 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42561 // we know Xrays have no dynamic unwrap behavior.
42562 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42563 if (!unwrappedObj.ref()) {
42564 return false;
42565 }
42566 }
42567 FastErrorResult rv;
42568 // NOTE: This assert does NOT call the function.
42569 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42570 MOZ_KnownLive(self)(self)->SetAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42571 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.allowSharedNullableArrayBuffer setter"
)), 0))
) {
42572 return false;
42573 }
42574 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42574); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42574; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42575
42576 return true;
42577}
42578
42579static const JSJitInfo allowSharedNullableArrayBuffer_getterinfo = {
42580 { get_allowSharedNullableArrayBuffer },
42581 { prototypes::id::TestJSImplInterface },
42582 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42583 JSJitInfo::Getter,
42584 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42585 JSVAL_TYPE_UNKNOWN, /* returnType. Not relevant for setters. */
42586 false, /* isInfallible. False in setters. */
42587 false, /* isMovable. Not relevant for setters. */
42588 false, /* isEliminatable. Not relevant for setters. */
42589 false, /* isAlwaysInSlot. Only relevant for getters. */
42590 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42591 false, /* isTypedMethod. Only relevant for methods. */
42592 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42593};
42594static const JSJitInfo allowSharedNullableArrayBuffer_setterinfo = {
42595 { (JSJitGetterOp)set_allowSharedNullableArrayBuffer },
42596 { prototypes::id::TestJSImplInterface },
42597 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42598 JSJitInfo::Setter,
42599 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42600 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42601 false, /* isInfallible. False in setters. */
42602 false, /* isMovable. Not relevant for setters. */
42603 false, /* isEliminatable. Not relevant for setters. */
42604 false, /* isAlwaysInSlot. Only relevant for getters. */
42605 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42606 false, /* isTypedMethod. Only relevant for methods. */
42607 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42608};
42609
42610MOZ_CAN_RUN_SCRIPT static bool
42611passAllowSharedArrayBufferViewTypedef(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42612{
42613 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef");
42614 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42617( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42615 "TestJSImplInterface", "passAllowSharedArrayBufferViewTypedef", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42617( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42616 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42617( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42617 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42617( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferViewTypedef", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42618
42619 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42620 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", 1)) {
42621 return false;
42622 }
42623 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42624 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42625 if (objIsXray) {
42626 unwrappedObj.emplace(cx, obj);
42627 }
42628 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42629 if (args[0].isObject()) {
42630 if (!arg0.Init(&args[0].toObject())) {
42631 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
42632 return false;
42633 }
42634 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42635 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42636 return false;
42637 }
42638 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42639 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42640 return false;
42641 }
42642 } else {
42643 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42644 return false;
42645 }
42646 if (objIsXray) {
42647 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42648 // we know Xrays have no dynamic unwrap behavior.
42649 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42650 if (!unwrappedObj.ref()) {
42651 return false;
42652 }
42653 }
42654 FastErrorResult rv;
42655 // NOTE: This assert does NOT call the function.
42656 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42657 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferViewTypedef(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42658 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef"
)), 0))
) {
42659 return false;
42660 }
42661 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42661); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42661; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42662 args.rval().setUndefined();
42663 return true;
42664}
42665
42666static const JSJitInfo passAllowSharedArrayBufferViewTypedef_methodinfo = {
42667 { (JSJitGetterOp)passAllowSharedArrayBufferViewTypedef },
42668 { prototypes::id::TestJSImplInterface },
42669 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42670 JSJitInfo::Method,
42671 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42672 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42673 false, /* isInfallible. False in setters. */
42674 false, /* isMovable. Not relevant for setters. */
42675 false, /* isEliminatable. Not relevant for setters. */
42676 false, /* isAlwaysInSlot. Only relevant for getters. */
42677 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42678 false, /* isTypedMethod. Only relevant for methods. */
42679 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42680};
42681
42682MOZ_CAN_RUN_SCRIPT static bool
42683passAllowSharedArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42684{
42685 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBufferView");
42686 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42689( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42687 "TestJSImplInterface", "passAllowSharedArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42689( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42688 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42689( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42689 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42689( cx, "TestJSImplInterface"
, "passAllowSharedArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42690
42691 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42692 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBufferView", 1)) {
42693 return false;
42694 }
42695 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42696 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42697 if (objIsXray) {
42698 unwrappedObj.emplace(cx, obj);
42699 }
42700 RootedSpiderMonkeyInterface<ArrayBufferView> arg0(cx);
42701 if (args[0].isObject()) {
42702 if (!arg0.Init(&args[0].toObject())) {
42703 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferView");
42704 return false;
42705 }
42706 if (JS::IsLargeArrayBufferView(arg0.Obj())) {
42707 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42708 return false;
42709 }
42710 if (JS::IsResizableArrayBufferView(arg0.Obj())) {
42711 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42712 return false;
42713 }
42714 } else {
42715 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42716 return false;
42717 }
42718 if (objIsXray) {
42719 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42720 // we know Xrays have no dynamic unwrap behavior.
42721 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42722 if (!unwrappedObj.ref()) {
42723 return false;
42724 }
42725 }
42726 FastErrorResult rv;
42727 // NOTE: This assert does NOT call the function.
42728 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42729 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42730 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBufferView"
)), 0))
) {
42731 return false;
42732 }
42733 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42733); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42733; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42734 args.rval().setUndefined();
42735 return true;
42736}
42737
42738static const JSJitInfo passAllowSharedArrayBufferView_methodinfo = {
42739 { (JSJitGetterOp)passAllowSharedArrayBufferView },
42740 { prototypes::id::TestJSImplInterface },
42741 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42742 JSJitInfo::Method,
42743 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42744 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42745 false, /* isInfallible. False in setters. */
42746 false, /* isMovable. Not relevant for setters. */
42747 false, /* isEliminatable. Not relevant for setters. */
42748 false, /* isAlwaysInSlot. Only relevant for getters. */
42749 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42750 false, /* isTypedMethod. Only relevant for methods. */
42751 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42752};
42753
42754MOZ_CAN_RUN_SCRIPT static bool
42755passAllowSharedNullableArrayBufferView(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42756{
42757 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBufferView");
42758 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42761( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42759 "TestJSImplInterface", "passAllowSharedNullableArrayBufferView", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42761( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42760 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42761( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42761 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42761( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBufferView", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42762
42763 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42764 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", 1)) {
42765 return false;
42766 }
42767 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42768 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42769 if (objIsXray) {
42770 unwrappedObj.emplace(cx, obj);
42771 }
42772 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> arg0(cx);
42773 if (args[0].isObject()) {
42774 if (!arg0.SetValue().Init(&args[0].toObject())) {
42775 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferViewOrNull");
42776 return false;
42777 }
42778 if (JS::IsLargeArrayBufferView(arg0.SetValue().Obj())) {
42779 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42780 return false;
42781 }
42782 if (JS::IsResizableArrayBufferView(arg0.SetValue().Obj())) {
42783 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42784 return false;
42785 }
42786 } else if (args[0].isNullOrUndefined()) {
42787 arg0.SetNull();
42788 } else {
42789 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42790 return false;
42791 }
42792 if (objIsXray) {
42793 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42794 // we know Xrays have no dynamic unwrap behavior.
42795 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42796 if (!unwrappedObj.ref()) {
42797 return false;
42798 }
42799 }
42800 FastErrorResult rv;
42801 // NOTE: This assert does NOT call the function.
42802 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42803 MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBufferView(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42804 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBufferView"
)), 0))
) {
42805 return false;
42806 }
42807 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42807); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42807; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42808 args.rval().setUndefined();
42809 return true;
42810}
42811
42812static const JSJitInfo passAllowSharedNullableArrayBufferView_methodinfo = {
42813 { (JSJitGetterOp)passAllowSharedNullableArrayBufferView },
42814 { prototypes::id::TestJSImplInterface },
42815 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42816 JSJitInfo::Method,
42817 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42818 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42819 false, /* isInfallible. False in setters. */
42820 false, /* isMovable. Not relevant for setters. */
42821 false, /* isEliminatable. Not relevant for setters. */
42822 false, /* isAlwaysInSlot. Only relevant for getters. */
42823 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42824 false, /* isTypedMethod. Only relevant for methods. */
42825 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42826};
42827
42828MOZ_CAN_RUN_SCRIPT static bool
42829passAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42830{
42831 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedArrayBuffer");
42832 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42835( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42833 "TestJSImplInterface", "passAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42835( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42834 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42835( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42835 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42835( cx, "TestJSImplInterface"
, "passAllowSharedArrayBuffer", JS::ProfilingCategoryPair::DOM
, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42836
42837 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42838 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedArrayBuffer", 1)) {
42839 return false;
42840 }
42841 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42842 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42843 if (objIsXray) {
42844 unwrappedObj.emplace(cx, obj);
42845 }
42846 RootedSpiderMonkeyInterface<ArrayBuffer> arg0(cx);
42847 if (args[0].isObject()) {
42848 if (!arg0.Init(&args[0].toObject())) {
42849 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBuffer");
42850 return false;
42851 }
42852 if (JS::IsLargeArrayBufferMaybeShared(arg0.Obj())) {
42853 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42854 return false;
42855 }
42856 if (JS::IsResizableArrayBufferMaybeShared(arg0.Obj())) {
42857 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42858 return false;
42859 }
42860 } else {
42861 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42862 return false;
42863 }
42864 if (objIsXray) {
42865 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42866 // we know Xrays have no dynamic unwrap behavior.
42867 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42868 if (!unwrappedObj.ref()) {
42869 return false;
42870 }
42871 }
42872 FastErrorResult rv;
42873 // NOTE: This assert does NOT call the function.
42874 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42875 MOZ_KnownLive(self)(self)->PassAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42876 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedArrayBuffer"
)), 0))
) {
42877 return false;
42878 }
42879 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42879; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42880 args.rval().setUndefined();
42881 return true;
42882}
42883
42884static const JSJitInfo passAllowSharedArrayBuffer_methodinfo = {
42885 { (JSJitGetterOp)passAllowSharedArrayBuffer },
42886 { prototypes::id::TestJSImplInterface },
42887 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42888 JSJitInfo::Method,
42889 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42890 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42891 false, /* isInfallible. False in setters. */
42892 false, /* isMovable. Not relevant for setters. */
42893 false, /* isEliminatable. Not relevant for setters. */
42894 false, /* isAlwaysInSlot. Only relevant for getters. */
42895 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42896 false, /* isTypedMethod. Only relevant for methods. */
42897 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42898};
42899
42900MOZ_CAN_RUN_SCRIPT static bool
42901passAllowSharedNullableArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42902{
42903 BindingCallContext cx(cx_, "TestJSImplInterface.passAllowSharedNullableArrayBuffer");
42904 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42907( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42905 "TestJSImplInterface", "passAllowSharedNullableArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42907( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42906 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42907( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
42907 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42907( cx, "TestJSImplInterface"
, "passAllowSharedNullableArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
42908
42909 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42910 if (!args.requireAtLeast(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", 1)) {
42911 return false;
42912 }
42913 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42914 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42915 if (objIsXray) {
42916 unwrappedObj.emplace(cx, obj);
42917 }
42918 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> arg0(cx);
42919 if (args[0].isObject()) {
42920 if (!arg0.SetValue().Init(&args[0].toObject())) {
42921 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 1", "ArrayBufferOrNull");
42922 return false;
42923 }
42924 if (JS::IsLargeArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42925 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 1");
42926 return false;
42927 }
42928 if (JS::IsResizableArrayBufferMaybeShared(arg0.SetValue().Obj())) {
42929 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 1");
42930 return false;
42931 }
42932 } else if (args[0].isNullOrUndefined()) {
42933 arg0.SetNull();
42934 } else {
42935 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
42936 return false;
42937 }
42938 if (objIsXray) {
42939 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42940 // we know Xrays have no dynamic unwrap behavior.
42941 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
42942 if (!unwrappedObj.ref()) {
42943 return false;
42944 }
42945 }
42946 FastErrorResult rv;
42947 // NOTE: This assert does NOT call the function.
42948 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
42949 MOZ_KnownLive(self)(self)->PassAllowSharedNullableArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
42950 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passAllowSharedNullableArrayBuffer"
)), 0))
) {
42951 return false;
42952 }
42953 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 42953); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 42953; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
42954 args.rval().setUndefined();
42955 return true;
42956}
42957
42958static const JSJitInfo passAllowSharedNullableArrayBuffer_methodinfo = {
42959 { (JSJitGetterOp)passAllowSharedNullableArrayBuffer },
42960 { prototypes::id::TestJSImplInterface },
42961 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
42962 JSJitInfo::Method,
42963 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
42964 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
42965 false, /* isInfallible. False in setters. */
42966 false, /* isMovable. Not relevant for setters. */
42967 false, /* isEliminatable. Not relevant for setters. */
42968 false, /* isAlwaysInSlot. Only relevant for getters. */
42969 false, /* isLazilyCachedInSlot. Only relevant for getters. */
42970 false, /* isTypedMethod. Only relevant for methods. */
42971 0 /* Reserved slot index, if we're stored in a slot, else 0. */
42972};
42973
42974MOZ_CAN_RUN_SCRIPT static bool
42975passUnionArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
42976{
42977 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionArrayBuffer");
42978 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject42981( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42979 "TestJSImplInterface", "passUnionArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject42981( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42980 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject42981( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
42981 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject42981( cx, "TestJSImplInterface"
, "passUnionArrayBuffer", JS::ProfilingCategoryPair::DOM, uint32_t
(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) | uint32_t
(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
42982
42983 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
42984 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionArrayBuffer", 1)) {
42985 return false;
42986 }
42987 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
42988 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
42989 if (objIsXray) {
42990 unwrappedObj.emplace(cx, obj);
42991 }
42992 StringOrArrayBuffer arg0;
42993 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
42994 return false;
42995 }
42996 if (objIsXray) {
42997 // Since our object is an Xray, we can just CheckedUnwrapStatic:
42998 // we know Xrays have no dynamic unwrap behavior.
42999 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43000 if (!unwrappedObj.ref()) {
43001 return false;
43002 }
43003 }
43004 FastErrorResult rv;
43005 // NOTE: This assert does NOT call the function.
43006 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
43007 MOZ_KnownLive(self)(self)->PassUnionArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43008 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionArrayBuffer"
)), 0))
) {
43009 return false;
43010 }
43011 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43011); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 43011; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
43012 args.rval().setUndefined();
43013 return true;
43014}
43015
43016static const JSJitInfo passUnionArrayBuffer_methodinfo = {
43017 { (JSJitGetterOp)passUnionArrayBuffer },
43018 { prototypes::id::TestJSImplInterface },
43019 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43020 JSJitInfo::Method,
43021 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43022 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43023 false, /* isInfallible. False in setters. */
43024 false, /* isMovable. Not relevant for setters. */
43025 false, /* isEliminatable. Not relevant for setters. */
43026 false, /* isAlwaysInSlot. Only relevant for getters. */
43027 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43028 false, /* isTypedMethod. Only relevant for methods. */
43029 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43030};
43031
43032MOZ_CAN_RUN_SCRIPT static bool
43033passUnionAllowSharedArrayBuffer(JSContext* cx_, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43034{
43035 BindingCallContext cx(cx_, "TestJSImplInterface.passUnionAllowSharedArrayBuffer");
43036 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43039( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43037 "TestJSImplInterface", "passUnionAllowSharedArrayBuffer", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43039( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43038 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43039( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
43039 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43039( cx, "TestJSImplInterface"
, "passUnionAllowSharedArrayBuffer", JS::ProfilingCategoryPair
::DOM, uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD
) | uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS)
)
;
43040
43041 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43042 if (!args.requireAtLeast(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", 1)) {
43043 return false;
43044 }
43045 Maybe<JS::Rooted<JSObject*> > unwrappedObj;
43046 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
43047 if (objIsXray) {
43048 unwrappedObj.emplace(cx, obj);
43049 }
43050 StringOrMaybeSharedArrayBuffer arg0;
43051 if (!arg0.Init(cx, args[0], "Argument 1", true)) {
43052 return false;
43053 }
43054 if (objIsXray) {
43055 // Since our object is an Xray, we can just CheckedUnwrapStatic:
43056 // we know Xrays have no dynamic unwrap behavior.
43057 unwrappedObj.ref() = js::CheckedUnwrapStatic(unwrappedObj.ref());
43058 if (!unwrappedObj.ref()) {
43059 return false;
43060 }
43061 }
43062 FastErrorResult rv;
43063 // NOTE: This assert does NOT call the function.
43064 static_assert(std::is_void_v<decltype(MOZ_KnownLive(self)(self)->PassUnionAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx))))>, "Should be returning void here");
43065 MOZ_KnownLive(self)(self)->PassUnionAllowSharedArrayBuffer(Constify(arg0), rv, (unwrappedObj ? js::GetNonCCWObjectRealm(*unwrappedObj) : js::GetContextRealm(cx)));
43066 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface.passUnionAllowSharedArrayBuffer"
)), 0))
) {
43067 return false;
43068 }
43069 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 43069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 43069; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
43070 args.rval().setUndefined();
43071 return true;
43072}
43073
43074static const JSJitInfo passUnionAllowSharedArrayBuffer_methodinfo = {
43075 { (JSJitGetterOp)passUnionAllowSharedArrayBuffer },
43076 { prototypes::id::TestJSImplInterface },
43077 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43078 JSJitInfo::Method,
43079 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43080 JSVAL_TYPE_UNDEFINED, /* returnType. Not relevant for setters. */
43081 false, /* isInfallible. False in setters. */
43082 false, /* isMovable. Not relevant for setters. */
43083 false, /* isEliminatable. Not relevant for setters. */
43084 false, /* isAlwaysInSlot. Only relevant for getters. */
43085 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43086 false, /* isTypedMethod. Only relevant for methods. */
43087 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43088};
43089
43090MOZ_CAN_RUN_SCRIPT static bool
43091toJSON(JSContext* cx, JS::Handle<JSObject*> obj, void* void_self, const JSJitMethodCallArgs& args)
43092{
43093 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject43096( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43094 "TestJSImplInterface", "toJSON", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject43096( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43095 uint32_t(js::ProfilingStackFrame::Flags::STRING_TEMPLATE_METHOD) |mozilla::AutoProfilerLabelHot raiiObject43096( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
43096 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject43096( cx, "TestJSImplInterface"
, "toJSON", JS::ProfilingCategoryPair::DOM, uint32_t(js::ProfilingStackFrame
::Flags::STRING_TEMPLATE_METHOD) | uint32_t(js::ProfilingStackFrame
::Flags::RELEVANT_FOR_JS))
;
43097
43098 auto* self = static_cast<mozilla::dom::TestJSImplInterface*>(void_self);
43099 JS::Rooted<JSObject*> result(cx, JS_NewPlainObject(cx));
43100 if (!result) {
43101 return false;
43102 }
43103 if (!TestJSImplInterface_Binding::CollectJSONAttributes(cx, obj, MOZ_KnownLive(self)(self), result)) {
43104 return false;
43105 }
43106 args.rval().setObject(*result);
43107 return true;
43108}
43109
43110static const JSJitInfo toJSON_methodinfo = {
43111 { (JSJitGetterOp)toJSON },
43112 { prototypes::id::TestJSImplInterface },
43113 { PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth },
43114 JSJitInfo::Method,
43115 JSJitInfo::AliasEverything, /* aliasSet. Not relevant for setters. */
43116 JSVAL_TYPE_OBJECT, /* returnType. Not relevant for setters. */
43117 false, /* isInfallible. False in setters. */
43118 false, /* isMovable. Not relevant for setters. */
43119 false, /* isEliminatable. Not relevant for setters. */
43120 false, /* isAlwaysInSlot. Only relevant for getters. */
43121 false, /* isLazilyCachedInSlot. Only relevant for getters. */
43122 false, /* isTypedMethod. Only relevant for methods. */
43123 0 /* Reserved slot index, if we're stored in a slot, else 0. */
43124};
43125
43126static bool
43127_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
43128{
43129 mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj);
43130 // We don't want to preserve if we don't have a wrapper, and we
43131 // obviously can't preserve if we're not initialized.
43132 if (self && self->GetWrapperPreserveColor()) {
43133 PreserveWrapper(self);
43134 }
43135 return true;
43136}
43137
43138static void
43139_finalize(JS::GCContext* gcx, JSObject* obj)
43140{
43141 mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj);
43142 if (self) {
43143 JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue());
43144 ClearWrapper(self, self, obj);
43145 if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
43146 JS::RemoveAssociatedMemory(obj, mallocBytes,
43147 JS::MemoryUse::DOMBinding);
43148 }
43149 AddForDeferredFinalization<mozilla::dom::TestJSImplInterface>(self);
43150 }
43151}
43152
43153static nsWrapperCache*
43154_getWrapperCache(JS::Handle<JSObject*> obj)
43155{
43156 mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj);
43157 return self;
43158}
43159
43160static size_t
43161_objectMoved(JSObject* obj, JSObject* old)
43162{
43163 mozilla::dom::TestJSImplInterface* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplInterface>(obj);
43164 if (self) {
43165 UpdateWrapper(self, self, obj, old);
43166 }
43167
43168 return 0;
43169}
43170
43171static const JSFunctionSpec sChromeStaticMethods_specs[] = {
43172 JS_FNSPEC("_create", TestJSImplInterface::_Create, nullptr, 2, 0, nullptr){JSFunctionSpec::Name("_create"), {TestJSImplInterface::_Create
, nullptr}, 2, 0, nullptr}
,
43173 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43174};
43175
43176
43177static const Prefable<const JSFunctionSpec> sChromeStaticMethods[] = {
43178 { nullptr, &sChromeStaticMethods_specs[0] },
43179 { nullptr, nullptr }
43180};
43181
43182static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43183 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43184static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43185 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43186
43187static const JSFunctionSpec sMethods_specs[] = {
43188 JS_FNSPEC("passByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passByte_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passByte"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passByte_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43189 JS_FNSPEC("receiveByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveByte"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveByte_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43190 JS_FNSPEC("passOptionalByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByte"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalByte_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43191 JS_FNSPEC("passOptionalByteBeforeRequired", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByteBeforeRequired_methodinfo), 2, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByteBeforeRequired"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalByteBeforeRequired_methodinfo
)}, 2, JSPROP_ENUMERATE, nullptr}
,
43192 JS_FNSPEC("passOptionalByteWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByteWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByteWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalByteWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43193 JS_FNSPEC("passOptionalByteWithDefaultBeforeRequired", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByteWithDefaultBeforeRequired_methodinfo), 2, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByteWithDefaultBeforeRequired"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalByteWithDefaultBeforeRequired_methodinfo
)}, 2, JSPROP_ENUMERATE, nullptr}
,
43194 JS_FNSPEC("passNullableByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableByte_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableByte"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableByte_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43195 JS_FNSPEC("passOptionalNullableByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableByte"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableByte_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43196 JS_FNSPEC("passVariadicByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicByte"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicByte_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43197 JS_FNSPEC("returnByteSideEffectFree", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&returnByteSideEffectFree_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("returnByteSideEffectFree"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&returnByteSideEffectFree_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43198 JS_FNSPEC("returnDOMDependentByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&returnDOMDependentByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("returnDOMDependentByte"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&returnDOMDependentByte_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43199 JS_FNSPEC("returnConstantByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&returnConstantByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("returnConstantByte"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&returnConstantByte_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43200 JS_FNSPEC("returnDeviceStateDependentByte", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&returnDeviceStateDependentByte_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("returnDeviceStateDependentByte"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&returnDeviceStateDependentByte_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43201 JS_FNSPEC("passShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passShort_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passShort"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passShort_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43202 JS_FNSPEC("receiveShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveShort_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveShort"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveShort_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43203 JS_FNSPEC("passOptionalShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalShort_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalShort"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalShort_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43204 JS_FNSPEC("passOptionalShortWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalShortWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalShortWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalShortWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43205 JS_FNSPEC("passLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passLong_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passLong"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passLong_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43206 JS_FNSPEC("receiveLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveLong"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveLong_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43207 JS_FNSPEC("passOptionalLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalLong"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalLong_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43208 JS_FNSPEC("passOptionalLongWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalLongWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalLongWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalLongWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43209 JS_FNSPEC("passLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passLongLong_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passLongLong"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passLongLong_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43210 JS_FNSPEC("receiveLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveLongLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveLongLong"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveLongLong_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43211 JS_FNSPEC("passOptionalLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalLongLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalLongLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalLongLong_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43212 JS_FNSPEC("passOptionalLongLongWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalLongLongWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalLongLongWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalLongLongWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43213 JS_FNSPEC("passOctet", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOctet_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOctet"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passOctet_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43214 JS_FNSPEC("receiveOctet", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveOctet_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveOctet"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveOctet_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43215 JS_FNSPEC("passOptionalOctet", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalOctet_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalOctet"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalOctet_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43216 JS_FNSPEC("passOptionalOctetWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalOctetWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalOctetWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalOctetWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43217 JS_FNSPEC("passUnsignedShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnsignedShort_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnsignedShort"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUnsignedShort_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43218 JS_FNSPEC("receiveUnsignedShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnsignedShort_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnsignedShort"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveUnsignedShort_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43219 JS_FNSPEC("passOptionalUnsignedShort", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedShort_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedShort"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUnsignedShort_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43220 JS_FNSPEC("passOptionalUnsignedShortWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedShortWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedShortWithDefault")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalUnsignedShortWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43221 JS_FNSPEC("passUnsignedLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnsignedLong_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnsignedLong"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUnsignedLong_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43222 JS_FNSPEC("receiveUnsignedLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnsignedLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnsignedLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveUnsignedLong_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43223 JS_FNSPEC("passOptionalUnsignedLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUnsignedLong_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43224 JS_FNSPEC("passOptionalUnsignedLongWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedLongWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedLongWithDefault"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalUnsignedLongWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43225 JS_FNSPEC("passUnsignedLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnsignedLongLong_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnsignedLongLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnsignedLongLong_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43226 JS_FNSPEC("receiveUnsignedLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnsignedLongLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnsignedLongLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveUnsignedLongLong_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43227 JS_FNSPEC("passOptionalUnsignedLongLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedLongLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedLongLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUnsignedLongLong_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43228 JS_FNSPEC("passOptionalUnsignedLongLongWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedLongLongWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnsignedLongLongWithDefault"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalUnsignedLongLongWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43229 JS_FNSPEC("passFloat", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passFloat_methodinfo), 16, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passFloat"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passFloat_methodinfo)}, 16, JSPROP_ENUMERATE, nullptr}
,
43230 JS_FNSPEC("passLenientFloat", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passLenientFloat_methodinfo), 16, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passLenientFloat"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passLenientFloat_methodinfo)}, 16, JSPROP_ENUMERATE
, nullptr}
,
43231 JS_FNSPEC("receiveSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveSelf"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveSelf_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43232 JS_FNSPEC("receiveNullableSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableSelf"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableSelf_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43233 JS_FNSPEC("receiveWeakSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakSelf"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveWeakSelf_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43234 JS_FNSPEC("receiveWeakNullableSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakNullableSelf"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveWeakNullableSelf_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43235 JS_FNSPEC("passSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSelf"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passSelf_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43236 JS_FNSPEC("passNullableSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSelf_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSelf"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableSelf_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43237 JS_FNSPEC("passOptionalSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSelf"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalSelf_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43238 JS_FNSPEC("passOptionalNonNullSelf", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNonNullSelf_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNonNullSelf"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNonNullSelf_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43239 JS_FNSPEC("passOptionalSelfWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSelfWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSelfWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalSelfWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43240 JS_FNSPEC("receiveNonWrapperCacheInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNonWrapperCacheInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNonWrapperCacheInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNonWrapperCacheInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43241 JS_FNSPEC("receiveNullableNonWrapperCacheInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableNonWrapperCacheInterface"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43242 JS_FNSPEC("receiveNonWrapperCacheInterfaceSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNonWrapperCacheInterfaceSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNonWrapperCacheInterfaceSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNonWrapperCacheInterfaceSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43243 JS_FNSPEC("receiveNullableNonWrapperCacheInterfaceSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterfaceSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableNonWrapperCacheInterfaceSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterfaceSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43244 JS_FNSPEC("receiveNonWrapperCacheInterfaceNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNonWrapperCacheInterfaceNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNonWrapperCacheInterfaceNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNonWrapperCacheInterfaceNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43245 JS_FNSPEC("receiveNullableNonWrapperCacheInterfaceNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterfaceNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableNonWrapperCacheInterfaceNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableNonWrapperCacheInterfaceNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43246 JS_FNSPEC("receiveExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveExternal"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveExternal_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43247 JS_FNSPEC("receiveNullableExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableExternal_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43248 JS_FNSPEC("receiveWeakExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveWeakExternal_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43249 JS_FNSPEC("receiveWeakNullableExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakNullableExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveWeakNullableExternal_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43250 JS_FNSPEC("passExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passExternal_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passExternal"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passExternal_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43251 JS_FNSPEC("passNullableExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableExternal_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableExternal_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43252 JS_FNSPEC("passOptionalExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalExternal_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43253 JS_FNSPEC("passOptionalNonNullExternal", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNonNullExternal_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNonNullExternal"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNonNullExternal_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43254 JS_FNSPEC("passOptionalExternalWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalExternalWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalExternalWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalExternalWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43255 JS_FNSPEC("receiveCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveCallbackInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43256 JS_FNSPEC("receiveNullableCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableCallbackInterface"), {(
GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&receiveNullableCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43257 JS_FNSPEC("receiveWeakCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakCallbackInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveWeakCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43258 JS_FNSPEC("receiveWeakNullableCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakNullableCallbackInterface")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&receiveWeakNullableCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43259 JS_FNSPEC("passCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCallbackInterface_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCallbackInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passCallbackInterface_methodinfo)},
1, JSPROP_ENUMERATE, nullptr}
,
43260 JS_FNSPEC("passNullableCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCallbackInterface_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCallbackInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableCallbackInterface_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43261 JS_FNSPEC("passOptionalCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalCallbackInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43262 JS_FNSPEC("passOptionalNonNullCallbackInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNonNullCallbackInterface_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNonNullCallbackInterface")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalNonNullCallbackInterface_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43263 JS_FNSPEC("passOptionalCallbackInterfaceWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalCallbackInterfaceWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalCallbackInterfaceWithDefault"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalCallbackInterfaceWithDefault_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43264 JS_FNSPEC("receiveSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveSequence"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveSequence_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43265 JS_FNSPEC("receiveNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableSequence_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43266 JS_FNSPEC("receiveSequenceOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveSequenceOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveSequenceOfNullableInts"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveSequenceOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43267 JS_FNSPEC("receiveNullableSequenceOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableSequenceOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableSequenceOfNullableInts"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableSequenceOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43268 JS_FNSPEC("passSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequence"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passSequence_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43269 JS_FNSPEC("passNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableSequence_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43270 JS_FNSPEC("passSequenceOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfNullableInts_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfNullableInts"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfNullableInts_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43271 JS_FNSPEC("passOptionalSequenceOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSequenceOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSequenceOfNullableInts"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalSequenceOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43272 JS_FNSPEC("passOptionalNullableSequenceOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfNullableInts"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43273 JS_FNSPEC("receiveCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveCastableObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveCastableObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveCastableObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43274 JS_FNSPEC("receiveCallbackObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveCallbackObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveCallbackObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveCallbackObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43275 JS_FNSPEC("receiveNullableCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableCastableObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableCastableObjectSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableCastableObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43276 JS_FNSPEC("receiveNullableCallbackObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableCallbackObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableCallbackObjectSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableCallbackObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43277 JS_FNSPEC("receiveCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveCastableObjectNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveCastableObjectNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveCastableObjectNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43278 JS_FNSPEC("receiveNullableCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableCastableObjectNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableCastableObjectNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveNullableCastableObjectNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43279 JS_FNSPEC("receiveWeakCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakCastableObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakCastableObjectSequence"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&receiveWeakCastableObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43280 JS_FNSPEC("receiveWeakNullableCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableCastableObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakNullableCastableObjectSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableCastableObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43281 JS_FNSPEC("receiveWeakCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakCastableObjectNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakCastableObjectNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveWeakCastableObjectNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43282 JS_FNSPEC("receiveWeakNullableCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableCastableObjectNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveWeakNullableCastableObjectNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&receiveWeakNullableCastableObjectNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43283 JS_FNSPEC("passCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCastableObjectSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCastableObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passCastableObjectSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43284 JS_FNSPEC("passNullableCastableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCastableObjectSequence"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableCastableObjectSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43285 JS_FNSPEC("passCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCastableObjectNullableSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCastableObjectNullableSequence"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passCastableObjectNullableSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43286 JS_FNSPEC("passNullableCastableObjectNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectNullableSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCastableObjectNullableSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectNullableSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43287 JS_FNSPEC("passOptionalSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalSequence_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43288 JS_FNSPEC("passOptionalSequenceWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSequenceWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSequenceWithDefaultValue")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalSequenceWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43289 JS_FNSPEC("passOptionalNullableSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43290 JS_FNSPEC("passOptionalNullableSequenceWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43291 JS_FNSPEC("passOptionalNullableSequenceWithDefaultValue2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceWithDefaultValue2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceWithDefaultValue2"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceWithDefaultValue2_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43292 JS_FNSPEC("passOptionalObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43293 JS_FNSPEC("passExternalInterfaceSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passExternalInterfaceSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passExternalInterfaceSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passExternalInterfaceSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43294 JS_FNSPEC("passNullableExternalInterfaceSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableExternalInterfaceSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableExternalInterfaceSequence"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passNullableExternalInterfaceSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43295 JS_FNSPEC("receiveStringSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveStringSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveStringSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveStringSequence_methodinfo)},
0, JSPROP_ENUMERATE, nullptr}
,
43296 JS_FNSPEC("receiveByteStringSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveByteStringSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveByteStringSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveByteStringSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43297 JS_FNSPEC("receiveUTF8StringSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUTF8StringSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUTF8StringSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveUTF8StringSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43298 JS_FNSPEC("receiveAnySequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveAnySequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveAnySequence"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveAnySequence_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43299 JS_FNSPEC("receiveNullableAnySequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableAnySequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableAnySequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableAnySequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43300 JS_FNSPEC("receiveObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveObjectSequence_methodinfo)},
0, JSPROP_ENUMERATE, nullptr}
,
43301 JS_FNSPEC("receiveNullableObjectSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableObjectSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableObjectSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableObjectSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43302 JS_FNSPEC("passSequenceOfSequences", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfSequences_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfSequences"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfSequences_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43303 JS_FNSPEC("passSequenceOfSequencesOfSequences", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfSequencesOfSequences_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfSequencesOfSequences"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passSequenceOfSequencesOfSequences_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43304 JS_FNSPEC("passRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecord"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passRecord_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43305 JS_FNSPEC("passNullableRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableRecord"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableRecord_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43306 JS_FNSPEC("passRecordOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfNullableInts_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfNullableInts"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfNullableInts_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43307 JS_FNSPEC("passOptionalRecordOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalRecordOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalRecordOfNullableInts"), {(
GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalRecordOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43308 JS_FNSPEC("passOptionalNullableRecordOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecordOfNullableInts"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43309 JS_FNSPEC("passCastableObjectRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCastableObjectRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCastableObjectRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passCastableObjectRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43310 JS_FNSPEC("passNullableCastableObjectRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCastableObjectRecord"), {(
GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableCastableObjectRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43311 JS_FNSPEC("passCastableObjectNullableRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCastableObjectNullableRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCastableObjectNullableRecord"), {(
GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passCastableObjectNullableRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43312 JS_FNSPEC("passNullableCastableObjectNullableRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectNullableRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCastableObjectNullableRecord"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passNullableCastableObjectNullableRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43313 JS_FNSPEC("passOptionalRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalRecord"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalRecord_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43314 JS_FNSPEC("passOptionalNullableRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableRecord_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43315 JS_FNSPEC("passOptionalNullableRecordWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecordWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43316 JS_FNSPEC("passOptionalObjectRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalObjectRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalObjectRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalObjectRecord_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43317 JS_FNSPEC("passExternalInterfaceRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passExternalInterfaceRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passExternalInterfaceRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passExternalInterfaceRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43318 JS_FNSPEC("passNullableExternalInterfaceRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableExternalInterfaceRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableExternalInterfaceRecord"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableExternalInterfaceRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43319 JS_FNSPEC("passStringRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passStringRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passStringRecord"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passStringRecord_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43320 JS_FNSPEC("passByteStringRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passByteStringRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passByteStringRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passByteStringRecord_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43321 JS_FNSPEC("passUTF8StringRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUTF8StringRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUTF8StringRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUTF8StringRecord_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43322 JS_FNSPEC("passRecordOfRecords", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfRecords_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfRecords"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfRecords_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43323 JS_FNSPEC("receiveRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveRecord"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveRecord_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43324 JS_FNSPEC("receiveNullableRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableRecord_methodinfo)},
0, JSPROP_ENUMERATE, nullptr}
,
43325 JS_FNSPEC("receiveRecordOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveRecordOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveRecordOfNullableInts"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveRecordOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43326 JS_FNSPEC("receiveNullableRecordOfNullableInts", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableRecordOfNullableInts_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableRecordOfNullableInts"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&receiveNullableRecordOfNullableInts_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43327 JS_FNSPEC("receiveAnyRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveAnyRecord_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveAnyRecord"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveAnyRecord_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43328 JS_FNSPEC("passArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passArrayBuffer"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passArrayBuffer_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43329 JS_FNSPEC("passNullableArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableArrayBuffer_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43330 JS_FNSPEC("passOptionalArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalArrayBuffer_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalArrayBuffer_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43331 JS_FNSPEC("passOptionalNullableArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableArrayBuffer_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableArrayBuffer_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43332 JS_FNSPEC("passOptionalNullableArrayBufferWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableArrayBufferWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableArrayBufferWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableArrayBufferWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43333 JS_FNSPEC("passArrayBufferView", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passArrayBufferView_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passArrayBufferView"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passArrayBufferView_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43334 JS_FNSPEC("passInt8Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passInt8Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passInt8Array"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passInt8Array_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43335 JS_FNSPEC("passInt16Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passInt16Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passInt16Array"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passInt16Array_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43336 JS_FNSPEC("passInt32Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passInt32Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passInt32Array"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passInt32Array_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43337 JS_FNSPEC("passUint8Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUint8Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUint8Array"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUint8Array_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43338 JS_FNSPEC("passUint16Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUint16Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUint16Array"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUint16Array_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43339 JS_FNSPEC("passUint32Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUint32Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUint32Array"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUint32Array_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43340 JS_FNSPEC("passUint8ClampedArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUint8ClampedArray_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUint8ClampedArray"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUint8ClampedArray_methodinfo)},
1, JSPROP_ENUMERATE, nullptr}
,
43341 JS_FNSPEC("passFloat32Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passFloat32Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passFloat32Array"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passFloat32Array_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43342 JS_FNSPEC("passFloat64Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passFloat64Array_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passFloat64Array"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passFloat64Array_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43343 JS_FNSPEC("passSequenceOfArrayBuffers", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfArrayBuffers_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfArrayBuffers"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfArrayBuffers_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43344 JS_FNSPEC("passSequenceOfNullableArrayBuffers", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfNullableArrayBuffers_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfNullableArrayBuffers"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passSequenceOfNullableArrayBuffers_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43345 JS_FNSPEC("passRecordOfArrayBuffers", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfArrayBuffers_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfArrayBuffers"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfArrayBuffers_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43346 JS_FNSPEC("passRecordOfNullableArrayBuffers", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfNullableArrayBuffers_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfNullableArrayBuffers"), {(
GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passRecordOfNullableArrayBuffers_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43347 JS_FNSPEC("passVariadicTypedArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicTypedArray_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicTypedArray"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicTypedArray_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43348 JS_FNSPEC("passVariadicNullableTypedArray", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicNullableTypedArray_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicNullableTypedArray"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicNullableTypedArray_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43349 JS_FNSPEC("receiveUint8Array", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUint8Array_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUint8Array"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveUint8Array_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43350 JS_FNSPEC("passString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passString"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passString_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43351 JS_FNSPEC("passNullableString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableString"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableString_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43352 JS_FNSPEC("passOptionalString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalString"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalString_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43353 JS_FNSPEC("passOptionalStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalStringWithDefaultValue"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43354 JS_FNSPEC("passOptionalNullableString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableString_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43355 JS_FNSPEC("passOptionalNullableStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableStringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43356 JS_FNSPEC("passVariadicString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicString"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicString_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43357 JS_FNSPEC("passByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passByteString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passByteString"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passByteString_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43358 JS_FNSPEC("passNullableByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableByteString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableByteString_methodinfo)}
, 1, JSPROP_ENUMERATE, nullptr}
,
43359 JS_FNSPEC("passOptionalByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByteString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalByteString_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43360 JS_FNSPEC("passOptionalByteStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalByteStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalByteStringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalByteStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43361 JS_FNSPEC("passOptionalNullableByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableByteString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableByteString_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43362 JS_FNSPEC("passOptionalNullableByteStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableByteStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableByteStringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableByteStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43363 JS_FNSPEC("passVariadicByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicByteString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicByteString_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43364 JS_FNSPEC("passUnionByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionByteString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionByteString_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43365 JS_FNSPEC("passOptionalUnionByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnionByteString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnionByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUnionByteString_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43366 JS_FNSPEC("passOptionalUnionByteStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnionByteStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnionByteStringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalUnionByteStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43367 JS_FNSPEC("passUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUTF8String_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUTF8String"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUTF8String_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43368 JS_FNSPEC("passNullableUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUTF8String_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableUTF8String_methodinfo)}
, 1, JSPROP_ENUMERATE, nullptr}
,
43369 JS_FNSPEC("passOptionalUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUTF8String_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUTF8String_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43370 JS_FNSPEC("passOptionalUTF8StringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUTF8StringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUTF8StringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalUTF8StringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43371 JS_FNSPEC("passOptionalNullableUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUTF8String_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableUTF8String_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43372 JS_FNSPEC("passOptionalNullableUTF8StringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUTF8StringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableUTF8StringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUTF8StringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43373 JS_FNSPEC("passVariadicUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicUTF8String_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicUTF8String_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43374 JS_FNSPEC("passUnionUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionUTF8String_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionUTF8String_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43375 JS_FNSPEC("passOptionalUnionUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnionUTF8String_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnionUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalUnionUTF8String_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43376 JS_FNSPEC("passOptionalUnionUTF8StringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnionUTF8StringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnionUTF8StringWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalUnionUTF8StringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43377 JS_FNSPEC("passSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSVS_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSVS"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passSVS_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43378 JS_FNSPEC("passNullableSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSVS_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSVS"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableSVS_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43379 JS_FNSPEC("passOptionalSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSVS_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSVS"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalSVS_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43380 JS_FNSPEC("passOptionalSVSWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSVSWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSVSWithDefaultValue"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalSVSWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43381 JS_FNSPEC("passOptionalNullableSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSVS_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSVS"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableSVS_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43382 JS_FNSPEC("passOptionalNullableSVSWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSVSWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSVSWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSVSWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43383 JS_FNSPEC("passVariadicSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicSVS_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicSVS"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicSVS_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43384 JS_FNSPEC("receiveSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveSVS_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveSVS"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveSVS_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43385 JS_FNSPEC("passJSString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passJSString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passJSString"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passJSString_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43386 JS_FNSPEC("passOptionalJSStringWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalJSStringWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalJSStringWithDefaultValue")
, {(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalJSStringWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43387 JS_FNSPEC("receiveJSString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveJSString_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveJSString"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveJSString_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43388 JS_FNSPEC("passEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passEnum_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passEnum"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passEnum_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43389 JS_FNSPEC("passNullableEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableEnum_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableEnum"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableEnum_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43390 JS_FNSPEC("passOptionalEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalEnum_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalEnum"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalEnum_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43391 JS_FNSPEC("passEnumWithDefault", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passEnumWithDefault_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passEnumWithDefault"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passEnumWithDefault_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43392 JS_FNSPEC("passOptionalNullableEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableEnum_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableEnum"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableEnum_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43393 JS_FNSPEC("passOptionalNullableEnumWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableEnumWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableEnumWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableEnumWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43394 JS_FNSPEC("passOptionalNullableEnumWithDefaultValue2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableEnumWithDefaultValue2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableEnumWithDefaultValue2"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableEnumWithDefaultValue2_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43395 JS_FNSPEC("receiveEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveEnum_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveEnum"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveEnum_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43396 JS_FNSPEC("receiveNullableEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableEnum_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableEnum"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableEnum_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43397 JS_FNSPEC("passCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passCallback_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passCallback"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passCallback_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43398 JS_FNSPEC("passNullableCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableCallback_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableCallback"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableCallback_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43399 JS_FNSPEC("passOptionalCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalCallback_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalCallback"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalCallback_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43400 JS_FNSPEC("passOptionalNullableCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableCallback_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableCallback"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableCallback_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43401 JS_FNSPEC("passOptionalNullableCallbackWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableCallbackWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableCallbackWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableCallbackWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43402 JS_FNSPEC("receiveCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveCallback_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveCallback"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveCallback_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43403 JS_FNSPEC("receiveNullableCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableCallback_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableCallback"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableCallback_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43404 JS_FNSPEC("passOptionalNullableTreatAsNullCallbackWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableTreatAsNullCallbackWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableTreatAsNullCallbackWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43405 JS_FNSPEC("passAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAny"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passAny_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43406 JS_FNSPEC("passVariadicAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicAny"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicAny_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43407 JS_FNSPEC("passOptionalAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalAny"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalAny_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43408 JS_FNSPEC("passAnyDefaultNull", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAnyDefaultNull_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAnyDefaultNull"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passAnyDefaultNull_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43409 JS_FNSPEC("passSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfAny"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passSequenceOfAny_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43410 JS_FNSPEC("passNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSequenceOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSequenceOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableSequenceOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43411 JS_FNSPEC("passOptionalSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSequenceOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSequenceOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalSequenceOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43412 JS_FNSPEC("passOptionalNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfAny"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passOptionalNullableSequenceOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43413 JS_FNSPEC("passOptionalSequenceOfAnyWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalSequenceOfAnyWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalSequenceOfAnyWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalSequenceOfAnyWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43414 JS_FNSPEC("passSequenceOfSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfSequenceOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfSequenceOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfSequenceOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43415 JS_FNSPEC("passSequenceOfNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfNullableSequenceOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfNullableSequenceOfAny"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passSequenceOfNullableSequenceOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43416 JS_FNSPEC("passNullableSequenceOfNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSequenceOfNullableSequenceOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSequenceOfNullableSequenceOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passNullableSequenceOfNullableSequenceOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43417 JS_FNSPEC("passOptionalNullableSequenceOfNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfNullableSequenceOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43418 JS_FNSPEC("passRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfAny"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passRecordOfAny_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43419 JS_FNSPEC("passNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableRecordOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableRecordOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableRecordOfAny_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43420 JS_FNSPEC("passOptionalRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalRecordOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalRecordOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalRecordOfAny_methodinfo)
}, 0, JSPROP_ENUMERATE, nullptr}
,
43421 JS_FNSPEC("passOptionalNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecordOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableRecordOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43422 JS_FNSPEC("passOptionalRecordOfAnyWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalRecordOfAnyWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalRecordOfAnyWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalRecordOfAnyWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43423 JS_FNSPEC("passRecordOfRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfRecordOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfRecordOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfRecordOfAny_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43424 JS_FNSPEC("passRecordOfNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfNullableRecordOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfNullableRecordOfAny"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfNullableRecordOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43425 JS_FNSPEC("passNullableRecordOfNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableRecordOfNullableRecordOfAny_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableRecordOfNullableRecordOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passNullableRecordOfNullableRecordOfAny_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43426 JS_FNSPEC("passOptionalNullableRecordOfNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableRecordOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecordOfNullableRecordOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableRecordOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43427 JS_FNSPEC("passOptionalNullableRecordOfNullableSequenceOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableRecordOfNullableSequenceOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableRecordOfNullableSequenceOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43428 JS_FNSPEC("passOptionalNullableSequenceOfNullableRecordOfAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfNullableRecordOfAny"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableRecordOfAny_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43429 JS_FNSPEC("receiveAny", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveAny_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveAny"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveAny_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43430 JS_FNSPEC("passObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passObject"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passObject_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43431 JS_FNSPEC("passVariadicObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicObject"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicObject_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43432 JS_FNSPEC("passNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableObject"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableObject_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43433 JS_FNSPEC("passVariadicNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicNullableObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicNullableObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicNullableObject_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43434 JS_FNSPEC("passOptionalObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalObject"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalObject_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43435 JS_FNSPEC("passOptionalNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableObject_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43436 JS_FNSPEC("passOptionalNullableObjectWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableObjectWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableObjectWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableObjectWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43437 JS_FNSPEC("passSequenceOfObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfObject_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43438 JS_FNSPEC("passSequenceOfNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfNullableObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfNullableObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfNullableObject_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43439 JS_FNSPEC("passNullableSequenceOfObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableSequenceOfObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableSequenceOfObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passNullableSequenceOfObject_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43440 JS_FNSPEC("passOptionalNullableSequenceOfNullableSequenceOfObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfNullableSequenceOfObject"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfObject_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43441 JS_FNSPEC("passOptionalNullableSequenceOfNullableSequenceOfNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableSequenceOfNullableSequenceOfNullableObject"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableSequenceOfNullableSequenceOfNullableObject_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43442 JS_FNSPEC("passRecordOfObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfObject"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passRecordOfObject_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43443 JS_FNSPEC("receiveObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveObject"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveObject_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43444 JS_FNSPEC("receiveNullableObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableObject_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableObject_methodinfo)},
0, JSPROP_ENUMERATE, nullptr}
,
43445 JS_FNSPEC("passUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43446 JS_FNSPEC("passUnion2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion2_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion2"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion2_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43447 JS_FNSPEC("passUnion3", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion3_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion3"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion3_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43448 JS_FNSPEC("passUnion4", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion4_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion4"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion4_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43449 JS_FNSPEC("passUnion5", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion5_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion5"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion5_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43450 JS_FNSPEC("passUnion6", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion6_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion6"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion6_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43451 JS_FNSPEC("passUnion7", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion7_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion7"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion7_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43452 JS_FNSPEC("passUnion8", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion8_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion8"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion8_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43453 JS_FNSPEC("passUnion9", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion9_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion9"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion9_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43454 JS_FNSPEC("passUnion10", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion10_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion10"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion10_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43455 JS_FNSPEC("passUnion11", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion11_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion11"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion11_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43456 JS_FNSPEC("passUnion12", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion12_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion12"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion12_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43457 JS_FNSPEC("passUnion13", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion13_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion13"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion13_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43458 JS_FNSPEC("passUnion14", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion14_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion14"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion14_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43459 JS_FNSPEC("passUnion15", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion15_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion15"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion15_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43460 JS_FNSPEC("passUnion16", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion16_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion16"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion16_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43461 JS_FNSPEC("passUnion17", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion17_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion17"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion17_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43462 JS_FNSPEC("passUnion18", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion18_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion18"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion18_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43463 JS_FNSPEC("passUnion19", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion19_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion19"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion19_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43464 JS_FNSPEC("passUnion20", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion20_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion20"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion20_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43465 JS_FNSPEC("passUnion21", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion21_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion21"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion21_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43466 JS_FNSPEC("passUnion22", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion22_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion22"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion22_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43467 JS_FNSPEC("passUnion23", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion23_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion23"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion23_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43468 JS_FNSPEC("passUnion24", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion24_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion24"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion24_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43469 JS_FNSPEC("passUnion25", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion25_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion25"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion25_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43470 JS_FNSPEC("passUnion26", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion26_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion26"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion26_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43471 JS_FNSPEC("passUnion27", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion27_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion27"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion27_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43472 JS_FNSPEC("passUnion28", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnion28_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnion28"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passUnion28_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43473 JS_FNSPEC("passUnionWithCallback", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithCallback_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithCallback"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithCallback_methodinfo)},
1, JSPROP_ENUMERATE, nullptr}
,
43474 JS_FNSPEC("passUnionWithByteString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithByteString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithByteString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithByteString_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43475 JS_FNSPEC("passUnionWithUTF8String", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithUTF8String_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithUTF8String"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithUTF8String_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43476 JS_FNSPEC("passUnionWithRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithRecord_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43477 JS_FNSPEC("passUnionWithRecordAndSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithRecordAndSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithRecordAndSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithRecordAndSequence_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43478 JS_FNSPEC("passUnionWithSequenceAndRecord", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithSequenceAndRecord_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithSequenceAndRecord"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithSequenceAndRecord_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43479 JS_FNSPEC("passUnionWithSVS", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithSVS_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithSVS"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUnionWithSVS_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43480 JS_FNSPEC("passUnionWithNullable", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithNullable_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithNullable"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithNullable_methodinfo)},
1, JSPROP_ENUMERATE, nullptr}
,
43481 JS_FNSPEC("passNullableUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnion_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnion"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passNullableUnion_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43482 JS_FNSPEC("passOptionalUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalUnion"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passOptionalUnion_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43483 JS_FNSPEC("passOptionalNullableUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableUnion"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalNullableUnion_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43484 JS_FNSPEC("passOptionalNullableUnionWithDefaultValue", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUnionWithDefaultValue_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalNullableUnionWithDefaultValue"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passOptionalNullableUnionWithDefaultValue_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43485 JS_FNSPEC("passUnionWithArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithArrayBuffer_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43486 JS_FNSPEC("passUnionWithArrayBufferOrNull", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithArrayBufferOrNull_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithArrayBufferOrNull"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithArrayBufferOrNull_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43487 JS_FNSPEC("passUnionWithTypedArrays", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithTypedArrays_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithTypedArrays"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithTypedArrays_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43488 JS_FNSPEC("passUnionWithTypedArraysOrNull", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithTypedArraysOrNull_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithTypedArraysOrNull"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithTypedArraysOrNull_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43489 JS_FNSPEC("passUnionWithString", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithString_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithString"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithString_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43490 JS_FNSPEC("passUnionWithEnum", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithEnum_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithEnum"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passUnionWithEnum_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43491 JS_FNSPEC("passUnionWithObject", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithObject_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithObject"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithObject_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43492 JS_FNSPEC("passUnionWithDefaultValue1", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue1_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue1"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue1_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43493 JS_FNSPEC("passUnionWithDefaultValue2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue2"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue2_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43494 JS_FNSPEC("passUnionWithDefaultValue3", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue3_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue3"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue3_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43495 JS_FNSPEC("passUnionWithDefaultValue4", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue4_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue4"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue4_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43496 JS_FNSPEC("passUnionWithDefaultValue5", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue5_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue5"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue5_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43497 JS_FNSPEC("passUnionWithDefaultValue6", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue6_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue6"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue6_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43498 JS_FNSPEC("passUnionWithDefaultValue7", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue7_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue7"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue7_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43499 JS_FNSPEC("passUnionWithDefaultValue8", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue8_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue8"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue8_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43500 JS_FNSPEC("passUnionWithDefaultValue9", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue9_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue9"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue9_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43501 JS_FNSPEC("passUnionWithDefaultValue10", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue10_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue10"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue10_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43502 JS_FNSPEC("passUnionWithDefaultValue11", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue11_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue11"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue11_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43503 JS_FNSPEC("passUnionWithDefaultValue12", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue12_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue12"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue12_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43504 JS_FNSPEC("passUnionWithDefaultValue13", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue13_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue13"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue13_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43505 JS_FNSPEC("passUnionWithDefaultValue14", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue14_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue14"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue14_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43506 JS_FNSPEC("passUnionWithDefaultValue15", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue15_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue15"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue15_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43507 JS_FNSPEC("passUnionWithDefaultValue16", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue16_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue16"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue16_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43508 JS_FNSPEC("passUnionWithDefaultValue17", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue17_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue17"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue17_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43509 JS_FNSPEC("passUnionWithDefaultValue18", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue18_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue18"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue18_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43510 JS_FNSPEC("passUnionWithDefaultValue19", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue19_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue19"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue19_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43511 JS_FNSPEC("passUnionWithDefaultValue20", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue20_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue20"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue20_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43512 JS_FNSPEC("passUnionWithDefaultValue21", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue21_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue21"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue21_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43513 JS_FNSPEC("passUnionWithDefaultValue22", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue22_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue22"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue22_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43514 JS_FNSPEC("passUnionWithDefaultValue23", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue23_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue23"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue23_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43515 JS_FNSPEC("passUnionWithDefaultValue24", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue24_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue24"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue24_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43516 JS_FNSPEC("passUnionWithDefaultValue25", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionWithDefaultValue25_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionWithDefaultValue25"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionWithDefaultValue25_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43517 JS_FNSPEC("passNullableUnionWithDefaultValue1", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue1_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue1"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue1_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43518 JS_FNSPEC("passNullableUnionWithDefaultValue2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue2"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue2_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43519 JS_FNSPEC("passNullableUnionWithDefaultValue3", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue3_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue3"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue3_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43520 JS_FNSPEC("passNullableUnionWithDefaultValue4", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue4_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue4"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue4_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43521 JS_FNSPEC("passNullableUnionWithDefaultValue5", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue5_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue5"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue5_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43522 JS_FNSPEC("passNullableUnionWithDefaultValue6", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue6_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue6"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue6_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43523 JS_FNSPEC("passNullableUnionWithDefaultValue7", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue7_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue7"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue7_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43524 JS_FNSPEC("passNullableUnionWithDefaultValue8", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue8_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue8"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue8_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43525 JS_FNSPEC("passNullableUnionWithDefaultValue9", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue9_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue9"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue9_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43526 JS_FNSPEC("passNullableUnionWithDefaultValue10", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue10_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue10"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue10_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43527 JS_FNSPEC("passNullableUnionWithDefaultValue11", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue11_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue11"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue11_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43528 JS_FNSPEC("passNullableUnionWithDefaultValue12", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue12_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue12"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue12_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43529 JS_FNSPEC("passNullableUnionWithDefaultValue13", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue13_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue13"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue13_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43530 JS_FNSPEC("passNullableUnionWithDefaultValue14", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue14_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue14"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue14_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43531 JS_FNSPEC("passNullableUnionWithDefaultValue15", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue15_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue15"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue15_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43532 JS_FNSPEC("passNullableUnionWithDefaultValue16", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue16_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue16"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue16_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43533 JS_FNSPEC("passNullableUnionWithDefaultValue17", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue17_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue17"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue17_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43534 JS_FNSPEC("passNullableUnionWithDefaultValue18", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue18_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue18"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue18_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43535 JS_FNSPEC("passNullableUnionWithDefaultValue19", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue19_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue19"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue19_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43536 JS_FNSPEC("passNullableUnionWithDefaultValue20", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue20_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue20"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue20_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43537 JS_FNSPEC("passNullableUnionWithDefaultValue21", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue21_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue21"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue21_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43538 JS_FNSPEC("passNullableUnionWithDefaultValue22", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue22_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue22"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue22_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43539 JS_FNSPEC("passNullableUnionWithDefaultValue23", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue23_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue23"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue23_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43540 JS_FNSPEC("passNullableUnionWithDefaultValue24", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue24_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue24"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue24_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43541 JS_FNSPEC("passNullableUnionWithDefaultValue25", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue25_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue25"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue25_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43542 JS_FNSPEC("passNullableUnionWithDefaultValue26", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue26_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue26"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue26_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43543 JS_FNSPEC("passNullableUnionWithDefaultValue27", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue27_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue27"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue27_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43544 JS_FNSPEC("passNullableUnionWithDefaultValue28", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passNullableUnionWithDefaultValue28_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passNullableUnionWithDefaultValue28"),
{(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passNullableUnionWithDefaultValue28_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43545 JS_FNSPEC("passSequenceOfUnions", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfUnions_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfUnions"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfUnions_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43546 JS_FNSPEC("passSequenceOfUnions2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfUnions2_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfUnions2"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfUnions2_methodinfo)},
1, JSPROP_ENUMERATE, nullptr}
,
43547 JS_FNSPEC("passVariadicUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicUnion"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passVariadicUnion_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43548 JS_FNSPEC("passSequenceOfNullableUnions", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfNullableUnions_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfNullableUnions"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfNullableUnions_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43549 JS_FNSPEC("passVariadicNullableUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicNullableUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicNullableUnion"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicNullableUnion_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43550 JS_FNSPEC("passRecordOfUnions", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfUnions_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfUnions"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passRecordOfUnions_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43551 JS_FNSPEC("receiveUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnion"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveUnion_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43552 JS_FNSPEC("receiveUnion2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnion2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnion2"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&receiveUnion2_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43553 JS_FNSPEC("receiveUnionContainingNull", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveUnionContainingNull_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveUnionContainingNull"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveUnionContainingNull_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43554 JS_FNSPEC("receiveNullableUnion", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableUnion_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableUnion"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableUnion_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43555 JS_FNSPEC("receiveNullableUnion2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableUnion2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableUnion2"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableUnion2_methodinfo)},
0, JSPROP_ENUMERATE, nullptr}
,
43556 JS_FNSPEC("passPromise", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passPromise_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passPromise"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passPromise_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43557 JS_FNSPEC("passOptionalPromise", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOptionalPromise_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOptionalPromise"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOptionalPromise_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43558 JS_FNSPEC("passPromiseSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passPromiseSequence_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passPromiseSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passPromiseSequence_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43559 JS_FNSPEC("receivePromise", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&receivePromise_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receivePromise"), {(GenericMethod<NormalThisPolicy
, ConvertExceptionsToPromises>), reinterpret_cast<const
JSJitInfo*>(&receivePromise_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43560 JS_FNSPEC("receiveAddrefedPromise", (GenericMethod<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast<const JSJitInfo*>(&receiveAddrefedPromise_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveAddrefedPromise"), {(GenericMethod
<NormalThisPolicy, ConvertExceptionsToPromises>), reinterpret_cast
<const JSJitInfo*>(&receiveAddrefedPromise_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43561 JS_FNSPEC("methodRenamedFrom", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&methodRenamedFrom_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("methodRenamedFrom"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&methodRenamedFrom_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43562 JS_FNSPEC("passDictionary", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passDictionary_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passDictionary"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&passDictionary_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43563 JS_FNSPEC("passDictionary2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passDictionary2_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passDictionary2"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&passDictionary2_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43564 JS_FNSPEC("receiveDictionary", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveDictionary_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveDictionary"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&receiveDictionary_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43565 JS_FNSPEC("receiveNullableDictionary", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveNullableDictionary_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveNullableDictionary"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveNullableDictionary_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43566 JS_FNSPEC("passOtherDictionary", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passOtherDictionary_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passOtherDictionary"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passOtherDictionary_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43567 JS_FNSPEC("passSequenceOfDictionaries", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passSequenceOfDictionaries_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passSequenceOfDictionaries"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passSequenceOfDictionaries_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43568 JS_FNSPEC("passRecordOfDictionaries", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRecordOfDictionaries_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRecordOfDictionaries"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRecordOfDictionaries_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43569 JS_FNSPEC("passDictionaryOrLong", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passDictionaryOrLong_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passDictionaryOrLong"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passDictionaryOrLong_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43570 JS_FNSPEC("passDictContainingDict", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passDictContainingDict_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passDictContainingDict"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passDictContainingDict_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43571 JS_FNSPEC("passDictContainingSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passDictContainingSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passDictContainingSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passDictContainingSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43572 JS_FNSPEC("receiveDictContainingSequence", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&receiveDictContainingSequence_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("receiveDictContainingSequence"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&receiveDictContainingSequence_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43573 JS_FNSPEC("passVariadicDictionary", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicDictionary_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicDictionary"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicDictionary_methodinfo)}
, 0, JSPROP_ENUMERATE, nullptr}
,
43574 JS_FNSPEC("dontEnforceRangeOrClamp", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&dontEnforceRangeOrClamp_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("dontEnforceRangeOrClamp"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&dontEnforceRangeOrClamp_methodinfo)
}, 1, JSPROP_ENUMERATE, nullptr}
,
43575 JS_FNSPEC("doEnforceRange", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&doEnforceRange_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("doEnforceRange"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&doEnforceRange_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr
}
,
43576 JS_FNSPEC("doEnforceRangeNullable", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&doEnforceRangeNullable_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("doEnforceRangeNullable"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&doEnforceRangeNullable_methodinfo)}
, 1, JSPROP_ENUMERATE, nullptr}
,
43577 JS_FNSPEC("doClamp", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&doClamp_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("doClamp"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&doClamp_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43578 JS_FNSPEC("doClampNullable", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&doClampNullable_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("doClampNullable"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&doClampNullable_methodinfo)}, 1, JSPROP_ENUMERATE
, nullptr}
,
43579 JS_FNSPEC("exerciseTypedefInterfaces1", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&exerciseTypedefInterfaces1_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("exerciseTypedefInterfaces1"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&exerciseTypedefInterfaces1_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43580 JS_FNSPEC("exerciseTypedefInterfaces2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&exerciseTypedefInterfaces2_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("exerciseTypedefInterfaces2"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&exerciseTypedefInterfaces2_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43581 JS_FNSPEC("exerciseTypedefInterfaces3", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&exerciseTypedefInterfaces3_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("exerciseTypedefInterfaces3"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&exerciseTypedefInterfaces3_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43582 JS_FNSPEC("deprecatedMethod", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deprecatedMethod_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("deprecatedMethod"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&deprecatedMethod_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43583 JS_FNSPEC("deprecatedMethodWithContext", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&deprecatedMethodWithContext_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("deprecatedMethodWithContext"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&deprecatedMethodWithContext_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43584 JS_FNSPEC("overload1", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload1_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload1"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload1_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43585 JS_FNSPEC("overload2", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload2_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload2"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload2_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43586 JS_FNSPEC("overload3", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload3_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload3"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload3_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43587 JS_FNSPEC("overload4", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload4_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload4"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload4_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43588 JS_FNSPEC("overload5", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload5_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload5"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload5_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43589 JS_FNSPEC("overload6", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload6_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload6"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload6_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43590 JS_FNSPEC("overload7", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload7_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload7"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload7_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43591 JS_FNSPEC("overload8", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload8_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload8"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload8_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43592 JS_FNSPEC("overload9", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload9_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload9"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload9_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43593 JS_FNSPEC("overload10", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload10_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload10"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload10_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43594 JS_FNSPEC("overload11", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload11_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload11"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload11_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43595 JS_FNSPEC("overload12", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload12_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload12"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload12_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43596 JS_FNSPEC("overload13", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload13_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload13"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload13_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43597 JS_FNSPEC("overload14", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload14_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload14"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload14_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43598 JS_FNSPEC("overload15", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload15_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload15"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload15_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43599 JS_FNSPEC("overload16", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload16_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload16"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload16_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43600 JS_FNSPEC("overload17", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload17_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload17"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload17_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43601 JS_FNSPEC("overload18", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload18_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload18"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload18_methodinfo)}, 1, JSPROP_ENUMERATE, nullptr}
,
43602 JS_FNSPEC("overload19", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload19_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload19"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload19_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43603 JS_FNSPEC("overload20", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&overload20_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("overload20"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&overload20_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43604 JS_FNSPEC("passVariadicThirdArg", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passVariadicThirdArg_methodinfo), 2, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passVariadicThirdArg"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passVariadicThirdArg_methodinfo)}, 2
, JSPROP_ENUMERATE, nullptr}
,
43605 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43606 JS_FNSPEC("prefable10", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable10_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable10"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable10_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43607 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43608 JS_FNSPEC("prefable11", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable11_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable11"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable11_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43609 JS_FNSPEC("prefable13", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable13_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable13"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable13_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43610 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43611 JS_FNSPEC("prefable17", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable17_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable17"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable17_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43612 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43613 JS_FNSPEC("prefable18", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable18_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable18"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable18_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43614 JS_FNSPEC("prefable19", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable19_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable19"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable19_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43615 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43616 JS_FNSPEC("conditionalOnSecureContext5", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&conditionalOnSecureContext5_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("conditionalOnSecureContext5"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&conditionalOnSecureContext5_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43617 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43618 JS_FNSPEC("conditionalOnSecureContext6", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&conditionalOnSecureContext6_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("conditionalOnSecureContext6"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&conditionalOnSecureContext6_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43619 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43620 JS_FNSPEC("conditionalOnSecureContext7", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&conditionalOnSecureContext7_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("conditionalOnSecureContext7"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&conditionalOnSecureContext7_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43621 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43622 JS_FNSPEC("conditionalOnSecureContext8", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&conditionalOnSecureContext8_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("conditionalOnSecureContext8"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&conditionalOnSecureContext8_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43623 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
,
43624 JS_FNSPEC("passRenamedInterface", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passRenamedInterface_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passRenamedInterface"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passRenamedInterface_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43625 JS_FNSPEC("throwingMethod", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&throwingMethod_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("throwingMethod"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&throwingMethod_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43626 JS_FNSPEC("canOOMMethod", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&canOOMMethod_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("canOOMMethod"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&canOOMMethod_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43627 JS_FNSPEC("ceReactionsMethod", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&ceReactionsMethod_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("ceReactionsMethod"), {(GenericMethod<
NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const
JSJitInfo*>(&ceReactionsMethod_methodinfo)}, 0, JSPROP_ENUMERATE
, nullptr}
,
43628 JS_FNSPEC("ceReactionsMethodOverload", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&ceReactionsMethodOverload_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("ceReactionsMethodOverload"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&ceReactionsMethodOverload_methodinfo
)}, 0, JSPROP_ENUMERATE, nullptr}
,
43629 JS_FNSPEC("passArgsWithDefaults", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passArgsWithDefaults_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passArgsWithDefaults"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passArgsWithDefaults_methodinfo)}, 0
, JSPROP_ENUMERATE, nullptr}
,
43630 JS_FNSPEC("toJSON", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&toJSON_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("toJSON"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&toJSON_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43631 JS_FNSPEC("dashed-method", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&dashed_method_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("dashed-method"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&dashed_method_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr
}
,
43632 JS_FNSPEC("nonEnumerableMethod", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&nonEnumerableMethod_methodinfo), 0, 0, nullptr){JSFunctionSpec::Name("nonEnumerableMethod"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&nonEnumerableMethod_methodinfo)}, 0
, 0, nullptr}
,
43633 JS_FNSPEC("passAllowSharedArrayBufferViewTypedef", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedArrayBufferViewTypedef_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedArrayBufferViewTypedef"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passAllowSharedArrayBufferViewTypedef_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43634 JS_FNSPEC("passAllowSharedArrayBufferView", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedArrayBufferView_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedArrayBufferView"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passAllowSharedArrayBufferView_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43635 JS_FNSPEC("passAllowSharedNullableArrayBufferView", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedNullableArrayBufferView_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedNullableArrayBufferView"
), {(GenericMethod<NormalThisPolicy, ThrowExceptions>),
reinterpret_cast<const JSJitInfo*>(&passAllowSharedNullableArrayBufferView_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43636 JS_FNSPEC("passAllowSharedArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passAllowSharedArrayBuffer_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43637 JS_FNSPEC("passAllowSharedNullableArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passAllowSharedNullableArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passAllowSharedNullableArrayBuffer"), {
(GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast
<const JSJitInfo*>(&passAllowSharedNullableArrayBuffer_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43638 JS_FNSPEC("passUnionArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionArrayBuffer_methodinfo)}, 1
, JSPROP_ENUMERATE, nullptr}
,
43639 JS_FNSPEC("passUnionAllowSharedArrayBuffer", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&passUnionAllowSharedArrayBuffer_methodinfo), 1, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("passUnionAllowSharedArrayBuffer"), {(GenericMethod
<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<
const JSJitInfo*>(&passUnionAllowSharedArrayBuffer_methodinfo
)}, 1, JSPROP_ENUMERATE, nullptr}
,
43640 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43641};
43642
43643static const PrefableDisablers sMethods_disablers418 = {
43644 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43645};
43646
43647static const PrefableDisablers sMethods_disablers420 = {
43648 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43649};
43650
43651static const PrefableDisablers sMethods_disablers423 = {
43652 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
43653};
43654
43655static const PrefableDisablers sMethods_disablers425 = {
43656 WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember
43657};
43658
43659static const PrefableDisablers sMethods_disablers428 = {
43660 WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr
43661};
43662
43663static const PrefableDisablers sMethods_disablers430 = {
43664 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr
43665};
43666
43667static const PrefableDisablers sMethods_disablers432 = {
43668 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43669};
43670
43671static const PrefableDisablers sMethods_disablers434 = {
43672 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember
43673};
43674
43675static const Prefable<const JSFunctionSpec> sMethods[] = {
43676 { nullptr, &sMethods_specs[0] },
43677 { &sMethods_disablers418, &sMethods_specs[418] },
43678 { &sMethods_disablers420, &sMethods_specs[420] },
43679 { &sMethods_disablers423, &sMethods_specs[423] },
43680 { &sMethods_disablers425, &sMethods_specs[425] },
43681 { &sMethods_disablers428, &sMethods_specs[428] },
43682 { &sMethods_disablers430, &sMethods_specs[430] },
43683 { &sMethods_disablers432, &sMethods_specs[432] },
43684 { &sMethods_disablers434, &sMethods_specs[434] },
43685 { nullptr, &sMethods_specs[436] },
43686 { nullptr, nullptr }
43687};
43688
43689static_assert(10 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43690 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43691static_assert(417 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43692 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43693
43694static const JSFunctionSpec sChromeMethods_specs[] = {
43695 JS_FNSPEC("prefable20", (GenericMethod<NormalThisPolicy, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>(&prefable20_methodinfo), 0, JSPROP_ENUMERATE, nullptr){JSFunctionSpec::Name("prefable20"), {(GenericMethod<NormalThisPolicy
, ThrowExceptions>), reinterpret_cast<const JSJitInfo*>
(&prefable20_methodinfo)}, 0, JSPROP_ENUMERATE, nullptr}
,
43696 JS_FS_END{JSFunctionSpec::Name(nullptr), {nullptr, nullptr}, 0, 0, nullptr
}
43697};
43698
43699static const PrefableDisablers sChromeMethods_disablers0 = {
43700 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
43701};
43702
43703static const Prefable<const JSFunctionSpec> sChromeMethods[] = {
43704 { &sChromeMethods_disablers0, &sChromeMethods_specs[0] },
43705 { nullptr, nullptr }
43706};
43707
43708static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43709 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43710static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43711 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43712
43713static const JSPropertySpec sAttributes_specs[] = {
43714 JSPropertySpec::nativeAccessors("readonlyByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyByte_getterinfo, nullptr, nullptr),
43715 JSPropertySpec::nativeAccessors("writableByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableByte_getterinfo, GenericSetter<NormalThisPolicy>, &writableByte_setterinfo),
43716 JSPropertySpec::nativeAccessors("sideEffectFreeByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &sideEffectFreeByte_getterinfo, GenericSetter<NormalThisPolicy>, &sideEffectFreeByte_setterinfo),
43717 JSPropertySpec::nativeAccessors("domDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &domDependentByte_getterinfo, GenericSetter<NormalThisPolicy>, &domDependentByte_setterinfo),
43718 JSPropertySpec::nativeAccessors("constantByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &constantByte_getterinfo, nullptr, nullptr),
43719 JSPropertySpec::nativeAccessors("deviceStateDependentByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deviceStateDependentByte_getterinfo, nullptr, nullptr),
43720 JSPropertySpec::nativeAccessors("readonlyShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyShort_getterinfo, nullptr, nullptr),
43721 JSPropertySpec::nativeAccessors("writableShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableShort_setterinfo),
43722 JSPropertySpec::nativeAccessors("readonlyLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLong_getterinfo, nullptr, nullptr),
43723 JSPropertySpec::nativeAccessors("writableLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLong_setterinfo),
43724 JSPropertySpec::nativeAccessors("readonlyLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyLongLong_getterinfo, nullptr, nullptr),
43725 JSPropertySpec::nativeAccessors("writableLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableLongLong_setterinfo),
43726 JSPropertySpec::nativeAccessors("readonlyOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyOctet_getterinfo, nullptr, nullptr),
43727 JSPropertySpec::nativeAccessors("writableOctet", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableOctet_getterinfo, GenericSetter<NormalThisPolicy>, &writableOctet_setterinfo),
43728 JSPropertySpec::nativeAccessors("readonlyUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedShort_getterinfo, nullptr, nullptr),
43729 JSPropertySpec::nativeAccessors("writableUnsignedShort", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedShort_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedShort_setterinfo),
43730 JSPropertySpec::nativeAccessors("readonlyUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLong_getterinfo, nullptr, nullptr),
43731 JSPropertySpec::nativeAccessors("writableUnsignedLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLong_setterinfo),
43732 JSPropertySpec::nativeAccessors("readonlyUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyUnsignedLongLong_getterinfo, nullptr, nullptr),
43733 JSPropertySpec::nativeAccessors("writableUnsignedLongLong", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnsignedLongLong_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnsignedLongLong_setterinfo),
43734 JSPropertySpec::nativeAccessors("writableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableFloat_setterinfo),
43735 JSPropertySpec::nativeAccessors("writableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedFloat_setterinfo),
43736 JSPropertySpec::nativeAccessors("writableNullableFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableFloat_setterinfo),
43737 JSPropertySpec::nativeAccessors("writableNullableUnrestrictedFloat", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedFloat_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedFloat_setterinfo),
43738 JSPropertySpec::nativeAccessors("writableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableDouble_setterinfo),
43739 JSPropertySpec::nativeAccessors("writableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnrestrictedDouble_setterinfo),
43740 JSPropertySpec::nativeAccessors("writableNullableDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableDouble_setterinfo),
43741 JSPropertySpec::nativeAccessors("writableNullableUnrestrictedDouble", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnrestrictedDouble_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnrestrictedDouble_setterinfo),
43742 JSPropertySpec::nativeAccessors("lenientFloatAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientFloatAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientFloatAttr_setterinfo),
43743 JSPropertySpec::nativeAccessors("lenientDoubleAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &lenientDoubleAttr_getterinfo, GenericSetter<NormalThisPolicy>, &lenientDoubleAttr_setterinfo),
43744 JSPropertySpec::nativeAccessors("nonNullSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullSelf_setterinfo),
43745 JSPropertySpec::nativeAccessors("nullableSelf", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableSelf_getterinfo, GenericSetter<NormalThisPolicy>, &nullableSelf_setterinfo),
43746 JSPropertySpec::nativeAccessors("nonNullExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullExternal_setterinfo),
43747 JSPropertySpec::nativeAccessors("nullableExternal", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableExternal_getterinfo, GenericSetter<NormalThisPolicy>, &nullableExternal_setterinfo),
43748 JSPropertySpec::nativeAccessors("nonNullCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonNullCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nonNullCallbackInterface_setterinfo),
43749 JSPropertySpec::nativeAccessors("nullableCallbackInterface", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nullableCallbackInterface_getterinfo, GenericSetter<NormalThisPolicy>, &nullableCallbackInterface_setterinfo),
43750 JSPropertySpec::nativeAccessors("uint8ArrayAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &uint8ArrayAttr_getterinfo, GenericSetter<NormalThisPolicy>, &uint8ArrayAttr_setterinfo),
43751 JSPropertySpec::nativeAccessors("readonlyJSStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyJSStringAttr_getterinfo, nullptr, nullptr),
43752 JSPropertySpec::nativeAccessors("jsStringAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &jsStringAttr_getterinfo, GenericSetter<NormalThisPolicy>, &jsStringAttr_setterinfo),
43753 JSPropertySpec::nativeAccessors("enumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enumAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &enumAttribute_setterinfo),
43754 JSPropertySpec::nativeAccessors("readonlyEnumAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &readonlyEnumAttribute_getterinfo, nullptr, nullptr),
43755 JSPropertySpec::nativeAccessors("writableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnion_setterinfo),
43756 JSPropertySpec::nativeAccessors("writableUnionContainingNull", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableUnionContainingNull_getterinfo, GenericSetter<NormalThisPolicy>, &writableUnionContainingNull_setterinfo),
43757 JSPropertySpec::nativeAccessors("writableNullableUnion", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &writableNullableUnion_getterinfo, GenericSetter<NormalThisPolicy>, &writableNullableUnion_setterinfo),
43758 JSPropertySpec::nativeAccessors("attributeGetterRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeGetterRenamedFrom_getterinfo, nullptr, nullptr),
43759 JSPropertySpec::nativeAccessors("attributeRenamedFrom", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &attributeRenamedFrom_getterinfo, GenericSetter<NormalThisPolicy>, &attributeRenamedFrom_setterinfo),
43760 JSPropertySpec::nativeAccessors("enforcedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByte_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByte_setterinfo),
43761 JSPropertySpec::nativeAccessors("enforcedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &enforcedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &enforcedByteNullable_setterinfo),
43762 JSPropertySpec::nativeAccessors("clampedByte", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByte_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByte_setterinfo),
43763 JSPropertySpec::nativeAccessors("clampedByteNullable", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &clampedByteNullable_getterinfo, GenericSetter<NormalThisPolicy>, &clampedByteNullable_setterinfo),
43764 JSPropertySpec::nativeAccessors("deprecatedAttribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &deprecatedAttribute_getterinfo, GenericSetter<NormalThisPolicy>, &deprecatedAttribute_setterinfo),
43765 JS_PS_ENDJSPropertySpec::sentinel(),
43766 JSPropertySpec::nativeAccessors("prefable1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable1_getterinfo, nullptr, nullptr),
43767 JSPropertySpec::nativeAccessors("prefable2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable2_getterinfo, nullptr, nullptr),
43768 JS_PS_ENDJSPropertySpec::sentinel(),
43769 JSPropertySpec::nativeAccessors("prefable3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable3_getterinfo, nullptr, nullptr),
43770 JSPropertySpec::nativeAccessors("prefable4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable4_getterinfo, nullptr, nullptr),
43771 JS_PS_ENDJSPropertySpec::sentinel(),
43772 JSPropertySpec::nativeAccessors("prefable5", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable5_getterinfo, nullptr, nullptr),
43773 JS_PS_ENDJSPropertySpec::sentinel(),
43774 JSPropertySpec::nativeAccessors("prefable6", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable6_getterinfo, nullptr, nullptr),
43775 JSPropertySpec::nativeAccessors("prefable7", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable7_getterinfo, nullptr, nullptr),
43776 JS_PS_ENDJSPropertySpec::sentinel(),
43777 JSPropertySpec::nativeAccessors("prefable8", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable8_getterinfo, nullptr, nullptr),
43778 JS_PS_ENDJSPropertySpec::sentinel(),
43779 JSPropertySpec::nativeAccessors("prefable9", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable9_getterinfo, nullptr, nullptr),
43780 JS_PS_ENDJSPropertySpec::sentinel(),
43781 JSPropertySpec::nativeAccessors("prefable12", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable12_getterinfo, nullptr, nullptr),
43782 JSPropertySpec::nativeAccessors("prefable14", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable14_getterinfo, nullptr, nullptr),
43783 JS_PS_ENDJSPropertySpec::sentinel(),
43784 JSPropertySpec::nativeAccessors("prefable15", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable15_getterinfo, nullptr, nullptr),
43785 JSPropertySpec::nativeAccessors("prefable16", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &prefable16_getterinfo, nullptr, nullptr),
43786 JS_PS_ENDJSPropertySpec::sentinel(),
43787 JSPropertySpec::nativeAccessors("conditionalOnSecureContext1", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext1_getterinfo, nullptr, nullptr),
43788 JS_PS_ENDJSPropertySpec::sentinel(),
43789 JSPropertySpec::nativeAccessors("conditionalOnSecureContext2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext2_getterinfo, nullptr, nullptr),
43790 JS_PS_ENDJSPropertySpec::sentinel(),
43791 JSPropertySpec::nativeAccessors("conditionalOnSecureContext3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext3_getterinfo, nullptr, nullptr),
43792 JS_PS_ENDJSPropertySpec::sentinel(),
43793 JSPropertySpec::nativeAccessors("conditionalOnSecureContext4", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &conditionalOnSecureContext4_getterinfo, nullptr, nullptr),
43794 JS_PS_ENDJSPropertySpec::sentinel(),
43795 JSPropertySpec::nativeAccessors("attrWithLenientThis", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &attrWithLenientThis_getterinfo, GenericSetter<LenientThisPolicy>, &attrWithLenientThis_setterinfo),
43796 JSPropertySpec::nativeAccessors("putForwardsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr_setterinfo),
43797 JSPropertySpec::nativeAccessors("putForwardsAttr2", JSPROP_ENUMERATE, GenericGetter<LenientThisPolicy, ThrowExceptions>, &putForwardsAttr2_getterinfo, GenericSetter<LenientThisPolicy>, &putForwardsAttr2_setterinfo),
43798 JSPropertySpec::nativeAccessors("throwingAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingAttr_setterinfo),
43799 JSPropertySpec::nativeAccessors("throwingGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingGetterAttr_setterinfo),
43800 JSPropertySpec::nativeAccessors("throwingSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &throwingSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &throwingSetterAttr_setterinfo),
43801 JSPropertySpec::nativeAccessors("canOOMAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMAttr_setterinfo),
43802 JSPropertySpec::nativeAccessors("canOOMGetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMGetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMGetterAttr_setterinfo),
43803 JSPropertySpec::nativeAccessors("canOOMSetterAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &canOOMSetterAttr_getterinfo, GenericSetter<NormalThisPolicy>, &canOOMSetterAttr_setterinfo),
43804 JSPropertySpec::nativeAccessors("ceReactionsAttr", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &ceReactionsAttr_getterinfo, GenericSetter<NormalThisPolicy>, &ceReactionsAttr_setterinfo),
43805 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis_setterinfo),
43806 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis2", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis2_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis2_setterinfo),
43807 JSPropertySpec::nativeAccessors("toJSONShouldSkipThis3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &toJSONShouldSkipThis3_getterinfo, GenericSetter<NormalThisPolicy>, &toJSONShouldSkipThis3_setterinfo),
43808 JSPropertySpec::nativeAccessors("dashed-attribute", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &dashed_attribute_getterinfo, GenericSetter<NormalThisPolicy>, &dashed_attribute_setterinfo),
43809 JSPropertySpec::nativeAccessors("nonEnumerableAttr", 0, GenericGetter<NormalThisPolicy, ThrowExceptions>, &nonEnumerableAttr_getterinfo, GenericSetter<NormalThisPolicy>, &nonEnumerableAttr_setterinfo),
43810 JSPropertySpec::nativeAccessors("allowSharedArrayBufferViewTypedef", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferViewTypedef_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferViewTypedef_setterinfo),
43811 JSPropertySpec::nativeAccessors("allowSharedArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBufferView_setterinfo),
43812 JSPropertySpec::nativeAccessors("allowSharedNullableArrayBufferView", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBufferView_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBufferView_setterinfo),
43813 JSPropertySpec::nativeAccessors("allowSharedArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedArrayBuffer_setterinfo),
43814 JSPropertySpec::nativeAccessors("allowSharedNullableArrayBuffer", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &allowSharedNullableArrayBuffer_getterinfo, GenericSetter<NormalThisPolicy>, &allowSharedNullableArrayBuffer_setterinfo),
43815 JS_PS_ENDJSPropertySpec::sentinel()
43816};
43817
43818static const PrefableDisablers sAttributes_disablers52 = {
43819 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43820};
43821
43822static const PrefableDisablers sAttributes_disablers55 = {
43823 WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), nullptr
43824};
43825
43826static const PrefableDisablers sAttributes_disablers58 = {
43827 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), nullptr
43828};
43829
43830static const PrefableDisablers sAttributes_disablers60 = {
43831 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43832};
43833
43834static const PrefableDisablers sAttributes_disablers63 = {
43835 WebIDLPrefIndex::dom_webidl_test2, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43836};
43837
43838static const PrefableDisablers sAttributes_disablers65 = {
43839 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43840};
43841
43842static const PrefableDisablers sAttributes_disablers67 = {
43843 WebIDLPrefIndex::dom_webidl_test1, 0, false, OriginTrial(0), &TestFuncControlledMember
43844};
43845
43846static const PrefableDisablers sAttributes_disablers70 = {
43847 WebIDLPrefIndex::NoPref, 0, false, OriginTrial(0), &TestFuncControlledMember
43848};
43849
43850static const PrefableDisablers sAttributes_disablers73 = {
43851 WebIDLPrefIndex::NoPref, 0, true, OriginTrial(0), nullptr
43852};
43853
43854static const PrefableDisablers sAttributes_disablers75 = {
43855 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), nullptr
43856};
43857
43858static const PrefableDisablers sAttributes_disablers77 = {
43859 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &nsGenericHTMLElement::LegacyTouchAPIEnabled
43860};
43861
43862static const PrefableDisablers sAttributes_disablers79 = {
43863 WebIDLPrefIndex::dom_webidl_test1, 0, true, OriginTrial(0), &TestFuncControlledMember
43864};
43865
43866static const Prefable<const JSPropertySpec> sAttributes[] = {
43867 { nullptr, &sAttributes_specs[0] },
43868 { &sAttributes_disablers52, &sAttributes_specs[52] },
43869 { &sAttributes_disablers55, &sAttributes_specs[55] },
43870 { &sAttributes_disablers58, &sAttributes_specs[58] },
43871 { &sAttributes_disablers60, &sAttributes_specs[60] },
43872 { &sAttributes_disablers63, &sAttributes_specs[63] },
43873 { &sAttributes_disablers65, &sAttributes_specs[65] },
43874 { &sAttributes_disablers67, &sAttributes_specs[67] },
43875 { &sAttributes_disablers70, &sAttributes_specs[70] },
43876 { &sAttributes_disablers73, &sAttributes_specs[73] },
43877 { &sAttributes_disablers75, &sAttributes_specs[75] },
43878 { &sAttributes_disablers77, &sAttributes_specs[77] },
43879 { &sAttributes_disablers79, &sAttributes_specs[79] },
43880 { nullptr, &sAttributes_specs[81] },
43881 { nullptr, nullptr }
43882};
43883
43884static_assert(14 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43885 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43886static_assert(51 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43887 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43888
43889static const JSPropertySpec sChromeAttributes_specs[] = {
43890 JSPropertySpec::nativeAccessors("putForwardsAttr3", JSPROP_ENUMERATE, GenericGetter<NormalThisPolicy, ThrowExceptions>, &putForwardsAttr3_getterinfo, GenericSetter<NormalThisPolicy>, &putForwardsAttr3_setterinfo),
43891 JS_PS_ENDJSPropertySpec::sentinel()
43892};
43893
43894
43895static const Prefable<const JSPropertySpec> sChromeAttributes[] = {
43896 { nullptr, &sChromeAttributes_specs[0] },
43897 { nullptr, nullptr }
43898};
43899
43900static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43901 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43902static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43903 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43904
43905static const ConstantSpec sConstants_specs[] = {
43906 { "myLongConstant", JS::Int32Value(5) },
43907 { "nonEnumerableConst", JS::BooleanValue(true) },
43908 { 0, JS::UndefinedValue() }
43909};
43910
43911
43912static const Prefable<const ConstantSpec> sConstants[] = {
43913 { nullptr, &sConstants_specs[0] },
43914 { nullptr, nullptr }
43915};
43916
43917static_assert(1 <= 1ull << NUM_BITS_PROPERTY_INFO_PREF_INDEX13,
43918 "We have a prefable index that is >= (1 << NUM_BITS_PROPERTY_INFO_PREF_INDEX)");
43919static_assert(2 <= 1ull << NUM_BITS_PROPERTY_INFO_SPEC_INDEX16,
43920 "We have a spec index that is >= (1 << NUM_BITS_PROPERTY_INFO_SPEC_INDEX)");
43921
43922
43923static uint16_t sNativeProperties_sortedPropertyIndices[533];
43924static PropertyInfo sNativeProperties_propertyInfos[533];
43925
43926static const NativePropertiesN<3> sNativeProperties = {
43927 false, 0,
43928 false, 0,
43929 true, 0 /* sMethods */,
43930 true, 1 /* sAttributes */,
43931 false, 0,
43932 false, 0,
43933 true, 2 /* sConstants */,
43934 -1,
43935 533,
43936 sNativeProperties_sortedPropertyIndices,
43937 {
43938 { sMethods, &sNativeProperties_propertyInfos[0] },
43939 { sAttributes, &sNativeProperties_propertyInfos[443] },
43940 { sConstants, &sNativeProperties_propertyInfos[531] }
43941 }
43942};
43943static_assert(533 < 1ull << (CHAR_BIT8 * sizeof(sNativeProperties.propertyInfoCount)),
43944 "We have a property info count that is oversized");
43945
43946static uint16_t sChromeOnlyNativeProperties_sortedPropertyIndices[3];
43947static PropertyInfo sChromeOnlyNativeProperties_propertyInfos[3];
43948
43949static const NativePropertiesN<3> sChromeOnlyNativeProperties = {
43950 true, 0 /* sChromeStaticMethods */,
43951 false, 0,
43952 true, 1 /* sChromeMethods */,
43953 true, 2 /* sChromeAttributes */,
43954 false, 0,
43955 false, 0,
43956 false, 0,
43957 -1,
43958 3,
43959 sChromeOnlyNativeProperties_sortedPropertyIndices,
43960 {
43961 { sChromeStaticMethods, &sChromeOnlyNativeProperties_propertyInfos[0] },
43962 { sChromeMethods, &sChromeOnlyNativeProperties_propertyInfos[1] },
43963 { sChromeAttributes, &sChromeOnlyNativeProperties_propertyInfos[2] }
43964 }
43965};
43966static_assert(3 < 1ull << (CHAR_BIT8 * sizeof(sChromeOnlyNativeProperties.propertyInfoCount)),
43967 "We have a property info count that is oversized");
43968
43969MOZ_CAN_RUN_SCRIPT bool
43970CollectJSONAttributes(JSContext* cx, JS::Handle<JSObject*> obj, mozilla::dom::TestJSImplInterface* self, JS::Rooted<JSObject*>& result)
43971{
43972 JS::Rooted<JSObject*> unwrappedObj(cx, js::CheckedUnwrapStatic(obj));
43973 if (!unwrappedObj) {
43974 // How did that happen? We managed to get called with that
43975 // object as "this"! Just give up on sanity.
43976 return false;
43977 }
43978
43979 { // scope for "temp"
43980 JS::Rooted<JS::Value> temp(cx);
43981 if (!get_readonlyByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
43982 return false;
43983 }
43984 if (!JS_DefineProperty(cx, result, "readonlyByte", temp, JSPROP_ENUMERATE)) {
43985 return false;
43986 }
43987 }
43988 { // scope for "temp"
43989 JS::Rooted<JS::Value> temp(cx);
43990 if (!get_writableByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
43991 return false;
43992 }
43993 if (!JS_DefineProperty(cx, result, "writableByte", temp, JSPROP_ENUMERATE)) {
43994 return false;
43995 }
43996 }
43997 { // scope for "temp"
43998 JS::Rooted<JS::Value> temp(cx);
43999 if (!get_sideEffectFreeByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44000 return false;
44001 }
44002 if (!JS_DefineProperty(cx, result, "sideEffectFreeByte", temp, JSPROP_ENUMERATE)) {
44003 return false;
44004 }
44005 }
44006 { // scope for "temp"
44007 JS::Rooted<JS::Value> temp(cx);
44008 if (!get_domDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44009 return false;
44010 }
44011 if (!JS_DefineProperty(cx, result, "domDependentByte", temp, JSPROP_ENUMERATE)) {
44012 return false;
44013 }
44014 }
44015 { // scope for "temp"
44016 JS::Rooted<JS::Value> temp(cx);
44017 if (!get_constantByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44018 return false;
44019 }
44020 if (!JS_DefineProperty(cx, result, "constantByte", temp, JSPROP_ENUMERATE)) {
44021 return false;
44022 }
44023 }
44024 { // scope for "temp"
44025 JS::Rooted<JS::Value> temp(cx);
44026 if (!get_deviceStateDependentByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44027 return false;
44028 }
44029 if (!JS_DefineProperty(cx, result, "deviceStateDependentByte", temp, JSPROP_ENUMERATE)) {
44030 return false;
44031 }
44032 }
44033 { // scope for "temp"
44034 JS::Rooted<JS::Value> temp(cx);
44035 if (!get_readonlyShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44036 return false;
44037 }
44038 if (!JS_DefineProperty(cx, result, "readonlyShort", temp, JSPROP_ENUMERATE)) {
44039 return false;
44040 }
44041 }
44042 { // scope for "temp"
44043 JS::Rooted<JS::Value> temp(cx);
44044 if (!get_writableShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44045 return false;
44046 }
44047 if (!JS_DefineProperty(cx, result, "writableShort", temp, JSPROP_ENUMERATE)) {
44048 return false;
44049 }
44050 }
44051 { // scope for "temp"
44052 JS::Rooted<JS::Value> temp(cx);
44053 if (!get_readonlyLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44054 return false;
44055 }
44056 if (!JS_DefineProperty(cx, result, "readonlyLong", temp, JSPROP_ENUMERATE)) {
44057 return false;
44058 }
44059 }
44060 { // scope for "temp"
44061 JS::Rooted<JS::Value> temp(cx);
44062 if (!get_writableLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44063 return false;
44064 }
44065 if (!JS_DefineProperty(cx, result, "writableLong", temp, JSPROP_ENUMERATE)) {
44066 return false;
44067 }
44068 }
44069 { // scope for "temp"
44070 JS::Rooted<JS::Value> temp(cx);
44071 if (!get_readonlyLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44072 return false;
44073 }
44074 if (!JS_DefineProperty(cx, result, "readonlyLongLong", temp, JSPROP_ENUMERATE)) {
44075 return false;
44076 }
44077 }
44078 { // scope for "temp"
44079 JS::Rooted<JS::Value> temp(cx);
44080 if (!get_writableLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44081 return false;
44082 }
44083 if (!JS_DefineProperty(cx, result, "writableLongLong", temp, JSPROP_ENUMERATE)) {
44084 return false;
44085 }
44086 }
44087 { // scope for "temp"
44088 JS::Rooted<JS::Value> temp(cx);
44089 if (!get_readonlyOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44090 return false;
44091 }
44092 if (!JS_DefineProperty(cx, result, "readonlyOctet", temp, JSPROP_ENUMERATE)) {
44093 return false;
44094 }
44095 }
44096 { // scope for "temp"
44097 JS::Rooted<JS::Value> temp(cx);
44098 if (!get_writableOctet(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44099 return false;
44100 }
44101 if (!JS_DefineProperty(cx, result, "writableOctet", temp, JSPROP_ENUMERATE)) {
44102 return false;
44103 }
44104 }
44105 { // scope for "temp"
44106 JS::Rooted<JS::Value> temp(cx);
44107 if (!get_readonlyUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44108 return false;
44109 }
44110 if (!JS_DefineProperty(cx, result, "readonlyUnsignedShort", temp, JSPROP_ENUMERATE)) {
44111 return false;
44112 }
44113 }
44114 { // scope for "temp"
44115 JS::Rooted<JS::Value> temp(cx);
44116 if (!get_writableUnsignedShort(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44117 return false;
44118 }
44119 if (!JS_DefineProperty(cx, result, "writableUnsignedShort", temp, JSPROP_ENUMERATE)) {
44120 return false;
44121 }
44122 }
44123 { // scope for "temp"
44124 JS::Rooted<JS::Value> temp(cx);
44125 if (!get_readonlyUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44126 return false;
44127 }
44128 if (!JS_DefineProperty(cx, result, "readonlyUnsignedLong", temp, JSPROP_ENUMERATE)) {
44129 return false;
44130 }
44131 }
44132 { // scope for "temp"
44133 JS::Rooted<JS::Value> temp(cx);
44134 if (!get_writableUnsignedLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44135 return false;
44136 }
44137 if (!JS_DefineProperty(cx, result, "writableUnsignedLong", temp, JSPROP_ENUMERATE)) {
44138 return false;
44139 }
44140 }
44141 { // scope for "temp"
44142 JS::Rooted<JS::Value> temp(cx);
44143 if (!get_readonlyUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44144 return false;
44145 }
44146 if (!JS_DefineProperty(cx, result, "readonlyUnsignedLongLong", temp, JSPROP_ENUMERATE)) {
44147 return false;
44148 }
44149 }
44150 { // scope for "temp"
44151 JS::Rooted<JS::Value> temp(cx);
44152 if (!get_writableUnsignedLongLong(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44153 return false;
44154 }
44155 if (!JS_DefineProperty(cx, result, "writableUnsignedLongLong", temp, JSPROP_ENUMERATE)) {
44156 return false;
44157 }
44158 }
44159 { // scope for "temp"
44160 JS::Rooted<JS::Value> temp(cx);
44161 if (!get_writableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44162 return false;
44163 }
44164 if (!JS_DefineProperty(cx, result, "writableFloat", temp, JSPROP_ENUMERATE)) {
44165 return false;
44166 }
44167 }
44168 { // scope for "temp"
44169 JS::Rooted<JS::Value> temp(cx);
44170 if (!get_writableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44171 return false;
44172 }
44173 if (!JS_DefineProperty(cx, result, "writableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) {
44174 return false;
44175 }
44176 }
44177 { // scope for "temp"
44178 JS::Rooted<JS::Value> temp(cx);
44179 if (!get_writableNullableFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44180 return false;
44181 }
44182 if (!JS_DefineProperty(cx, result, "writableNullableFloat", temp, JSPROP_ENUMERATE)) {
44183 return false;
44184 }
44185 }
44186 { // scope for "temp"
44187 JS::Rooted<JS::Value> temp(cx);
44188 if (!get_writableNullableUnrestrictedFloat(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44189 return false;
44190 }
44191 if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedFloat", temp, JSPROP_ENUMERATE)) {
44192 return false;
44193 }
44194 }
44195 { // scope for "temp"
44196 JS::Rooted<JS::Value> temp(cx);
44197 if (!get_writableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44198 return false;
44199 }
44200 if (!JS_DefineProperty(cx, result, "writableDouble", temp, JSPROP_ENUMERATE)) {
44201 return false;
44202 }
44203 }
44204 { // scope for "temp"
44205 JS::Rooted<JS::Value> temp(cx);
44206 if (!get_writableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44207 return false;
44208 }
44209 if (!JS_DefineProperty(cx, result, "writableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) {
44210 return false;
44211 }
44212 }
44213 { // scope for "temp"
44214 JS::Rooted<JS::Value> temp(cx);
44215 if (!get_writableNullableDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44216 return false;
44217 }
44218 if (!JS_DefineProperty(cx, result, "writableNullableDouble", temp, JSPROP_ENUMERATE)) {
44219 return false;
44220 }
44221 }
44222 { // scope for "temp"
44223 JS::Rooted<JS::Value> temp(cx);
44224 if (!get_writableNullableUnrestrictedDouble(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44225 return false;
44226 }
44227 if (!JS_DefineProperty(cx, result, "writableNullableUnrestrictedDouble", temp, JSPROP_ENUMERATE)) {
44228 return false;
44229 }
44230 }
44231 { // scope for "temp"
44232 JS::Rooted<JS::Value> temp(cx);
44233 if (!get_lenientFloatAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44234 return false;
44235 }
44236 if (!JS_DefineProperty(cx, result, "lenientFloatAttr", temp, JSPROP_ENUMERATE)) {
44237 return false;
44238 }
44239 }
44240 { // scope for "temp"
44241 JS::Rooted<JS::Value> temp(cx);
44242 if (!get_lenientDoubleAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44243 return false;
44244 }
44245 if (!JS_DefineProperty(cx, result, "lenientDoubleAttr", temp, JSPROP_ENUMERATE)) {
44246 return false;
44247 }
44248 }
44249 { // scope for "temp"
44250 JS::Rooted<JS::Value> temp(cx);
44251 if (!get_nonNullSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44252 return false;
44253 }
44254 if (!JS_DefineProperty(cx, result, "nonNullSelf", temp, JSPROP_ENUMERATE)) {
44255 return false;
44256 }
44257 }
44258 { // scope for "temp"
44259 JS::Rooted<JS::Value> temp(cx);
44260 if (!get_nullableSelf(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44261 return false;
44262 }
44263 if (!JS_DefineProperty(cx, result, "nullableSelf", temp, JSPROP_ENUMERATE)) {
44264 return false;
44265 }
44266 }
44267 { // scope for "temp"
44268 JS::Rooted<JS::Value> temp(cx);
44269 if (!get_readonlyJSStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44270 return false;
44271 }
44272 if (!JS_DefineProperty(cx, result, "readonlyJSStringAttr", temp, JSPROP_ENUMERATE)) {
44273 return false;
44274 }
44275 }
44276 { // scope for "temp"
44277 JS::Rooted<JS::Value> temp(cx);
44278 if (!get_jsStringAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44279 return false;
44280 }
44281 if (!JS_DefineProperty(cx, result, "jsStringAttr", temp, JSPROP_ENUMERATE)) {
44282 return false;
44283 }
44284 }
44285 { // scope for "temp"
44286 JS::Rooted<JS::Value> temp(cx);
44287 if (!get_enumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44288 return false;
44289 }
44290 if (!JS_DefineProperty(cx, result, "enumAttribute", temp, JSPROP_ENUMERATE)) {
44291 return false;
44292 }
44293 }
44294 { // scope for "temp"
44295 JS::Rooted<JS::Value> temp(cx);
44296 if (!get_readonlyEnumAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44297 return false;
44298 }
44299 if (!JS_DefineProperty(cx, result, "readonlyEnumAttribute", temp, JSPROP_ENUMERATE)) {
44300 return false;
44301 }
44302 }
44303 { // scope for "temp"
44304 JS::Rooted<JS::Value> temp(cx);
44305 if (!get_attributeGetterRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44306 return false;
44307 }
44308 if (!JS_DefineProperty(cx, result, "attributeGetterRenamedFrom", temp, JSPROP_ENUMERATE)) {
44309 return false;
44310 }
44311 }
44312 { // scope for "temp"
44313 JS::Rooted<JS::Value> temp(cx);
44314 if (!get_attributeRenamedFrom(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44315 return false;
44316 }
44317 if (!JS_DefineProperty(cx, result, "attributeRenamedFrom", temp, JSPROP_ENUMERATE)) {
44318 return false;
44319 }
44320 }
44321 { // scope for "temp"
44322 JS::Rooted<JS::Value> temp(cx);
44323 if (!get_enforcedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44324 return false;
44325 }
44326 if (!JS_DefineProperty(cx, result, "enforcedByte", temp, JSPROP_ENUMERATE)) {
44327 return false;
44328 }
44329 }
44330 { // scope for "temp"
44331 JS::Rooted<JS::Value> temp(cx);
44332 if (!get_enforcedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44333 return false;
44334 }
44335 if (!JS_DefineProperty(cx, result, "enforcedByteNullable", temp, JSPROP_ENUMERATE)) {
44336 return false;
44337 }
44338 }
44339 { // scope for "temp"
44340 JS::Rooted<JS::Value> temp(cx);
44341 if (!get_clampedByte(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44342 return false;
44343 }
44344 if (!JS_DefineProperty(cx, result, "clampedByte", temp, JSPROP_ENUMERATE)) {
44345 return false;
44346 }
44347 }
44348 { // scope for "temp"
44349 JS::Rooted<JS::Value> temp(cx);
44350 if (!get_clampedByteNullable(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44351 return false;
44352 }
44353 if (!JS_DefineProperty(cx, result, "clampedByteNullable", temp, JSPROP_ENUMERATE)) {
44354 return false;
44355 }
44356 }
44357 { // scope for "temp"
44358 JS::Rooted<JS::Value> temp(cx);
44359 if (!get_deprecatedAttribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44360 return false;
44361 }
44362 if (!JS_DefineProperty(cx, result, "deprecatedAttribute", temp, JSPROP_ENUMERATE)) {
44363 return false;
44364 }
44365 }
44366 // This is unfortunately a linear scan through sAttributes, but we
44367 // only do it for things which _might_ be disabled, which should
44368 // help keep the performance problems down.
44369 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable1, sAttributes)) {
44370 JS::Rooted<JS::Value> temp(cx);
44371 if (!get_prefable1(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44372 return false;
44373 }
44374 if (!JS_DefineProperty(cx, result, "prefable1", temp, JSPROP_ENUMERATE)) {
44375 return false;
44376 }
44377 }
44378 // This is unfortunately a linear scan through sAttributes, but we
44379 // only do it for things which _might_ be disabled, which should
44380 // help keep the performance problems down.
44381 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable2, sAttributes)) {
44382 JS::Rooted<JS::Value> temp(cx);
44383 if (!get_prefable2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44384 return false;
44385 }
44386 if (!JS_DefineProperty(cx, result, "prefable2", temp, JSPROP_ENUMERATE)) {
44387 return false;
44388 }
44389 }
44390 // This is unfortunately a linear scan through sAttributes, but we
44391 // only do it for things which _might_ be disabled, which should
44392 // help keep the performance problems down.
44393 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable3, sAttributes)) {
44394 JS::Rooted<JS::Value> temp(cx);
44395 if (!get_prefable3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44396 return false;
44397 }
44398 if (!JS_DefineProperty(cx, result, "prefable3", temp, JSPROP_ENUMERATE)) {
44399 return false;
44400 }
44401 }
44402 // This is unfortunately a linear scan through sAttributes, but we
44403 // only do it for things which _might_ be disabled, which should
44404 // help keep the performance problems down.
44405 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable4, sAttributes)) {
44406 JS::Rooted<JS::Value> temp(cx);
44407 if (!get_prefable4(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44408 return false;
44409 }
44410 if (!JS_DefineProperty(cx, result, "prefable4", temp, JSPROP_ENUMERATE)) {
44411 return false;
44412 }
44413 }
44414 // This is unfortunately a linear scan through sAttributes, but we
44415 // only do it for things which _might_ be disabled, which should
44416 // help keep the performance problems down.
44417 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable5, sAttributes)) {
44418 JS::Rooted<JS::Value> temp(cx);
44419 if (!get_prefable5(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44420 return false;
44421 }
44422 if (!JS_DefineProperty(cx, result, "prefable5", temp, JSPROP_ENUMERATE)) {
44423 return false;
44424 }
44425 }
44426 // This is unfortunately a linear scan through sAttributes, but we
44427 // only do it for things which _might_ be disabled, which should
44428 // help keep the performance problems down.
44429 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable6, sAttributes)) {
44430 JS::Rooted<JS::Value> temp(cx);
44431 if (!get_prefable6(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44432 return false;
44433 }
44434 if (!JS_DefineProperty(cx, result, "prefable6", temp, JSPROP_ENUMERATE)) {
44435 return false;
44436 }
44437 }
44438 // This is unfortunately a linear scan through sAttributes, but we
44439 // only do it for things which _might_ be disabled, which should
44440 // help keep the performance problems down.
44441 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable7, sAttributes)) {
44442 JS::Rooted<JS::Value> temp(cx);
44443 if (!get_prefable7(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44444 return false;
44445 }
44446 if (!JS_DefineProperty(cx, result, "prefable7", temp, JSPROP_ENUMERATE)) {
44447 return false;
44448 }
44449 }
44450 // This is unfortunately a linear scan through sAttributes, but we
44451 // only do it for things which _might_ be disabled, which should
44452 // help keep the performance problems down.
44453 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable8, sAttributes)) {
44454 JS::Rooted<JS::Value> temp(cx);
44455 if (!get_prefable8(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44456 return false;
44457 }
44458 if (!JS_DefineProperty(cx, result, "prefable8", temp, JSPROP_ENUMERATE)) {
44459 return false;
44460 }
44461 }
44462 // This is unfortunately a linear scan through sAttributes, but we
44463 // only do it for things which _might_ be disabled, which should
44464 // help keep the performance problems down.
44465 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable9, sAttributes)) {
44466 JS::Rooted<JS::Value> temp(cx);
44467 if (!get_prefable9(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44468 return false;
44469 }
44470 if (!JS_DefineProperty(cx, result, "prefable9", temp, JSPROP_ENUMERATE)) {
44471 return false;
44472 }
44473 }
44474 // This is unfortunately a linear scan through sAttributes, but we
44475 // only do it for things which _might_ be disabled, which should
44476 // help keep the performance problems down.
44477 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable12, sAttributes)) {
44478 JS::Rooted<JS::Value> temp(cx);
44479 if (!get_prefable12(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44480 return false;
44481 }
44482 if (!JS_DefineProperty(cx, result, "prefable12", temp, JSPROP_ENUMERATE)) {
44483 return false;
44484 }
44485 }
44486 // This is unfortunately a linear scan through sAttributes, but we
44487 // only do it for things which _might_ be disabled, which should
44488 // help keep the performance problems down.
44489 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable14, sAttributes)) {
44490 JS::Rooted<JS::Value> temp(cx);
44491 if (!get_prefable14(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44492 return false;
44493 }
44494 if (!JS_DefineProperty(cx, result, "prefable14", temp, JSPROP_ENUMERATE)) {
44495 return false;
44496 }
44497 }
44498 // This is unfortunately a linear scan through sAttributes, but we
44499 // only do it for things which _might_ be disabled, which should
44500 // help keep the performance problems down.
44501 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable15, sAttributes)) {
44502 JS::Rooted<JS::Value> temp(cx);
44503 if (!get_prefable15(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44504 return false;
44505 }
44506 if (!JS_DefineProperty(cx, result, "prefable15", temp, JSPROP_ENUMERATE)) {
44507 return false;
44508 }
44509 }
44510 // This is unfortunately a linear scan through sAttributes, but we
44511 // only do it for things which _might_ be disabled, which should
44512 // help keep the performance problems down.
44513 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_prefable16, sAttributes)) {
44514 JS::Rooted<JS::Value> temp(cx);
44515 if (!get_prefable16(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44516 return false;
44517 }
44518 if (!JS_DefineProperty(cx, result, "prefable16", temp, JSPROP_ENUMERATE)) {
44519 return false;
44520 }
44521 }
44522 // This is unfortunately a linear scan through sAttributes, but we
44523 // only do it for things which _might_ be disabled, which should
44524 // help keep the performance problems down.
44525 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext1, sAttributes)) {
44526 JS::Rooted<JS::Value> temp(cx);
44527 if (!get_conditionalOnSecureContext1(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44528 return false;
44529 }
44530 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext1", temp, JSPROP_ENUMERATE)) {
44531 return false;
44532 }
44533 }
44534 // This is unfortunately a linear scan through sAttributes, but we
44535 // only do it for things which _might_ be disabled, which should
44536 // help keep the performance problems down.
44537 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext2, sAttributes)) {
44538 JS::Rooted<JS::Value> temp(cx);
44539 if (!get_conditionalOnSecureContext2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44540 return false;
44541 }
44542 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext2", temp, JSPROP_ENUMERATE)) {
44543 return false;
44544 }
44545 }
44546 // This is unfortunately a linear scan through sAttributes, but we
44547 // only do it for things which _might_ be disabled, which should
44548 // help keep the performance problems down.
44549 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext3, sAttributes)) {
44550 JS::Rooted<JS::Value> temp(cx);
44551 if (!get_conditionalOnSecureContext3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44552 return false;
44553 }
44554 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext3", temp, JSPROP_ENUMERATE)) {
44555 return false;
44556 }
44557 }
44558 // This is unfortunately a linear scan through sAttributes, but we
44559 // only do it for things which _might_ be disabled, which should
44560 // help keep the performance problems down.
44561 if (IsGetterEnabled(cx, unwrappedObj, (JSJitGetterOp)get_conditionalOnSecureContext4, sAttributes)) {
44562 JS::Rooted<JS::Value> temp(cx);
44563 if (!get_conditionalOnSecureContext4(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44564 return false;
44565 }
44566 if (!JS_DefineProperty(cx, result, "conditionalOnSecureContext4", temp, JSPROP_ENUMERATE)) {
44567 return false;
44568 }
44569 }
44570 { // scope for "temp"
44571 JS::Rooted<JS::Value> temp(cx);
44572 if (!get_attrWithLenientThis(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44573 return false;
44574 }
44575 if (!JS_DefineProperty(cx, result, "attrWithLenientThis", temp, JSPROP_ENUMERATE)) {
44576 return false;
44577 }
44578 }
44579 { // scope for "temp"
44580 JS::Rooted<JS::Value> temp(cx);
44581 if (!get_putForwardsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44582 return false;
44583 }
44584 if (!JS_DefineProperty(cx, result, "putForwardsAttr", temp, JSPROP_ENUMERATE)) {
44585 return false;
44586 }
44587 }
44588 { // scope for "temp"
44589 JS::Rooted<JS::Value> temp(cx);
44590 if (!get_putForwardsAttr2(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44591 return false;
44592 }
44593 if (!JS_DefineProperty(cx, result, "putForwardsAttr2", temp, JSPROP_ENUMERATE)) {
44594 return false;
44595 }
44596 }
44597 { // scope for "temp"
44598 JS::Rooted<JS::Value> temp(cx);
44599 if (!get_putForwardsAttr3(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44600 return false;
44601 }
44602 if (!JS_DefineProperty(cx, result, "putForwardsAttr3", temp, JSPROP_ENUMERATE)) {
44603 return false;
44604 }
44605 }
44606 { // scope for "temp"
44607 JS::Rooted<JS::Value> temp(cx);
44608 if (!get_throwingAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44609 return false;
44610 }
44611 if (!JS_DefineProperty(cx, result, "throwingAttr", temp, JSPROP_ENUMERATE)) {
44612 return false;
44613 }
44614 }
44615 { // scope for "temp"
44616 JS::Rooted<JS::Value> temp(cx);
44617 if (!get_throwingGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44618 return false;
44619 }
44620 if (!JS_DefineProperty(cx, result, "throwingGetterAttr", temp, JSPROP_ENUMERATE)) {
44621 return false;
44622 }
44623 }
44624 { // scope for "temp"
44625 JS::Rooted<JS::Value> temp(cx);
44626 if (!get_throwingSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44627 return false;
44628 }
44629 if (!JS_DefineProperty(cx, result, "throwingSetterAttr", temp, JSPROP_ENUMERATE)) {
44630 return false;
44631 }
44632 }
44633 { // scope for "temp"
44634 JS::Rooted<JS::Value> temp(cx);
44635 if (!get_canOOMAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44636 return false;
44637 }
44638 if (!JS_DefineProperty(cx, result, "canOOMAttr", temp, JSPROP_ENUMERATE)) {
44639 return false;
44640 }
44641 }
44642 { // scope for "temp"
44643 JS::Rooted<JS::Value> temp(cx);
44644 if (!get_canOOMGetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44645 return false;
44646 }
44647 if (!JS_DefineProperty(cx, result, "canOOMGetterAttr", temp, JSPROP_ENUMERATE)) {
44648 return false;
44649 }
44650 }
44651 { // scope for "temp"
44652 JS::Rooted<JS::Value> temp(cx);
44653 if (!get_canOOMSetterAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44654 return false;
44655 }
44656 if (!JS_DefineProperty(cx, result, "canOOMSetterAttr", temp, JSPROP_ENUMERATE)) {
44657 return false;
44658 }
44659 }
44660 { // scope for "temp"
44661 JS::Rooted<JS::Value> temp(cx);
44662 if (!get_ceReactionsAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44663 return false;
44664 }
44665 if (!JS_DefineProperty(cx, result, "ceReactionsAttr", temp, JSPROP_ENUMERATE)) {
44666 return false;
44667 }
44668 }
44669 { // scope for "temp"
44670 JS::Rooted<JS::Value> temp(cx);
44671 if (!get_dashed_attribute(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44672 return false;
44673 }
44674 if (!JS_DefineProperty(cx, result, "dashed_attribute", temp, JSPROP_ENUMERATE)) {
44675 return false;
44676 }
44677 }
44678 { // scope for "temp"
44679 JS::Rooted<JS::Value> temp(cx);
44680 if (!get_nonEnumerableAttr(cx, obj, self, JSJitGetterCallArgs(&temp))) {
44681 return false;
44682 }
44683 if (!JS_DefineProperty(cx, result, "nonEnumerableAttr", temp, JSPROP_ENUMERATE)) {
44684 return false;
44685 }
44686 }
44687 return true;
44688}
44689
44690bool sNativePropertiesInited = false;
44691const NativePropertyHooks sNativePropertyHooks = {
44692 nullptr,
44693 { sNativeProperties.Upcast(), sChromeOnlyNativeProperties.Upcast(), &sNativePropertiesInited },
44694 prototypes::id::TestJSImplInterface,
44695 constructors::id::TestJSImplInterface,
44696 &DefaultXrayExpandoObjectClass
44697};
44698
44699static bool
44700_constructor(JSContext* cx_, unsigned argc, JS::Value* vp)
44701{
44702 BindingCallContext cx(cx_, "TestJSImplInterface constructor");
44703 AUTO_PROFILER_LABEL_DYNAMIC_FAST(mozilla::AutoProfilerLabelHot raiiObject44705( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
44704 "TestJSImplInterface", "constructor", DOM, cx,mozilla::AutoProfilerLabelHot raiiObject44705( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
44705 uint32_t(js::ProfilingStackFrame::Flags::RELEVANT_FOR_JS))mozilla::AutoProfilerLabelHot raiiObject44705( cx, "TestJSImplInterface"
, "constructor", JS::ProfilingCategoryPair::DOM, uint32_t(js::
ProfilingStackFrame::Flags::RELEVANT_FOR_JS))
;
44706
44707 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
44708 JS::Rooted<JSObject*> obj(cx, &args.callee());
44709 if (!args.isConstructing()) {
44710 return ThrowConstructorWithoutNew(cx, "TestJSImplInterface");
44711 }
44712
44713 JS::Rooted<JSObject*> desiredProto(cx);
44714 if (!GetDesiredProto(cx, args,
44715 prototypes::id::TestJSImplInterface,
44716 CreateInterfaceObjects,
44717 &desiredProto)) {
44718 return false;
44719 }
44720
44721 if (!args.requireAtLeast(cx, "TestJSImplInterface constructor", 15)) {
44722 return false;
44723 }
44724 GlobalObject global(cx, obj);
44725 if (global.Failed()) {
44726 return false;
44727 }
44728
44729 bool objIsXray = xpc::WrapperFactory::IsXrayWrapper(obj);
44730 binding_detail::FakeString<char16_t> arg0;
44731 if (!ConvertJSValueToString(cx, args[0], eStringify, eStringify, arg0)) {
44732 return false;
44733 }
44734 uint32_t arg1;
44735 if (!ValueToPrimitive<uint32_t, eDefault>(cx, args[1], "Argument 2", &arg1)) {
44736 return false;
44737 }
44738 Nullable<bool> arg2;
44739 if (args[2].isNullOrUndefined()) {
44740 arg2.SetNull();
44741 } else if (!ValueToPrimitive<bool, eDefault>(cx, args[2], "Argument 3", &arg2.SetValue())) {
44742 return false;
44743 }
44744 mozilla::dom::TestInterface* arg3;
44745 if (args[3].isObject()) {
44746 {
44747 // Our JSContext should be in the right global to do unwrapping in.
44748 nsresult rv = UnwrapObject<prototypes::id::TestInterface, mozilla::dom::TestInterface>(args[3], arg3, cx);
44749 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
44750 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 4", "TestInterface");
44751 return false;
44752 }
44753 }
44754 } else if (args[3].isNullOrUndefined()) {
44755 arg3 = nullptr;
44756 } else {
44757 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 4");
44758 return false;
44759 }
44760 int32_t arg4;
44761 if (!ValueToPrimitive<int32_t, eDefault>(cx, args[4], "Argument 5", &arg4)) {
44762 return false;
44763 }
44764 RootedDictionary<binding_detail::FastDictForConstructor> arg5(cx);
44765 if (!arg5.Init(cx, args[5], "Argument 6", true)) {
44766 return false;
44767 }
44768 JS::Rooted<JS::Value> arg6(cx);
44769#ifdef __clang__1
44770#pragma clang diagnostic push
44771#pragma clang diagnostic ignored "-Wunreachable-code"
44772#pragma clang diagnostic ignored "-Wunreachable-code-return"
44773#endif // __clang__
44774 if ((true) && !CallerSubsumes(args[6])) {
44775 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 7");
44776 return false;
44777 }
44778#ifdef __clang__1
44779#pragma clang diagnostic pop
44780#endif // __clang__
44781 arg6 = args[6];
44782 JS::Rooted<JSObject*> arg7(cx);
44783 if (args[7].isObject()) {
44784#ifdef __clang__1
44785#pragma clang diagnostic push
44786#pragma clang diagnostic ignored "-Wunreachable-code"
44787#pragma clang diagnostic ignored "-Wunreachable-code-return"
44788#endif // __clang__
44789 if ((true) && !CallerSubsumes(args[7])) {
44790 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 8");
44791 return false;
44792 }
44793#ifdef __clang__1
44794#pragma clang diagnostic pop
44795#endif // __clang__
44796 arg7 = &args[7].toObject();
44797 } else {
44798 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 8");
44799 return false;
44800 }
44801 JS::Rooted<JSObject*> arg8(cx);
44802 if (args[8].isObject()) {
44803#ifdef __clang__1
44804#pragma clang diagnostic push
44805#pragma clang diagnostic ignored "-Wunreachable-code"
44806#pragma clang diagnostic ignored "-Wunreachable-code-return"
44807#endif // __clang__
44808 if ((true) && !CallerSubsumes(args[8])) {
44809 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 9");
44810 return false;
44811 }
44812#ifdef __clang__1
44813#pragma clang diagnostic pop
44814#endif // __clang__
44815 arg8 = &args[8].toObject();
44816 } else if (args[8].isNullOrUndefined()) {
44817 arg8 = nullptr;
44818 } else {
44819 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 9");
44820 return false;
44821 }
44822 binding_detail::AutoSequence<Dict> arg9;
44823 SequenceRooter<Dict> arg9_holder(cx, &arg9);
44824 if (args[9].isObject()) {
44825 JS::ForOfIterator iter(cx);
44826 if (!iter.init(args[9], JS::ForOfIterator::AllowNonIterable)) {
44827 return false;
44828 }
44829 if (!iter.valueIsIterable()) {
44830 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
44831 return false;
44832 }
44833 binding_detail::AutoSequence<Dict> &arr = arg9;
44834 JS::Rooted<JS::Value> temp(cx);
44835 while (true) {
44836 bool done;
44837 if (!iter.next(&temp, &done)) {
44838 return false;
44839 }
44840 if (done) {
44841 break;
44842 }
44843 Dict* slotPtr = arr.AppendElement(mozilla::fallible);
44844 if (!slotPtr) {
44845 JS_ReportOutOfMemory(cx);
44846 return false;
44847 }
44848 Dict& slot = *slotPtr;
44849 if (!slot.Init(cx, temp, "Element of argument 10", true)) {
44850 return false;
44851 }
44852 }
44853 } else {
44854 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Argument 10", "sequence");
44855 return false;
44856 }
44857 JS::Rooted<JS::Value> arg10(cx);
44858 if (args.hasDefined(10)) {
44859#ifdef __clang__1
44860#pragma clang diagnostic push
44861#pragma clang diagnostic ignored "-Wunreachable-code"
44862#pragma clang diagnostic ignored "-Wunreachable-code-return"
44863#endif // __clang__
44864 if ((true) && !CallerSubsumes(args[10])) {
44865 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 11");
44866 return false;
44867 }
44868#ifdef __clang__1
44869#pragma clang diagnostic pop
44870#endif // __clang__
44871 arg10 = args[10];
44872 } else {
44873 arg10 = JS::UndefinedValue();
44874 }
44875 Optional<JS::Handle<JSObject*>> arg11;
44876 if (args.hasDefined(11)) {
44877 arg11.Construct(cx);
44878 if (args[11].isObject()) {
44879#ifdef __clang__1
44880#pragma clang diagnostic push
44881#pragma clang diagnostic ignored "-Wunreachable-code"
44882#pragma clang diagnostic ignored "-Wunreachable-code-return"
44883#endif // __clang__
44884 if ((true) && !CallerSubsumes(args[11])) {
44885 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 12");
44886 return false;
44887 }
44888#ifdef __clang__1
44889#pragma clang diagnostic pop
44890#endif // __clang__
44891 arg11.Value() = &args[11].toObject();
44892 } else {
44893 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 12");
44894 return false;
44895 }
44896 }
44897 Optional<JS::Handle<JSObject*>> arg12;
44898 if (args.hasDefined(12)) {
44899 arg12.Construct(cx);
44900 if (args[12].isObject()) {
44901#ifdef __clang__1
44902#pragma clang diagnostic push
44903#pragma clang diagnostic ignored "-Wunreachable-code"
44904#pragma clang diagnostic ignored "-Wunreachable-code-return"
44905#endif // __clang__
44906 if ((true) && !CallerSubsumes(args[12])) {
44907 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("argument 13");
44908 return false;
44909 }
44910#ifdef __clang__1
44911#pragma clang diagnostic pop
44912#endif // __clang__
44913 arg12.Value() = &args[12].toObject();
44914 } else if (args[12].isNullOrUndefined()) {
44915 arg12.Value() = nullptr;
44916 } else {
44917 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 13");
44918 return false;
44919 }
44920 }
44921 RootedSpiderMonkeyInterface<Uint8Array> arg13(cx);
44922 if (args[13].isObject()) {
44923 if (!arg13.Init(&args[13].toObject())) {
44924 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 14", "Uint8Array");
44925 return false;
44926 }
44927 if (JS::IsArrayBufferViewShared(arg13.Obj())) {
44928 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 14");
44929 return false;
44930 }
44931 if (JS::IsLargeArrayBufferView(arg13.Obj())) {
44932 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 14");
44933 return false;
44934 }
44935 if (JS::IsResizableArrayBufferView(arg13.Obj())) {
44936 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 14");
44937 return false;
44938 }
44939 } else {
44940 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 14");
44941 return false;
44942 }
44943 RootedSpiderMonkeyInterface<ArrayBuffer> arg14(cx);
44944 if (args[14].isObject()) {
44945 if (!arg14.Init(&args[14].toObject())) {
44946 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Argument 15", "ArrayBuffer");
44947 return false;
44948 }
44949 if (JS::IsSharedArrayBufferObject(arg14.Obj())) {
44950 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Argument 15");
44951 return false;
44952 }
44953 if (JS::IsLargeArrayBufferMaybeShared(arg14.Obj())) {
44954 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Argument 15");
44955 return false;
44956 }
44957 if (JS::IsResizableArrayBufferMaybeShared(arg14.Obj())) {
44958 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Argument 15");
44959 return false;
44960 }
44961 } else {
44962 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 15");
44963 return false;
44964 }
44965 Maybe<JSAutoRealm> ar;
44966 if (objIsXray) {
44967 // Since our object is an Xray, we can just CheckedUnwrapStatic:
44968 // we know Xrays have no dynamic unwrap behavior.
44969 obj = js::CheckedUnwrapStatic(obj);
44970 if (!obj) {
44971 return false;
44972 }
44973 ar.emplace(cx, obj);
44974 if (!JS_WrapObject(cx, &desiredProto)) {
44975 return false;
44976 }
44977 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mAny1))) {
44978 return false;
44979 }
44980 if (arg5.mDict.WasPassed()) {
44981 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mAnotherAny))) {
44982 return false;
44983 }
44984 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mAnotherObj))) {
44985 return false;
44986 }
44987 if (arg5.mDict.Value().mArrayBuffer.WasPassed()) {
44988 if (!arg5.mDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
44989 return false;
44990 }
44991 }
44992 if (arg5.mDict.Value().mCustomEventInit.WasPassed()) {
44993 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mCustomEventInit.Value().mDetail))) {
44994 return false;
44995 }
44996 }
44997 if (arg5.mDict.Value().mDictionaryTypedef.WasPassed()) {
44998 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mDictionaryTypedef.Value().mDetail))) {
44999 return false;
45000 }
45001 }
45002 if (arg5.mDict.Value().mEventInitOrLong2.WasPassed()) {
45003 if (arg5.mDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) {
45004 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45005 return false;
45006 }
45007 }
45008 }
45009 if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45010 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45011 return false;
45012 }
45013 }
45014 if (arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45015 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45016 return false;
45017 }
45018 }
45019 if (!arg5.mDict.Value().mFloat64Array.IsNull()) {
45020 if (!arg5.mDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45021 return false;
45022 }
45023 }
45024 if (arg5.mDict.Value().mNullableArrayBuffer.WasPassed()) {
45025 if (!arg5.mDict.Value().mNullableArrayBuffer.Value().IsNull()) {
45026 if (!arg5.mDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45027 return false;
45028 }
45029 }
45030 }
45031 if (arg5.mDict.Value().mNullableEventInitOrLong2.WasPassed()) {
45032 if (!arg5.mDict.Value().mNullableEventInitOrLong2.Value().IsNull()) {
45033 if (arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45034 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45035 return false;
45036 }
45037 }
45038 }
45039 }
45040 if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45041 if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45042 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45043 return false;
45044 }
45045 }
45046 }
45047 if (!arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45048 if (arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45049 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45050 return false;
45051 }
45052 }
45053 }
45054 if (arg5.mDict.Value().mNullableObjectSequenceOrLong.WasPassed()) {
45055 if (!arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) {
45056 if (arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45057 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) {
45058 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) {
45059 return false;
45060 }
45061 }
45062 }
45063 }
45064 }
45065 if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45066 if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45067 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) {
45068 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) {
45069 return false;
45070 }
45071 }
45072 }
45073 }
45074 if (!arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45075 if (arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45076 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) {
45077 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) {
45078 return false;
45079 }
45080 }
45081 }
45082 }
45083 if (arg5.mDict.Value().mObjectOrLong.WasPassed()) {
45084 if (arg5.mDict.Value().mObjectOrLong.Value().IsObject()) {
45085 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectOrLong.Value().GetAsObject()))) {
45086 return false;
45087 }
45088 }
45089 }
45090 if (arg5.mDict.Value().mObjectSequenceOrLong.WasPassed()) {
45091 if (arg5.mDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) {
45092 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) {
45093 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) {
45094 return false;
45095 }
45096 }
45097 }
45098 }
45099 if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45100 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) {
45101 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) {
45102 return false;
45103 }
45104 }
45105 }
45106 if (arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45107 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) {
45108 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) {
45109 return false;
45110 }
45111 }
45112 }
45113 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mRequiredObject))) {
45114 return false;
45115 }
45116 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mSomeAny))) {
45117 return false;
45118 }
45119 if (arg5.mDict.Value().mSomeObj.WasPassed()) {
45120 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict.Value().mSomeObj.Value()))) {
45121 return false;
45122 }
45123 }
45124 if (arg5.mDict.Value().mUint8Array.WasPassed()) {
45125 if (!arg5.mDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45126 return false;
45127 }
45128 }
45129 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict.Value().mParentAny))) {
45130 return false;
45131 }
45132 }
45133 if (arg5.mDict2.WasPassed()) {
45134 if (arg5.mDict2.Value().mMemberDict.WasPassed()) {
45135 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherAny))) {
45136 return false;
45137 }
45138 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mAnotherObj))) {
45139 return false;
45140 }
45141 if (arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.WasPassed()) {
45142 if (!arg5.mDict2.Value().mMemberDict.Value().mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45143 return false;
45144 }
45145 }
45146 if (arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.WasPassed()) {
45147 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mCustomEventInit.Value().mDetail))) {
45148 return false;
45149 }
45150 }
45151 if (arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.WasPassed()) {
45152 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mDictionaryTypedef.Value().mDetail))) {
45153 return false;
45154 }
45155 }
45156 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.WasPassed()) {
45157 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().IsCustomEventInit()) {
45158 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45159 return false;
45160 }
45161 }
45162 }
45163 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45164 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45165 return false;
45166 }
45167 }
45168 if (arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45169 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45170 return false;
45171 }
45172 }
45173 if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.IsNull()) {
45174 if (!arg5.mDict2.Value().mMemberDict.Value().mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45175 return false;
45176 }
45177 }
45178 if (arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.WasPassed()) {
45179 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().IsNull()) {
45180 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45181 return false;
45182 }
45183 }
45184 }
45185 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.WasPassed()) {
45186 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().IsNull()) {
45187 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45188 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45189 return false;
45190 }
45191 }
45192 }
45193 }
45194 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45195 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45196 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45197 return false;
45198 }
45199 }
45200 }
45201 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45202 if (arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45203 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45204 return false;
45205 }
45206 }
45207 }
45208 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.WasPassed()) {
45209 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().IsNull()) {
45210 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45211 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName0) {
45212 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName0]))) {
45213 return false;
45214 }
45215 }
45216 }
45217 }
45218 }
45219 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45220 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45221 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName0) {
45222 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName0]))) {
45223 return false;
45224 }
45225 }
45226 }
45227 }
45228 if (!arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45229 if (arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45230 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName0) {
45231 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName0]))) {
45232 return false;
45233 }
45234 }
45235 }
45236 }
45237 if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.WasPassed()) {
45238 if (arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().IsObject()) {
45239 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectOrLong.Value().GetAsObject()))) {
45240 return false;
45241 }
45242 }
45243 }
45244 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.WasPassed()) {
45245 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().IsObjectSequence()) {
45246 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName0) {
45247 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName0]))) {
45248 return false;
45249 }
45250 }
45251 }
45252 }
45253 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45254 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName0) {
45255 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName0]))) {
45256 return false;
45257 }
45258 }
45259 }
45260 if (arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45261 for (uint32_t indexName0 = 0; indexName0 < arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName0) {
45262 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName0]))) {
45263 return false;
45264 }
45265 }
45266 }
45267 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mRequiredObject))) {
45268 return false;
45269 }
45270 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeAny))) {
45271 return false;
45272 }
45273 if (arg5.mDict2.Value().mMemberDict.Value().mSomeObj.WasPassed()) {
45274 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mSomeObj.Value()))) {
45275 return false;
45276 }
45277 }
45278 if (arg5.mDict2.Value().mMemberDict.Value().mUint8Array.WasPassed()) {
45279 if (!arg5.mDict2.Value().mMemberDict.Value().mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45280 return false;
45281 }
45282 }
45283 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mDict2.Value().mMemberDict.Value().mParentAny))) {
45284 return false;
45285 }
45286 }
45287 }
45288 if (arg5.mObj1.WasPassed()) {
45289 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj1.Value()))) {
45290 return false;
45291 }
45292 }
45293 if (arg5.mObj2.WasPassed()) {
45294 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mObj2.Value()))) {
45295 return false;
45296 }
45297 }
45298 if (arg5.mSeq1.WasPassed()) {
45299 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq1.Value().Length(); ++indexName0) {
45300 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherAny))) {
45301 return false;
45302 }
45303 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mAnotherObj))) {
45304 return false;
45305 }
45306 if (arg5.mSeq1.Value()[indexName0].mArrayBuffer.WasPassed()) {
45307 if (!arg5.mSeq1.Value()[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45308 return false;
45309 }
45310 }
45311 if (arg5.mSeq1.Value()[indexName0].mCustomEventInit.WasPassed()) {
45312 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mCustomEventInit.Value().mDetail))) {
45313 return false;
45314 }
45315 }
45316 if (arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.WasPassed()) {
45317 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mDictionaryTypedef.Value().mDetail))) {
45318 return false;
45319 }
45320 }
45321 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.WasPassed()) {
45322 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) {
45323 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45324 return false;
45325 }
45326 }
45327 }
45328 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45329 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45330 return false;
45331 }
45332 }
45333 if (arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45334 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45335 return false;
45336 }
45337 }
45338 if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.IsNull()) {
45339 if (!arg5.mSeq1.Value()[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45340 return false;
45341 }
45342 }
45343 if (arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.WasPassed()) {
45344 if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().IsNull()) {
45345 if (!arg5.mSeq1.Value()[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45346 return false;
45347 }
45348 }
45349 }
45350 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.WasPassed()) {
45351 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().IsNull()) {
45352 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45353 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45354 return false;
45355 }
45356 }
45357 }
45358 }
45359 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45360 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45361 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45362 return false;
45363 }
45364 }
45365 }
45366 if (!arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45367 if (arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45368 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45369 return false;
45370 }
45371 }
45372 }
45373 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.WasPassed()) {
45374 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) {
45375 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45376 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) {
45377 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) {
45378 return false;
45379 }
45380 }
45381 }
45382 }
45383 }
45384 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45385 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45386 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) {
45387 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) {
45388 return false;
45389 }
45390 }
45391 }
45392 }
45393 if (!arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45394 if (arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45395 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) {
45396 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) {
45397 return false;
45398 }
45399 }
45400 }
45401 }
45402 if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.WasPassed()) {
45403 if (arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().IsObject()) {
45404 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectOrLong.Value().GetAsObject()))) {
45405 return false;
45406 }
45407 }
45408 }
45409 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.WasPassed()) {
45410 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45411 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) {
45412 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) {
45413 return false;
45414 }
45415 }
45416 }
45417 }
45418 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45419 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) {
45420 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) {
45421 return false;
45422 }
45423 }
45424 }
45425 if (arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45426 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) {
45427 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) {
45428 return false;
45429 }
45430 }
45431 }
45432 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mRequiredObject))) {
45433 return false;
45434 }
45435 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeAny))) {
45436 return false;
45437 }
45438 if (arg5.mSeq1.Value()[indexName0].mSomeObj.WasPassed()) {
45439 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mSomeObj.Value()))) {
45440 return false;
45441 }
45442 }
45443 if (arg5.mSeq1.Value()[indexName0].mUint8Array.WasPassed()) {
45444 if (!arg5.mSeq1.Value()[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45445 return false;
45446 }
45447 }
45448 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq1.Value()[indexName0].mParentAny))) {
45449 return false;
45450 }
45451 }
45452 }
45453 if (arg5.mSeq2.WasPassed()) {
45454 if (!arg5.mSeq2.Value().IsNull()) {
45455 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq2.Value().Value().Length(); ++indexName0) {
45456 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq2.Value().Value()[indexName0].Length(); ++indexName1) {
45457 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherAny))) {
45458 return false;
45459 }
45460 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mAnotherObj))) {
45461 return false;
45462 }
45463 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.WasPassed()) {
45464 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45465 return false;
45466 }
45467 }
45468 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.WasPassed()) {
45469 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mCustomEventInit.Value().mDetail))) {
45470 return false;
45471 }
45472 }
45473 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.WasPassed()) {
45474 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mDictionaryTypedef.Value().mDetail))) {
45475 return false;
45476 }
45477 }
45478 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.WasPassed()) {
45479 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) {
45480 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45481 return false;
45482 }
45483 }
45484 }
45485 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45486 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45487 return false;
45488 }
45489 }
45490 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45491 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45492 return false;
45493 }
45494 }
45495 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.IsNull()) {
45496 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45497 return false;
45498 }
45499 }
45500 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.WasPassed()) {
45501 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().IsNull()) {
45502 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45503 return false;
45504 }
45505 }
45506 }
45507 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.WasPassed()) {
45508 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().IsNull()) {
45509 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45510 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45511 return false;
45512 }
45513 }
45514 }
45515 }
45516 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45517 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45518 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45519 return false;
45520 }
45521 }
45522 }
45523 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45524 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45525 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45526 return false;
45527 }
45528 }
45529 }
45530 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.WasPassed()) {
45531 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) {
45532 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45533 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) {
45534 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) {
45535 return false;
45536 }
45537 }
45538 }
45539 }
45540 }
45541 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45542 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45543 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) {
45544 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) {
45545 return false;
45546 }
45547 }
45548 }
45549 }
45550 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45551 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45552 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) {
45553 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) {
45554 return false;
45555 }
45556 }
45557 }
45558 }
45559 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.WasPassed()) {
45560 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().IsObject()) {
45561 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectOrLong.Value().GetAsObject()))) {
45562 return false;
45563 }
45564 }
45565 }
45566 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.WasPassed()) {
45567 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45568 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) {
45569 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) {
45570 return false;
45571 }
45572 }
45573 }
45574 }
45575 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45576 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) {
45577 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) {
45578 return false;
45579 }
45580 }
45581 }
45582 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45583 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) {
45584 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) {
45585 return false;
45586 }
45587 }
45588 }
45589 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mRequiredObject))) {
45590 return false;
45591 }
45592 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeAny))) {
45593 return false;
45594 }
45595 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.WasPassed()) {
45596 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mSomeObj.Value()))) {
45597 return false;
45598 }
45599 }
45600 if (arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.WasPassed()) {
45601 if (!arg5.mSeq2.Value().Value()[indexName0][indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45602 return false;
45603 }
45604 }
45605 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq2.Value().Value()[indexName0][indexName1].mParentAny))) {
45606 return false;
45607 }
45608 }
45609 }
45610 }
45611 }
45612 if (arg5.mSeq3.WasPassed()) {
45613 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq3.Value().Length(); ++indexName0) {
45614 if (!arg5.mSeq3.Value()[indexName0].IsNull()) {
45615 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq3.Value()[indexName0].Value().Length(); ++indexName1) {
45616 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherAny))) {
45617 return false;
45618 }
45619 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mAnotherObj))) {
45620 return false;
45621 }
45622 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.WasPassed()) {
45623 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45624 return false;
45625 }
45626 }
45627 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.WasPassed()) {
45628 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mCustomEventInit.Value().mDetail))) {
45629 return false;
45630 }
45631 }
45632 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.WasPassed()) {
45633 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mDictionaryTypedef.Value().mDetail))) {
45634 return false;
45635 }
45636 }
45637 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.WasPassed()) {
45638 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().IsCustomEventInit()) {
45639 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45640 return false;
45641 }
45642 }
45643 }
45644 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45645 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45646 return false;
45647 }
45648 }
45649 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45650 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45651 return false;
45652 }
45653 }
45654 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.IsNull()) {
45655 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45656 return false;
45657 }
45658 }
45659 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.WasPassed()) {
45660 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().IsNull()) {
45661 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45662 return false;
45663 }
45664 }
45665 }
45666 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.WasPassed()) {
45667 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().IsNull()) {
45668 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45669 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45670 return false;
45671 }
45672 }
45673 }
45674 }
45675 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45676 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45677 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45678 return false;
45679 }
45680 }
45681 }
45682 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45683 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45684 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45685 return false;
45686 }
45687 }
45688 }
45689 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.WasPassed()) {
45690 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().IsNull()) {
45691 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45692 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName2) {
45693 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName2]))) {
45694 return false;
45695 }
45696 }
45697 }
45698 }
45699 }
45700 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45701 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45702 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName2) {
45703 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName2]))) {
45704 return false;
45705 }
45706 }
45707 }
45708 }
45709 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45710 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45711 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName2) {
45712 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName2]))) {
45713 return false;
45714 }
45715 }
45716 }
45717 }
45718 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.WasPassed()) {
45719 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().IsObject()) {
45720 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectOrLong.Value().GetAsObject()))) {
45721 return false;
45722 }
45723 }
45724 }
45725 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.WasPassed()) {
45726 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45727 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName2) {
45728 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName2]))) {
45729 return false;
45730 }
45731 }
45732 }
45733 }
45734 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45735 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName2) {
45736 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName2]))) {
45737 return false;
45738 }
45739 }
45740 }
45741 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45742 for (uint32_t indexName2 = 0; indexName2 < arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName2) {
45743 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName2]))) {
45744 return false;
45745 }
45746 }
45747 }
45748 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mRequiredObject))) {
45749 return false;
45750 }
45751 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeAny))) {
45752 return false;
45753 }
45754 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.WasPassed()) {
45755 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mSomeObj.Value()))) {
45756 return false;
45757 }
45758 }
45759 if (arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.WasPassed()) {
45760 if (!arg5.mSeq3.Value()[indexName0].Value()[indexName1].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45761 return false;
45762 }
45763 }
45764 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq3.Value()[indexName0].Value()[indexName1].mParentAny))) {
45765 return false;
45766 }
45767 }
45768 }
45769 }
45770 }
45771 if (arg5.mSeq4.WasPassed()) {
45772 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq4.Value().Length(); ++indexName0) {
45773 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq4.Value()[indexName0]))) {
45774 return false;
45775 }
45776 }
45777 }
45778 if (arg5.mSeq5.WasPassed()) {
45779 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq5.Value().Length(); ++indexName0) {
45780 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq5.Value()[indexName0]))) {
45781 return false;
45782 }
45783 }
45784 }
45785 if (arg5.mSeq6.WasPassed()) {
45786 for (uint32_t indexName0 = 0; indexName0 < arg5.mSeq6.Value().Length(); ++indexName0) {
45787 if (arg5.mSeq6.Value()[indexName0].mOurSequence3.WasPassed()) {
45788 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence3.Value().Length(); ++indexName1) {
45789 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence3.Value()[indexName1]))) {
45790 return false;
45791 }
45792 }
45793 }
45794 if (arg5.mSeq6.Value()[indexName0].mOurSequence4.WasPassed()) {
45795 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence4.Value().Length(); ++indexName1) {
45796 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence4.Value()[indexName1]))) {
45797 return false;
45798 }
45799 }
45800 }
45801 if (arg5.mSeq6.Value()[indexName0].mOurSequence5.WasPassed()) {
45802 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence5.Value().Length(); ++indexName1) {
45803 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence5.Value()[indexName1]))) {
45804 return false;
45805 }
45806 }
45807 }
45808 if (arg5.mSeq6.Value()[indexName0].mOurSequence6.WasPassed()) {
45809 if (!arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().IsNull()) {
45810 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value().Length(); ++indexName1) {
45811 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence6.Value().Value()[indexName1]))) {
45812 return false;
45813 }
45814 }
45815 }
45816 }
45817 if (arg5.mSeq6.Value()[indexName0].mOurSequence7.WasPassed()) {
45818 if (!arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().IsNull()) {
45819 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value().Length(); ++indexName1) {
45820 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence7.Value().Value()[indexName1]))) {
45821 return false;
45822 }
45823 }
45824 }
45825 }
45826 if (!arg5.mSeq6.Value()[indexName0].mOurSequence8.IsNull()) {
45827 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence8.Value().Length(); ++indexName1) {
45828 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence8.Value()[indexName1]))) {
45829 return false;
45830 }
45831 }
45832 }
45833 if (!arg5.mSeq6.Value()[indexName0].mOurSequence9.IsNull()) {
45834 for (uint32_t indexName1 = 0; indexName1 < arg5.mSeq6.Value()[indexName0].mOurSequence9.Value().Length(); ++indexName1) {
45835 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg5.mSeq6.Value()[indexName0].mOurSequence9.Value()[indexName1]))) {
45836 return false;
45837 }
45838 }
45839 }
45840 }
45841 }
45842 if (!JS_WrapValue(cx, &arg6)) {
45843 return false;
45844 }
45845 if (!JS_WrapObject(cx, &arg7)) {
45846 return false;
45847 }
45848 if (!JS_WrapObject(cx, &arg8)) {
45849 return false;
45850 }
45851 for (uint32_t indexName0 = 0; indexName0 < arg9.Length(); ++indexName0) {
45852 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mAnotherAny))) {
45853 return false;
45854 }
45855 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mAnotherObj))) {
45856 return false;
45857 }
45858 if (arg9[indexName0].mArrayBuffer.WasPassed()) {
45859 if (!arg9[indexName0].mArrayBuffer.Value().WrapIntoNewCompartment(cx)) {
45860 return false;
45861 }
45862 }
45863 if (arg9[indexName0].mCustomEventInit.WasPassed()) {
45864 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mCustomEventInit.Value().mDetail))) {
45865 return false;
45866 }
45867 }
45868 if (arg9[indexName0].mDictionaryTypedef.WasPassed()) {
45869 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mDictionaryTypedef.Value().mDetail))) {
45870 return false;
45871 }
45872 }
45873 if (arg9[indexName0].mEventInitOrLong2.WasPassed()) {
45874 if (arg9[indexName0].mEventInitOrLong2.Value().IsCustomEventInit()) {
45875 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLong2.Value().GetAsCustomEventInit().mDetail))) {
45876 return false;
45877 }
45878 }
45879 }
45880 if (arg9[indexName0].mEventInitOrLongWithDefaultValue2.IsCustomEventInit()) {
45881 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue2.GetAsCustomEventInit().mDetail))) {
45882 return false;
45883 }
45884 }
45885 if (arg9[indexName0].mEventInitOrLongWithDefaultValue4.IsCustomEventInit()) {
45886 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mEventInitOrLongWithDefaultValue4.GetAsCustomEventInit().mDetail))) {
45887 return false;
45888 }
45889 }
45890 if (!arg9[indexName0].mFloat64Array.IsNull()) {
45891 if (!arg9[indexName0].mFloat64Array.Value().WrapIntoNewCompartment(cx)) {
45892 return false;
45893 }
45894 }
45895 if (arg9[indexName0].mNullableArrayBuffer.WasPassed()) {
45896 if (!arg9[indexName0].mNullableArrayBuffer.Value().IsNull()) {
45897 if (!arg9[indexName0].mNullableArrayBuffer.Value().Value().WrapIntoNewCompartment(cx)) {
45898 return false;
45899 }
45900 }
45901 }
45902 if (arg9[indexName0].mNullableEventInitOrLong2.WasPassed()) {
45903 if (!arg9[indexName0].mNullableEventInitOrLong2.Value().IsNull()) {
45904 if (arg9[indexName0].mNullableEventInitOrLong2.Value().Value().IsCustomEventInit()) {
45905 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLong2.Value().Value().GetAsCustomEventInit().mDetail))) {
45906 return false;
45907 }
45908 }
45909 }
45910 }
45911 if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.IsNull()) {
45912 if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().IsCustomEventInit()) {
45913 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue2.Value().GetAsCustomEventInit().mDetail))) {
45914 return false;
45915 }
45916 }
45917 }
45918 if (!arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.IsNull()) {
45919 if (arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().IsCustomEventInit()) {
45920 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mNullableEventInitOrLongWithDefaultValue4.Value().GetAsCustomEventInit().mDetail))) {
45921 return false;
45922 }
45923 }
45924 }
45925 if (arg9[indexName0].mNullableObjectSequenceOrLong.WasPassed()) {
45926 if (!arg9[indexName0].mNullableObjectSequenceOrLong.Value().IsNull()) {
45927 if (arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().IsObjectSequence()) {
45928 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence().Length(); ++indexName1) {
45929 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLong.Value().Value().GetAsObjectSequence()[indexName1]))) {
45930 return false;
45931 }
45932 }
45933 }
45934 }
45935 }
45936 if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.IsNull()) {
45937 if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().IsObjectSequence()) {
45938 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence().Length(); ++indexName1) {
45939 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue1.Value().GetAsObjectSequence()[indexName1]))) {
45940 return false;
45941 }
45942 }
45943 }
45944 }
45945 if (!arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.IsNull()) {
45946 if (arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().IsObjectSequence()) {
45947 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence().Length(); ++indexName1) {
45948 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mNullableObjectSequenceOrLongWithDefaultValue2.Value().GetAsObjectSequence()[indexName1]))) {
45949 return false;
45950 }
45951 }
45952 }
45953 }
45954 if (arg9[indexName0].mObjectOrLong.WasPassed()) {
45955 if (arg9[indexName0].mObjectOrLong.Value().IsObject()) {
45956 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectOrLong.Value().GetAsObject()))) {
45957 return false;
45958 }
45959 }
45960 }
45961 if (arg9[indexName0].mObjectSequenceOrLong.WasPassed()) {
45962 if (arg9[indexName0].mObjectSequenceOrLong.Value().IsObjectSequence()) {
45963 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence().Length(); ++indexName1) {
45964 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLong.Value().GetAsObjectSequence()[indexName1]))) {
45965 return false;
45966 }
45967 }
45968 }
45969 }
45970 if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.IsObjectSequence()) {
45971 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence().Length(); ++indexName1) {
45972 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue1.GetAsObjectSequence()[indexName1]))) {
45973 return false;
45974 }
45975 }
45976 }
45977 if (arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.IsObjectSequence()) {
45978 for (uint32_t indexName1 = 0; indexName1 < arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence().Length(); ++indexName1) {
45979 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mObjectSequenceOrLongWithDefaultValue2.GetAsObjectSequence()[indexName1]))) {
45980 return false;
45981 }
45982 }
45983 }
45984 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mRequiredObject))) {
45985 return false;
45986 }
45987 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mSomeAny))) {
45988 return false;
45989 }
45990 if (arg9[indexName0].mSomeObj.WasPassed()) {
45991 if (!JS_WrapObject(cx, JS::MutableHandle<JSObject*>::fromMarkedLocation(&arg9[indexName0].mSomeObj.Value()))) {
45992 return false;
45993 }
45994 }
45995 if (arg9[indexName0].mUint8Array.WasPassed()) {
45996 if (!arg9[indexName0].mUint8Array.Value().WrapIntoNewCompartment(cx)) {
45997 return false;
45998 }
45999 }
46000 if (!JS_WrapValue(cx, JS::MutableHandle<JS::Value>::fromMarkedLocation(&arg9[indexName0].mParentAny))) {
46001 return false;
46002 }
46003 }
46004 if (!JS_WrapValue(cx, &arg10)) {
46005 return false;
46006 }
46007 if (arg11.WasPassed()) {
46008 if (!JS_WrapObject(cx, &arg11.Value())) {
46009 return false;
46010 }
46011 }
46012 if (arg12.WasPassed()) {
46013 if (!JS_WrapObject(cx, &arg12.Value())) {
46014 return false;
46015 }
46016 }
46017 if (!arg13.WrapIntoNewCompartment(cx)) {
46018 return false;
46019 }
46020 if (!arg14.WrapIntoNewCompartment(cx)) {
46021 return false;
46022 }
46023 }
46024 FastErrorResult rv;
46025 auto result(StrongOrRawPtr<mozilla::dom::TestJSImplInterface>(mozilla::dom::TestJSImplInterface::Constructor(global, cx, NonNullHelper(Constify(arg0)), arg1, Constify(arg2), MOZ_KnownLive(Constify(arg3))(Constify(arg3)), arg4, Constify(arg5), arg6, arg7, arg8, Constify(arg9), arg10, Constify(arg11), Constify(arg12), Constify(arg13), Constify(arg14), rv, desiredProto)));
46026 if (MOZ_UNLIKELY(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor"))(__builtin_expect(!!(rv.MaybeSetPendingException(cx, "TestJSImplInterface constructor"
)), 0))
) {
46027 return false;
46028 }
46029 MOZ_ASSERT(!JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!JS_IsExceptionPending(cx)))
), 0))) { do { } while (false); MOZ_ReportAssertionFailure("!JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 46029); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!JS_IsExceptionPending(cx)" ")"); do { *((
volatile int*)__null) = 46029; __attribute__((nomerge)) ::abort
(); } while (false); } } while (false)
;
46030 static_assert(!std::is_pointer_v<decltype(result)>,
46031 "NewObject implies that we need to keep the object alive with a strong reference.");
46032 if (!GetOrCreateDOMReflector(cx, result, args.rval(), desiredProto)) {
46033 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 46033); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 46033; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46034 return false;
46035 }
46036 return true;
46037}
46038
46039static const DOMInterfaceInfo sInterfaceObjectInfo = {
46040 { _constructor, &sNativePropertyHooks },
46041 JS::GetRealmFunctionPrototypeHandle,
46042 prototypes::id::TestJSImplInterface,
46043 PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth,
46044 true,
46045};
46046
46047static const DOMIfaceAndProtoJSClass sPrototypeClass = {
46048 {
46049 "TestJSImplInterfacePrototype",
46050 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
46051 JS_NULL_CLASS_OPS,
46052 JS_NULL_CLASS_SPEC,
46053 JS_NULL_CLASS_EXT,
46054 JS_NULL_OBJECT_OPS
46055 },
46056 eInterfacePrototype,
46057 prototypes::id::TestJSImplInterface,
46058 PrototypeTraits<prototypes::id::TestJSImplInterface>::Depth,
46059 &sNativePropertyHooks,
46060 JS::GetRealmObjectPrototype
46061};
46062
46063static const JSClassOps sClassOps = {
46064 _addProperty, /* addProperty */
46065 nullptr, /* delProperty */
46066 nullptr, /* enumerate */
46067 nullptr, /* newEnumerate */
46068 nullptr, /* resolve */
46069 nullptr, /* mayResolve */
46070 _finalize, /* finalize */
46071 nullptr, /* call */
46072 nullptr, /* construct */
46073 nullptr, /* trace */
46074};
46075
46076static const js::ClassExtension sClassExtension = {
46077 _objectMoved /* objectMovedOp */
46078};
46079
46080static const DOMJSClass sClass = {
46081 { "TestJSImplInterface",
46082 JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
46083 &sClassOps,
46084 JS_NULL_CLASS_SPEC,
46085 &sClassExtension,
46086 JS_NULL_OBJECT_OPS
46087 },
46088 { prototypes::id::TestJSImplInterface, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
46089 std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplInterface>,
46090 &sNativePropertyHooks,
46091 FindAssociatedGlobalForNative<mozilla::dom::TestJSImplInterface>::Get,
46092 GetProtoObjectHandle,
46093 GetCCParticipant<mozilla::dom::TestJSImplInterface>::Get(),
46094 nullptr,
46095 _getWrapperCache
46096};
46097static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1,
46098 "Must have the right minimal number of reserved slots.");
46099static_assert(1 >= 1,
46100 "Must have enough reserved slots.");
46101
46102bool
46103Wrap(JSContext* aCx, mozilla::dom::TestJSImplInterface* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
46104{
46105 static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplInterface>,
46106 "Shouldn't have wrappercached things that are not refcounted.");
46107 static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplInterface*>);
46108 MOZ_ASSERT(ToSupportsIsCorrect(aObject))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsCorrect(aObject))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ToSupportsIsCorrect(aObject)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"ToSupportsIsCorrect(aObject)", "../TestJSImplGenBinding.cpp"
, 46108); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)"
")"); do { *((volatile int*)__null) = 46108; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46109 MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx))do { if (aGivenProto) { do { static_assert( mozilla::detail::
AssertionConditionType<decltype(js::IsObjectInContextCompartment
(aGivenProto, aCx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(js::IsObjectInContextCompartment
(aGivenProto, aCx)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("js::IsObjectInContextCompartment(aGivenProto, aCx)", "../TestJSImplGenBinding.cpp"
, 46109); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)"
")"); do { *((volatile int*)__null) = 46109; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
46110 MOZ_ASSERT(!aCache->GetWrapper(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46112); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46112; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
46111 "You should probably not be using Wrap() directly; use "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46112); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46112; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
46112 "GetOrCreateDOMReflector instead")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46112); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46112; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46113
46114 MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" " ("
"nsISupports must be on our primary inheritance chain" ")", "../TestJSImplGenBinding.cpp"
, 46115); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { *((volatile int*)__null) = 46115; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46115 "nsISupports must be on our primary inheritance chain")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" " ("
"nsISupports must be on our primary inheritance chain" ")", "../TestJSImplGenBinding.cpp"
, 46115); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { *((volatile int*)__null) = 46115; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46116
46117 // If the wrapper cache contains a dead reflector then finalize that
46118 // now, ensuring that the finalizer for the old reflector always
46119 // runs before the new reflector is created and attached. This
46120 // avoids the awkward situation where there are multiple reflector
46121 // objects that contain pointers to the same native.
46122
46123 if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) {
46124 _finalize(nullptr /* unused */, oldReflector);
46125 MOZ_ASSERT(!aCache->GetWrapperMaybeDead())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapperMaybeDead())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapperMaybeDead
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!aCache->GetWrapperMaybeDead()", "../TestJSImplGenBinding.cpp"
, 46125); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()"
")"); do { *((volatile int*)__null) = 46125; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46126 }
46127
46128 JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
46129 if (!global) {
46130 return false;
46131 }
46132 MOZ_ASSERT(JS_IsGlobalObject(global))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsGlobalObject(global))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsGlobalObject(global))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsGlobalObject(global)"
, "../TestJSImplGenBinding.cpp", 46132); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { *((volatile
int*)__null) = 46132; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46133 JS::AssertObjectIsNotGray(global);
46134
46135 // That might have ended up wrapping us already, due to the wonders
46136 // of XBL. Check for that, and bail out as needed.
46137 aReflector.set(aCache->GetWrapper());
46138 if (aReflector) {
46139#ifdef DEBUG1
46140 AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
46141#endif // DEBUG
46142 return true;
46143 }
46144
46145 JSAutoRealm ar(aCx, global);
46146 JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
46147 if (!canonicalProto) {
46148 return false;
46149 }
46150 JS::Rooted<JSObject*> proto(aCx);
46151 if (aGivenProto) {
46152 proto = aGivenProto;
46153 // Unfortunately, while aGivenProto was in the compartment of aCx
46154 // coming in, we changed compartments to that of "parent" so may need
46155 // to wrap the proto here.
46156 if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) {
46157 if (!JS_WrapObject(aCx, &proto)) {
46158 return false;
46159 }
46160 }
46161 } else {
46162 proto = canonicalProto;
46163 }
46164
46165 BindingJSObjectCreator<mozilla::dom::TestJSImplInterface> creator(aCx);
46166 creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
46167 if (!aReflector) {
46168 return false;
46169 }
46170
46171 aCache->SetWrapper(aReflector);
46172 creator.InitializationSucceeded();
46173
46174 MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aCache->GetWrapperPreserveColor() && aCache
->GetWrapperPreserveColor() == aReflector)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aCache->GetWrapperPreserveColor
() && aCache->GetWrapperPreserveColor() == aReflector
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
, "../TestJSImplGenBinding.cpp", 46175); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { *((volatile int*)__null) = 46175; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46175 aCache->GetWrapperPreserveColor() == aReflector)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aCache->GetWrapperPreserveColor() && aCache
->GetWrapperPreserveColor() == aReflector)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aCache->GetWrapperPreserveColor
() && aCache->GetWrapperPreserveColor() == aReflector
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
, "../TestJSImplGenBinding.cpp", 46175); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { *((volatile int*)__null) = 46175; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46176 // If proto != canonicalProto, we have to preserve our wrapper;
46177 // otherwise we won't be able to properly recreate it later, since
46178 // we won't know what proto to use. Note that we don't check
46179 // aGivenProto here, since it's entirely possible (and even
46180 // somewhat common) to have a non-null aGivenProto which is the
46181 // same as canonicalProto.
46182 if (proto != canonicalProto) {
46183 PreserveWrapper(aObject);
46184 }
46185
46186 return true;
46187}
46188
46189void
46190CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
46191{
46192 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplInterface);
46193 JS::Heap<JSObject*>* interfaceCache = &aProtoAndIfaceCache.EntrySlotOrCreate(constructors::id::TestJSImplInterface);
46194
46195 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
46196 if (!parentProto) {
46197 return;
46198 }
46199
46200 JS::Handle<JSObject*> constructorProto(JS::GetRealmFunctionPrototypeHandle(aCx));
46201 if (!constructorProto) {
46202 return;
46203 }
46204
46205 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
46206 &sPrototypeClass, protoCache,
46207 constructorProto, &sInterfaceObjectInfo, 15, false, Span<const LegacyFactoryFunction, 0>{},
46208 interfaceCache,
46209 sNativeProperties.Upcast(),
46210 sChromeOnlyNativeProperties.Upcast(),
46211 "TestJSImplInterface",
46212 aDefineOnGlobal != DefineInterfaceProperty::No,
46213 nullptr,
46214 false,
46215 nullptr);
46216}
46217
46218JS::Handle<JSObject*>
46219GetProtoObjectHandle(JSContext* aCx)
46220{
46221 /* Get the interface prototype object for this class. This will create the
46222 object as needed. */
46223 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplInterface,
46224 &CreateInterfaceObjects,
46225 DefineInterfaceProperty::CheckExposure);
46226
46227}
46228
46229JSObject*
46230GetProtoObject(JSContext* aCx)
46231{
46232 return GetProtoObjectHandle(aCx);
46233}
46234
46235JS::Handle<JSObject*>
46236GetConstructorObjectHandle(JSContext* aCx)
46237{
46238 /* Get the interface object for this class. This will create the object as
46239 needed. */
46240
46241 return GetPerInterfaceObjectHandle(aCx, constructors::id::TestJSImplInterface,
46242 &CreateInterfaceObjects,
46243 DefineInterfaceProperty::CheckExposure);
46244}
46245
46246} // namespace TestJSImplInterface_Binding
46247
46248
46249
46250namespace TestJSImplNoInterfaceObject_Binding {
46251
46252static bool
46253_addProperty(JSContext* cx, JS::Handle<JSObject*> obj, JS::Handle<jsid> id, JS::Handle<JS::Value> val)
46254{
46255 mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj);
46256 // We don't want to preserve if we don't have a wrapper, and we
46257 // obviously can't preserve if we're not initialized.
46258 if (self && self->GetWrapperPreserveColor()) {
46259 PreserveWrapper(self);
46260 }
46261 return true;
46262}
46263
46264static void
46265_finalize(JS::GCContext* gcx, JSObject* obj)
46266{
46267 mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj);
46268 if (self) {
46269 JS::SetReservedSlot(obj, DOM_OBJECT_SLOT0, JS::UndefinedValue());
46270 ClearWrapper(self, self, obj);
46271 if (size_t mallocBytes = BindingJSObjectMallocBytes(self)) {
46272 JS::RemoveAssociatedMemory(obj, mallocBytes,
46273 JS::MemoryUse::DOMBinding);
46274 }
46275 AddForDeferredFinalization<mozilla::dom::TestJSImplNoInterfaceObject>(self);
46276 }
46277}
46278
46279static nsWrapperCache*
46280_getWrapperCache(JS::Handle<JSObject*> obj)
46281{
46282 mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj);
46283 return self;
46284}
46285
46286static size_t
46287_objectMoved(JSObject* obj, JSObject* old)
46288{
46289 mozilla::dom::TestJSImplNoInterfaceObject* self = UnwrapPossiblyNotInitializedDOMObject<mozilla::dom::TestJSImplNoInterfaceObject>(obj);
46290 if (self) {
46291 UpdateWrapper(self, self, obj, old);
46292 }
46293
46294 return 0;
46295}
46296
46297bool sNativePropertiesInited = false;
46298const NativePropertyHooks sNativePropertyHooks = {
46299 nullptr,
46300 { nullptr, nullptr, &sNativePropertiesInited },
46301 prototypes::id::TestJSImplNoInterfaceObject,
46302 constructors::id::_ID_Count,
46303 &DefaultXrayExpandoObjectClass
46304};
46305
46306static const DOMIfaceAndProtoJSClass sPrototypeClass = {
46307 {
46308 "TestJSImplNoInterfaceObjectPrototype",
46309 JSCLASS_IS_DOMIFACEANDPROTOJSCLASSJSCLASS_USERBIT2 | JSCLASS_HAS_RESERVED_SLOTS(DOM_INTERFACE_PROTO_SLOTS_BASE0),
46310 JS_NULL_CLASS_OPS,
46311 JS_NULL_CLASS_SPEC,
46312 JS_NULL_CLASS_EXT,
46313 JS_NULL_OBJECT_OPS
46314 },
46315 eInterfacePrototype,
46316 prototypes::id::TestJSImplNoInterfaceObject,
46317 PrototypeTraits<prototypes::id::TestJSImplNoInterfaceObject>::Depth,
46318 &sNativePropertyHooks,
46319 JS::GetRealmObjectPrototype
46320};
46321
46322static JS::Handle<JSObject*>
46323GetProtoObjectHandle(JSContext* aCx);
46324
46325static const JSClassOps sClassOps = {
46326 _addProperty, /* addProperty */
46327 nullptr, /* delProperty */
46328 nullptr, /* enumerate */
46329 nullptr, /* newEnumerate */
46330 nullptr, /* resolve */
46331 nullptr, /* mayResolve */
46332 _finalize, /* finalize */
46333 nullptr, /* call */
46334 nullptr, /* construct */
46335 nullptr, /* trace */
46336};
46337
46338static const js::ClassExtension sClassExtension = {
46339 _objectMoved /* objectMovedOp */
46340};
46341
46342static const DOMJSClass sClass = {
46343 { "TestJSImplNoInterfaceObject",
46344 JSCLASS_IS_DOMJSCLASS | JSCLASS_FOREGROUND_FINALIZE | JSCLASS_HAS_RESERVED_SLOTS(1),
46345 &sClassOps,
46346 JS_NULL_CLASS_SPEC,
46347 &sClassExtension,
46348 JS_NULL_OBJECT_OPS
46349 },
46350 { prototypes::id::TestJSImplNoInterfaceObject, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count, prototypes::id::_ID_Count },
46351 std::is_base_of_v<nsISupports, mozilla::dom::TestJSImplNoInterfaceObject>,
46352 &sNativePropertyHooks,
46353 FindAssociatedGlobalForNative<mozilla::dom::TestJSImplNoInterfaceObject>::Get,
46354 GetProtoObjectHandle,
46355 GetCCParticipant<mozilla::dom::TestJSImplNoInterfaceObject>::Get(),
46356 nullptr,
46357 _getWrapperCache
46358};
46359static_assert(1 == DOM_INSTANCE_RESERVED_SLOTS1,
46360 "Must have the right minimal number of reserved slots.");
46361static_assert(1 >= 1,
46362 "Must have enough reserved slots.");
46363
46364bool
46365Wrap(JSContext* aCx, mozilla::dom::TestJSImplNoInterfaceObject* aObject, nsWrapperCache* aCache, JS::Handle<JSObject*> aGivenProto, JS::MutableHandle<JSObject*> aReflector)
46366{
46367 static_assert(!std::is_base_of_v<NonRefcountedDOMObject, mozilla::dom::TestJSImplNoInterfaceObject>,
46368 "Shouldn't have wrappercached things that are not refcounted.");
46369 static_assert(std::is_same_v<decltype(aObject), mozilla::dom::TestJSImplNoInterfaceObject*>);
46370 MOZ_ASSERT(ToSupportsIsCorrect(aObject))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsCorrect(aObject))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(ToSupportsIsCorrect(aObject)
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"ToSupportsIsCorrect(aObject)", "../TestJSImplGenBinding.cpp"
, 46370); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsCorrect(aObject)"
")"); do { *((volatile int*)__null) = 46370; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46371 MOZ_ASSERT_IF(aGivenProto, js::IsObjectInContextCompartment(aGivenProto, aCx))do { if (aGivenProto) { do { static_assert( mozilla::detail::
AssertionConditionType<decltype(js::IsObjectInContextCompartment
(aGivenProto, aCx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(js::IsObjectInContextCompartment
(aGivenProto, aCx)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("js::IsObjectInContextCompartment(aGivenProto, aCx)", "../TestJSImplGenBinding.cpp"
, 46371); AnnotateMozCrashReason("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(aGivenProto, aCx)"
")"); do { *((volatile int*)__null) = 46371; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
46372 MOZ_ASSERT(!aCache->GetWrapper(),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46374); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46374; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
46373 "You should probably not be using Wrap() directly; use "do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46374); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46374; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
46374 "GetOrCreateDOMReflector instead")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapper())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapper()))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("!aCache->GetWrapper()"
" (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")", "../TestJSImplGenBinding.cpp"
, 46374); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapper()"
") (" "You should probably not be using Wrap() directly; use "
"GetOrCreateDOMReflector instead" ")"); do { *((volatile int
*)__null) = 46374; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46375
46376 MOZ_ASSERT(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" " ("
"nsISupports must be on our primary inheritance chain" ")", "../TestJSImplGenBinding.cpp"
, 46377); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { *((volatile int*)__null) = 46377; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46377 "nsISupports must be on our primary inheritance chain")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
))>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)" " ("
"nsISupports must be on our primary inheritance chain" ")", "../TestJSImplGenBinding.cpp"
, 46377); AnnotateMozCrashReason("MOZ_ASSERT" "(" "ToSupportsIsOnPrimaryInheritanceChain(aObject, aCache)"
") (" "nsISupports must be on our primary inheritance chain"
")"); do { *((volatile int*)__null) = 46377; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46378
46379 // If the wrapper cache contains a dead reflector then finalize that
46380 // now, ensuring that the finalizer for the old reflector always
46381 // runs before the new reflector is created and attached. This
46382 // avoids the awkward situation where there are multiple reflector
46383 // objects that contain pointers to the same native.
46384
46385 if (JSObject* oldReflector = aCache->GetWrapperMaybeDead()) {
46386 _finalize(nullptr /* unused */, oldReflector);
46387 MOZ_ASSERT(!aCache->GetWrapperMaybeDead())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!aCache->GetWrapperMaybeDead())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aCache->GetWrapperMaybeDead
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!aCache->GetWrapperMaybeDead()", "../TestJSImplGenBinding.cpp"
, 46387); AnnotateMozCrashReason("MOZ_ASSERT" "(" "!aCache->GetWrapperMaybeDead()"
")"); do { *((volatile int*)__null) = 46387; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46388 }
46389
46390 JS::Rooted<JSObject*> global(aCx, FindAssociatedGlobal(aCx, aObject->GetParentObject()));
46391 if (!global) {
46392 return false;
46393 }
46394 MOZ_ASSERT(JS_IsGlobalObject(global))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsGlobalObject(global))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsGlobalObject(global))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsGlobalObject(global)"
, "../TestJSImplGenBinding.cpp", 46394); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsGlobalObject(global)" ")"); do { *((volatile
int*)__null) = 46394; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46395 JS::AssertObjectIsNotGray(global);
46396
46397 // That might have ended up wrapping us already, due to the wonders
46398 // of XBL. Check for that, and bail out as needed.
46399 aReflector.set(aCache->GetWrapper());
46400 if (aReflector) {
46401#ifdef DEBUG1
46402 AssertReflectorHasGivenProto(aCx, aReflector, aGivenProto);
46403#endif // DEBUG
46404 return true;
46405 }
46406
46407 JSAutoRealm ar(aCx, global);
46408 JS::Handle<JSObject*> canonicalProto = GetProtoObjectHandle(aCx);
46409 if (!canonicalProto) {
46410 return false;
46411 }
46412 JS::Rooted<JSObject*> proto(aCx);
46413 if (aGivenProto) {
46414 proto = aGivenProto;
46415 // Unfortunately, while aGivenProto was in the compartment of aCx
46416 // coming in, we changed compartments to that of "parent" so may need
46417 // to wrap the proto here.
46418 if (js::GetContextCompartment(aCx) != JS::GetCompartment(proto)) {
46419 if (!JS_WrapObject(aCx, &proto)) {
46420 return false;
46421 }
46422 }
46423 } else {
46424 proto = canonicalProto;
46425 }
46426
46427 BindingJSObjectCreator<mozilla::dom::TestJSImplNoInterfaceObject> creator(aCx);
46428 creator.CreateObject(aCx, sClass.ToJSClass(), proto, aObject, aReflector);
46429 if (!aReflector) {
46430 return false;
46431 }
46432
46433 aCache->SetWrapper(aReflector);
46434 creator.InitializationSucceeded();
46435
46436 MOZ_ASSERT(aCache->GetWrapperPreserveColor() &&do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aCache->GetWrapperPreserveColor() && aCache
->GetWrapperPreserveColor() == aReflector)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aCache->GetWrapperPreserveColor
() && aCache->GetWrapperPreserveColor() == aReflector
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
, "../TestJSImplGenBinding.cpp", 46437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { *((volatile int*)__null) = 46437; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
46437 aCache->GetWrapperPreserveColor() == aReflector)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(aCache->GetWrapperPreserveColor() && aCache
->GetWrapperPreserveColor() == aReflector)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(aCache->GetWrapperPreserveColor
() && aCache->GetWrapperPreserveColor() == aReflector
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
, "../TestJSImplGenBinding.cpp", 46437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "aCache->GetWrapperPreserveColor() && aCache->GetWrapperPreserveColor() == aReflector"
")"); do { *((volatile int*)__null) = 46437; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
46438 // If proto != canonicalProto, we have to preserve our wrapper;
46439 // otherwise we won't be able to properly recreate it later, since
46440 // we won't know what proto to use. Note that we don't check
46441 // aGivenProto here, since it's entirely possible (and even
46442 // somewhat common) to have a non-null aGivenProto which is the
46443 // same as canonicalProto.
46444 if (proto != canonicalProto) {
46445 PreserveWrapper(aObject);
46446 }
46447
46448 return true;
46449}
46450
46451void
46452CreateInterfaceObjects(JSContext* aCx, JS::Handle<JSObject*> aGlobal, ProtoAndIfaceCache& aProtoAndIfaceCache, DefineInterfaceProperty aDefineOnGlobal)
46453{
46454 JS::Heap<JSObject*>* protoCache = &aProtoAndIfaceCache.EntrySlotOrCreate(prototypes::id::TestJSImplNoInterfaceObject);
46455 JS::Heap<JSObject*>* interfaceCache = nullptr;
46456
46457 JS::Handle<JSObject*> parentProto(JS::GetRealmObjectPrototypeHandle(aCx));
46458 if (!parentProto) {
46459 return;
46460 }
46461
46462 dom::CreateInterfaceObjects(aCx, aGlobal, parentProto,
46463 &sPrototypeClass, protoCache,
46464 nullptr, nullptr, 0, false, Span<const LegacyFactoryFunction, 0>{},
46465 interfaceCache,
46466 nullptr,
46467 nullptr,
46468 "TestJSImplNoInterfaceObject",
46469 aDefineOnGlobal != DefineInterfaceProperty::No,
46470 nullptr,
46471 false,
46472 nullptr);
46473}
46474
46475static JS::Handle<JSObject*>
46476GetProtoObjectHandle(JSContext* aCx)
46477{
46478 /* Get the interface prototype object for this class. This will create the
46479 object as needed. */
46480 return GetPerInterfaceObjectHandle(aCx, prototypes::id::TestJSImplNoInterfaceObject,
46481 &CreateInterfaceObjects,
46482 DefineInterfaceProperty::CheckExposure);
46483
46484}
46485
46486} // namespace TestJSImplNoInterfaceObject_Binding
46487
46488
46489
46490void
46491TestJSImplInterfaceJSImpl::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
46492{
46493 CallSetup s(this, aRv, "TestJSImplInterface.passByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46494 if (aRv.Failed()) {
46495 return;
46496 }
46497 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46497); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46497; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46498 BindingCallContext& cx = s.GetCallContext();
46499
46500 JS::Rooted<JS::Value> rval(cx);
46501 JS::RootedVector<JS::Value> argv(cx);
46502 if (!argv.resize(1)) {
46503 // That threw an exception on the JSContext, and our CallSetup will do
46504 // the right thing with that.
46505 return;
46506 }
46507 unsigned argc = 1;
46508
46509 do {
46510 argv[0].setInt32(int32_t(arg));
46511 break;
46512 } while (false);
46513
46514 JS::Rooted<JS::Value> callable(cx);
46515 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46516 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46517 !InitIds(cx, atomsCache)) ||
46518 !GetCallableProperty(cx, atomsCache->passByte_id, &callable)) {
46519 aRv.Throw(NS_ERROR_UNEXPECTED);
46520 return;
46521 }
46522 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46523 if (!JS::Call(cx, thisValue, callable,
46524 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46525 aRv.NoteJSContextException(cx);
46526 return;
46527 }
46528}
46529
46530int8_t
46531TestJSImplInterfaceJSImpl::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm)
46532{
46533 CallSetup s(this, aRv, "TestJSImplInterface.receiveByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46534 if (aRv.Failed()) {
46535 return int8_t(0);
46536 }
46537 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46537); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46537; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46538 BindingCallContext& cx = s.GetCallContext();
46539
46540 JS::Rooted<JS::Value> rval(cx);
46541
46542 JS::Rooted<JS::Value> callable(cx);
46543 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46544 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46545 !InitIds(cx, atomsCache)) ||
46546 !GetCallableProperty(cx, atomsCache->receiveByte_id, &callable)) {
46547 aRv.Throw(NS_ERROR_UNEXPECTED);
46548 return int8_t(0);
46549 }
46550 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46551 if (!JS::Call(cx, thisValue, callable,
46552 JS::HandleValueArray::empty(), &rval)) {
46553 aRv.NoteJSContextException(cx);
46554 return int8_t(0);
46555 }
46556 int8_t rvalDecl;
46557 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveByte", &rvalDecl)) {
46558 aRv.Throw(NS_ERROR_UNEXPECTED);
46559 return int8_t(0);
46560 }
46561 return rvalDecl;
46562}
46563
46564void
46565TestJSImplInterfaceJSImpl::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46566{
46567 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46568 if (aRv.Failed()) {
46569 return;
46570 }
46571 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46571); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46571; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46572 BindingCallContext& cx = s.GetCallContext();
46573
46574 JS::Rooted<JS::Value> rval(cx);
46575 JS::RootedVector<JS::Value> argv(cx);
46576 if (!argv.resize(1)) {
46577 // That threw an exception on the JSContext, and our CallSetup will do
46578 // the right thing with that.
46579 return;
46580 }
46581 unsigned argc = 1;
46582
46583 do {
46584 if (arg.WasPassed()) {
46585 argv[0].setInt32(int32_t(arg.Value()));
46586 break;
46587 } else if (argc == 1) {
46588 // This is our current trailing argument; reduce argc
46589 --argc;
46590 } else {
46591 argv[0].setUndefined();
46592 }
46593 } while (false);
46594
46595 JS::Rooted<JS::Value> callable(cx);
46596 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46597 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46598 !InitIds(cx, atomsCache)) ||
46599 !GetCallableProperty(cx, atomsCache->passOptionalByte_id, &callable)) {
46600 aRv.Throw(NS_ERROR_UNEXPECTED);
46601 return;
46602 }
46603 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46604 if (!JS::Call(cx, thisValue, callable,
46605 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46606 aRv.NoteJSContextException(cx);
46607 return;
46608 }
46609}
46610
46611void
46612TestJSImplInterfaceJSImpl::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
46613{
46614 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46615 if (aRv.Failed()) {
46616 return;
46617 }
46618 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46618); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46618; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46619 BindingCallContext& cx = s.GetCallContext();
46620
46621 JS::Rooted<JS::Value> rval(cx);
46622 JS::RootedVector<JS::Value> argv(cx);
46623 if (!argv.resize(2)) {
46624 // That threw an exception on the JSContext, and our CallSetup will do
46625 // the right thing with that.
46626 return;
46627 }
46628 unsigned argc = 2;
46629
46630 do {
46631 argv[1].setInt32(int32_t(arg2));
46632 break;
46633 } while (false);
46634
46635 do {
46636 if (arg1.WasPassed()) {
46637 argv[0].setInt32(int32_t(arg1.Value()));
46638 break;
46639 } else if (argc == 1) {
46640 // This is our current trailing argument; reduce argc
46641 --argc;
46642 } else {
46643 argv[0].setUndefined();
46644 }
46645 } while (false);
46646
46647 JS::Rooted<JS::Value> callable(cx);
46648 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46649 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46650 !InitIds(cx, atomsCache)) ||
46651 !GetCallableProperty(cx, atomsCache->passOptionalByteBeforeRequired_id, &callable)) {
46652 aRv.Throw(NS_ERROR_UNEXPECTED);
46653 return;
46654 }
46655 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46656 if (!JS::Call(cx, thisValue, callable,
46657 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46658 aRv.NoteJSContextException(cx);
46659 return;
46660 }
46661}
46662
46663void
46664TestJSImplInterfaceJSImpl::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
46665{
46666 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46667 if (aRv.Failed()) {
46668 return;
46669 }
46670 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46670; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46671 BindingCallContext& cx = s.GetCallContext();
46672
46673 JS::Rooted<JS::Value> rval(cx);
46674 JS::RootedVector<JS::Value> argv(cx);
46675 if (!argv.resize(1)) {
46676 // That threw an exception on the JSContext, and our CallSetup will do
46677 // the right thing with that.
46678 return;
46679 }
46680 unsigned argc = 1;
46681
46682 do {
46683 argv[0].setInt32(int32_t(arg));
46684 break;
46685 } while (false);
46686
46687 JS::Rooted<JS::Value> callable(cx);
46688 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46689 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46690 !InitIds(cx, atomsCache)) ||
46691 !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefault_id, &callable)) {
46692 aRv.Throw(NS_ERROR_UNEXPECTED);
46693 return;
46694 }
46695 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46696 if (!JS::Call(cx, thisValue, callable,
46697 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46698 aRv.NoteJSContextException(cx);
46699 return;
46700 }
46701}
46702
46703void
46704TestJSImplInterfaceJSImpl::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
46705{
46706 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteWithDefaultBeforeRequired", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46707 if (aRv.Failed()) {
46708 return;
46709 }
46710 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46710); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46710; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46711 BindingCallContext& cx = s.GetCallContext();
46712
46713 JS::Rooted<JS::Value> rval(cx);
46714 JS::RootedVector<JS::Value> argv(cx);
46715 if (!argv.resize(2)) {
46716 // That threw an exception on the JSContext, and our CallSetup will do
46717 // the right thing with that.
46718 return;
46719 }
46720 unsigned argc = 2;
46721
46722 do {
46723 argv[1].setInt32(int32_t(arg2));
46724 break;
46725 } while (false);
46726
46727 do {
46728 argv[0].setInt32(int32_t(arg1));
46729 break;
46730 } while (false);
46731
46732 JS::Rooted<JS::Value> callable(cx);
46733 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46734 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46735 !InitIds(cx, atomsCache)) ||
46736 !GetCallableProperty(cx, atomsCache->passOptionalByteWithDefaultBeforeRequired_id, &callable)) {
46737 aRv.Throw(NS_ERROR_UNEXPECTED);
46738 return;
46739 }
46740 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46741 if (!JS::Call(cx, thisValue, callable,
46742 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46743 aRv.NoteJSContextException(cx);
46744 return;
46745 }
46746}
46747
46748void
46749TestJSImplInterfaceJSImpl::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46750{
46751 CallSetup s(this, aRv, "TestJSImplInterface.passNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46752 if (aRv.Failed()) {
46753 return;
46754 }
46755 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46755); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46755; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46756 BindingCallContext& cx = s.GetCallContext();
46757
46758 JS::Rooted<JS::Value> rval(cx);
46759 JS::RootedVector<JS::Value> argv(cx);
46760 if (!argv.resize(1)) {
46761 // That threw an exception on the JSContext, and our CallSetup will do
46762 // the right thing with that.
46763 return;
46764 }
46765 unsigned argc = 1;
46766
46767 do {
46768 if (arg.IsNull()) {
46769 argv[0].setNull();
46770 break;
46771 }
46772 argv[0].setInt32(int32_t(arg.Value()));
46773 break;
46774 } while (false);
46775
46776 JS::Rooted<JS::Value> callable(cx);
46777 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46778 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46779 !InitIds(cx, atomsCache)) ||
46780 !GetCallableProperty(cx, atomsCache->passNullableByte_id, &callable)) {
46781 aRv.Throw(NS_ERROR_UNEXPECTED);
46782 return;
46783 }
46784 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46785 if (!JS::Call(cx, thisValue, callable,
46786 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46787 aRv.NoteJSContextException(cx);
46788 return;
46789 }
46790}
46791
46792void
46793TestJSImplInterfaceJSImpl::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46794{
46795 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46796 if (aRv.Failed()) {
46797 return;
46798 }
46799 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46799); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46799; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46800 BindingCallContext& cx = s.GetCallContext();
46801
46802 JS::Rooted<JS::Value> rval(cx);
46803 JS::RootedVector<JS::Value> argv(cx);
46804 if (!argv.resize(1)) {
46805 // That threw an exception on the JSContext, and our CallSetup will do
46806 // the right thing with that.
46807 return;
46808 }
46809 unsigned argc = 1;
46810
46811 do {
46812 if (arg.WasPassed()) {
46813 if (arg.Value().IsNull()) {
46814 argv[0].setNull();
46815 break;
46816 }
46817 argv[0].setInt32(int32_t(arg.Value().Value()));
46818 break;
46819 } else if (argc == 1) {
46820 // This is our current trailing argument; reduce argc
46821 --argc;
46822 } else {
46823 argv[0].setUndefined();
46824 }
46825 } while (false);
46826
46827 JS::Rooted<JS::Value> callable(cx);
46828 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46829 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46830 !InitIds(cx, atomsCache)) ||
46831 !GetCallableProperty(cx, atomsCache->passOptionalNullableByte_id, &callable)) {
46832 aRv.Throw(NS_ERROR_UNEXPECTED);
46833 return;
46834 }
46835 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46836 if (!JS::Call(cx, thisValue, callable,
46837 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46838 aRv.NoteJSContextException(cx);
46839 return;
46840 }
46841}
46842
46843void
46844TestJSImplInterfaceJSImpl::PassVariadicByte(const nsTArray<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
46845{
46846 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46847 if (aRv.Failed()) {
46848 return;
46849 }
46850 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46850); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46850; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46851 BindingCallContext& cx = s.GetCallContext();
46852
46853 JS::Rooted<JS::Value> rval(cx);
46854 JS::RootedVector<JS::Value> argv(cx);
46855 if (!argv.resize((1 - 1) + arg.Length())) {
46856 // That threw an exception on the JSContext, and our CallSetup will do
46857 // the right thing with that.
46858 return;
46859 }
46860 unsigned argc = (1 - 1) + arg.Length();
46861
46862 do {
46863 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
46864 argv[0 + idx].setInt32(int32_t(arg[idx]));
46865 continue;
46866 }
46867 break;
46868 } while (false);
46869
46870 JS::Rooted<JS::Value> callable(cx);
46871 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46872 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46873 !InitIds(cx, atomsCache)) ||
46874 !GetCallableProperty(cx, atomsCache->passVariadicByte_id, &callable)) {
46875 aRv.Throw(NS_ERROR_UNEXPECTED);
46876 return;
46877 }
46878 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46879 if (!JS::Call(cx, thisValue, callable,
46880 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
46881 aRv.NoteJSContextException(cx);
46882 return;
46883 }
46884}
46885
46886int8_t
46887TestJSImplInterfaceJSImpl::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm)
46888{
46889 CallSetup s(this, aRv, "TestJSImplInterface.returnByteSideEffectFree", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46890 if (aRv.Failed()) {
46891 return int8_t(0);
46892 }
46893 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46893); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46893; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46894 BindingCallContext& cx = s.GetCallContext();
46895
46896 JS::Rooted<JS::Value> rval(cx);
46897
46898 JS::Rooted<JS::Value> callable(cx);
46899 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46900 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46901 !InitIds(cx, atomsCache)) ||
46902 !GetCallableProperty(cx, atomsCache->returnByteSideEffectFree_id, &callable)) {
46903 aRv.Throw(NS_ERROR_UNEXPECTED);
46904 return int8_t(0);
46905 }
46906 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46907 if (!JS::Call(cx, thisValue, callable,
46908 JS::HandleValueArray::empty(), &rval)) {
46909 aRv.NoteJSContextException(cx);
46910 return int8_t(0);
46911 }
46912 int8_t rvalDecl;
46913 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnByteSideEffectFree", &rvalDecl)) {
46914 aRv.Throw(NS_ERROR_UNEXPECTED);
46915 return int8_t(0);
46916 }
46917 return rvalDecl;
46918}
46919
46920int8_t
46921TestJSImplInterfaceJSImpl::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
46922{
46923 CallSetup s(this, aRv, "TestJSImplInterface.returnDOMDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46924 if (aRv.Failed()) {
46925 return int8_t(0);
46926 }
46927 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46927); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46927; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46928 BindingCallContext& cx = s.GetCallContext();
46929
46930 JS::Rooted<JS::Value> rval(cx);
46931
46932 JS::Rooted<JS::Value> callable(cx);
46933 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46934 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46935 !InitIds(cx, atomsCache)) ||
46936 !GetCallableProperty(cx, atomsCache->returnDOMDependentByte_id, &callable)) {
46937 aRv.Throw(NS_ERROR_UNEXPECTED);
46938 return int8_t(0);
46939 }
46940 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46941 if (!JS::Call(cx, thisValue, callable,
46942 JS::HandleValueArray::empty(), &rval)) {
46943 aRv.NoteJSContextException(cx);
46944 return int8_t(0);
46945 }
46946 int8_t rvalDecl;
46947 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDOMDependentByte", &rvalDecl)) {
46948 aRv.Throw(NS_ERROR_UNEXPECTED);
46949 return int8_t(0);
46950 }
46951 return rvalDecl;
46952}
46953
46954int8_t
46955TestJSImplInterfaceJSImpl::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
46956{
46957 CallSetup s(this, aRv, "TestJSImplInterface.returnConstantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46958 if (aRv.Failed()) {
46959 return int8_t(0);
46960 }
46961 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46961); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46961; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46962 BindingCallContext& cx = s.GetCallContext();
46963
46964 JS::Rooted<JS::Value> rval(cx);
46965
46966 JS::Rooted<JS::Value> callable(cx);
46967 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
46968 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
46969 !InitIds(cx, atomsCache)) ||
46970 !GetCallableProperty(cx, atomsCache->returnConstantByte_id, &callable)) {
46971 aRv.Throw(NS_ERROR_UNEXPECTED);
46972 return int8_t(0);
46973 }
46974 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
46975 if (!JS::Call(cx, thisValue, callable,
46976 JS::HandleValueArray::empty(), &rval)) {
46977 aRv.NoteJSContextException(cx);
46978 return int8_t(0);
46979 }
46980 int8_t rvalDecl;
46981 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnConstantByte", &rvalDecl)) {
46982 aRv.Throw(NS_ERROR_UNEXPECTED);
46983 return int8_t(0);
46984 }
46985 return rvalDecl;
46986}
46987
46988int8_t
46989TestJSImplInterfaceJSImpl::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
46990{
46991 CallSetup s(this, aRv, "TestJSImplInterface.returnDeviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
46992 if (aRv.Failed()) {
46993 return int8_t(0);
46994 }
46995 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 46995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 46995; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
46996 BindingCallContext& cx = s.GetCallContext();
46997
46998 JS::Rooted<JS::Value> rval(cx);
46999
47000 JS::Rooted<JS::Value> callable(cx);
47001 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47002 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47003 !InitIds(cx, atomsCache)) ||
47004 !GetCallableProperty(cx, atomsCache->returnDeviceStateDependentByte_id, &callable)) {
47005 aRv.Throw(NS_ERROR_UNEXPECTED);
47006 return int8_t(0);
47007 }
47008 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47009 if (!JS::Call(cx, thisValue, callable,
47010 JS::HandleValueArray::empty(), &rval)) {
47011 aRv.NoteJSContextException(cx);
47012 return int8_t(0);
47013 }
47014 int8_t rvalDecl;
47015 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.returnDeviceStateDependentByte", &rvalDecl)) {
47016 aRv.Throw(NS_ERROR_UNEXPECTED);
47017 return int8_t(0);
47018 }
47019 return rvalDecl;
47020}
47021
47022void
47023TestJSImplInterfaceJSImpl::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47024{
47025 CallSetup s(this, aRv, "TestJSImplInterface.passShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47026 if (aRv.Failed()) {
47027 return;
47028 }
47029 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47029); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47029; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47030 BindingCallContext& cx = s.GetCallContext();
47031
47032 JS::Rooted<JS::Value> rval(cx);
47033 JS::RootedVector<JS::Value> argv(cx);
47034 if (!argv.resize(1)) {
47035 // That threw an exception on the JSContext, and our CallSetup will do
47036 // the right thing with that.
47037 return;
47038 }
47039 unsigned argc = 1;
47040
47041 do {
47042 argv[0].setInt32(int32_t(arg));
47043 break;
47044 } while (false);
47045
47046 JS::Rooted<JS::Value> callable(cx);
47047 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47048 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47049 !InitIds(cx, atomsCache)) ||
47050 !GetCallableProperty(cx, atomsCache->passShort_id, &callable)) {
47051 aRv.Throw(NS_ERROR_UNEXPECTED);
47052 return;
47053 }
47054 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47055 if (!JS::Call(cx, thisValue, callable,
47056 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47057 aRv.NoteJSContextException(cx);
47058 return;
47059 }
47060}
47061
47062int16_t
47063TestJSImplInterfaceJSImpl::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm)
47064{
47065 CallSetup s(this, aRv, "TestJSImplInterface.receiveShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47066 if (aRv.Failed()) {
47067 return int16_t(0);
47068 }
47069 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47069; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47070 BindingCallContext& cx = s.GetCallContext();
47071
47072 JS::Rooted<JS::Value> rval(cx);
47073
47074 JS::Rooted<JS::Value> callable(cx);
47075 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47076 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47077 !InitIds(cx, atomsCache)) ||
47078 !GetCallableProperty(cx, atomsCache->receiveShort_id, &callable)) {
47079 aRv.Throw(NS_ERROR_UNEXPECTED);
47080 return int16_t(0);
47081 }
47082 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47083 if (!JS::Call(cx, thisValue, callable,
47084 JS::HandleValueArray::empty(), &rval)) {
47085 aRv.NoteJSContextException(cx);
47086 return int16_t(0);
47087 }
47088 int16_t rvalDecl;
47089 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveShort", &rvalDecl)) {
47090 aRv.Throw(NS_ERROR_UNEXPECTED);
47091 return int16_t(0);
47092 }
47093 return rvalDecl;
47094}
47095
47096void
47097TestJSImplInterfaceJSImpl::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47098{
47099 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47100 if (aRv.Failed()) {
47101 return;
47102 }
47103 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47103); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47103; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47104 BindingCallContext& cx = s.GetCallContext();
47105
47106 JS::Rooted<JS::Value> rval(cx);
47107 JS::RootedVector<JS::Value> argv(cx);
47108 if (!argv.resize(1)) {
47109 // That threw an exception on the JSContext, and our CallSetup will do
47110 // the right thing with that.
47111 return;
47112 }
47113 unsigned argc = 1;
47114
47115 do {
47116 if (arg.WasPassed()) {
47117 argv[0].setInt32(int32_t(arg.Value()));
47118 break;
47119 } else if (argc == 1) {
47120 // This is our current trailing argument; reduce argc
47121 --argc;
47122 } else {
47123 argv[0].setUndefined();
47124 }
47125 } while (false);
47126
47127 JS::Rooted<JS::Value> callable(cx);
47128 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47129 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47130 !InitIds(cx, atomsCache)) ||
47131 !GetCallableProperty(cx, atomsCache->passOptionalShort_id, &callable)) {
47132 aRv.Throw(NS_ERROR_UNEXPECTED);
47133 return;
47134 }
47135 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47136 if (!JS::Call(cx, thisValue, callable,
47137 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47138 aRv.NoteJSContextException(cx);
47139 return;
47140 }
47141}
47142
47143void
47144TestJSImplInterfaceJSImpl::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47145{
47146 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47147 if (aRv.Failed()) {
47148 return;
47149 }
47150 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47150); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47150; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47151 BindingCallContext& cx = s.GetCallContext();
47152
47153 JS::Rooted<JS::Value> rval(cx);
47154 JS::RootedVector<JS::Value> argv(cx);
47155 if (!argv.resize(1)) {
47156 // That threw an exception on the JSContext, and our CallSetup will do
47157 // the right thing with that.
47158 return;
47159 }
47160 unsigned argc = 1;
47161
47162 do {
47163 argv[0].setInt32(int32_t(arg));
47164 break;
47165 } while (false);
47166
47167 JS::Rooted<JS::Value> callable(cx);
47168 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47169 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47170 !InitIds(cx, atomsCache)) ||
47171 !GetCallableProperty(cx, atomsCache->passOptionalShortWithDefault_id, &callable)) {
47172 aRv.Throw(NS_ERROR_UNEXPECTED);
47173 return;
47174 }
47175 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47176 if (!JS::Call(cx, thisValue, callable,
47177 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47178 aRv.NoteJSContextException(cx);
47179 return;
47180 }
47181}
47182
47183void
47184TestJSImplInterfaceJSImpl::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47185{
47186 CallSetup s(this, aRv, "TestJSImplInterface.passLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47187 if (aRv.Failed()) {
47188 return;
47189 }
47190 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47190; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47191 BindingCallContext& cx = s.GetCallContext();
47192
47193 JS::Rooted<JS::Value> rval(cx);
47194 JS::RootedVector<JS::Value> argv(cx);
47195 if (!argv.resize(1)) {
47196 // That threw an exception on the JSContext, and our CallSetup will do
47197 // the right thing with that.
47198 return;
47199 }
47200 unsigned argc = 1;
47201
47202 do {
47203 argv[0].setInt32(int32_t(arg));
47204 break;
47205 } while (false);
47206
47207 JS::Rooted<JS::Value> callable(cx);
47208 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47209 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47210 !InitIds(cx, atomsCache)) ||
47211 !GetCallableProperty(cx, atomsCache->passLong_id, &callable)) {
47212 aRv.Throw(NS_ERROR_UNEXPECTED);
47213 return;
47214 }
47215 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47216 if (!JS::Call(cx, thisValue, callable,
47217 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47218 aRv.NoteJSContextException(cx);
47219 return;
47220 }
47221}
47222
47223int32_t
47224TestJSImplInterfaceJSImpl::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm)
47225{
47226 CallSetup s(this, aRv, "TestJSImplInterface.receiveLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47227 if (aRv.Failed()) {
47228 return int32_t(0);
47229 }
47230 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47230); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47230; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47231 BindingCallContext& cx = s.GetCallContext();
47232
47233 JS::Rooted<JS::Value> rval(cx);
47234
47235 JS::Rooted<JS::Value> callable(cx);
47236 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47237 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47238 !InitIds(cx, atomsCache)) ||
47239 !GetCallableProperty(cx, atomsCache->receiveLong_id, &callable)) {
47240 aRv.Throw(NS_ERROR_UNEXPECTED);
47241 return int32_t(0);
47242 }
47243 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47244 if (!JS::Call(cx, thisValue, callable,
47245 JS::HandleValueArray::empty(), &rval)) {
47246 aRv.NoteJSContextException(cx);
47247 return int32_t(0);
47248 }
47249 int32_t rvalDecl;
47250 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLong", &rvalDecl)) {
47251 aRv.Throw(NS_ERROR_UNEXPECTED);
47252 return int32_t(0);
47253 }
47254 return rvalDecl;
47255}
47256
47257void
47258TestJSImplInterfaceJSImpl::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47259{
47260 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47261 if (aRv.Failed()) {
47262 return;
47263 }
47264 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47264); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47264; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47265 BindingCallContext& cx = s.GetCallContext();
47266
47267 JS::Rooted<JS::Value> rval(cx);
47268 JS::RootedVector<JS::Value> argv(cx);
47269 if (!argv.resize(1)) {
47270 // That threw an exception on the JSContext, and our CallSetup will do
47271 // the right thing with that.
47272 return;
47273 }
47274 unsigned argc = 1;
47275
47276 do {
47277 if (arg.WasPassed()) {
47278 argv[0].setInt32(int32_t(arg.Value()));
47279 break;
47280 } else if (argc == 1) {
47281 // This is our current trailing argument; reduce argc
47282 --argc;
47283 } else {
47284 argv[0].setUndefined();
47285 }
47286 } while (false);
47287
47288 JS::Rooted<JS::Value> callable(cx);
47289 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47290 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47291 !InitIds(cx, atomsCache)) ||
47292 !GetCallableProperty(cx, atomsCache->passOptionalLong_id, &callable)) {
47293 aRv.Throw(NS_ERROR_UNEXPECTED);
47294 return;
47295 }
47296 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47297 if (!JS::Call(cx, thisValue, callable,
47298 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47299 aRv.NoteJSContextException(cx);
47300 return;
47301 }
47302}
47303
47304void
47305TestJSImplInterfaceJSImpl::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47306{
47307 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47308 if (aRv.Failed()) {
47309 return;
47310 }
47311 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47311); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47311; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47312 BindingCallContext& cx = s.GetCallContext();
47313
47314 JS::Rooted<JS::Value> rval(cx);
47315 JS::RootedVector<JS::Value> argv(cx);
47316 if (!argv.resize(1)) {
47317 // That threw an exception on the JSContext, and our CallSetup will do
47318 // the right thing with that.
47319 return;
47320 }
47321 unsigned argc = 1;
47322
47323 do {
47324 argv[0].setInt32(int32_t(arg));
47325 break;
47326 } while (false);
47327
47328 JS::Rooted<JS::Value> callable(cx);
47329 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47330 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47331 !InitIds(cx, atomsCache)) ||
47332 !GetCallableProperty(cx, atomsCache->passOptionalLongWithDefault_id, &callable)) {
47333 aRv.Throw(NS_ERROR_UNEXPECTED);
47334 return;
47335 }
47336 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47337 if (!JS::Call(cx, thisValue, callable,
47338 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47339 aRv.NoteJSContextException(cx);
47340 return;
47341 }
47342}
47343
47344void
47345TestJSImplInterfaceJSImpl::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47346{
47347 CallSetup s(this, aRv, "TestJSImplInterface.passLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47348 if (aRv.Failed()) {
47349 return;
47350 }
47351 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47351); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47351; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47352 BindingCallContext& cx = s.GetCallContext();
47353
47354 JS::Rooted<JS::Value> rval(cx);
47355 JS::RootedVector<JS::Value> argv(cx);
47356 if (!argv.resize(1)) {
47357 // That threw an exception on the JSContext, and our CallSetup will do
47358 // the right thing with that.
47359 return;
47360 }
47361 unsigned argc = 1;
47362
47363 do {
47364 argv[0].set(JS_NumberValue(double(arg)));
47365 break;
47366 } while (false);
47367
47368 JS::Rooted<JS::Value> callable(cx);
47369 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47370 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47371 !InitIds(cx, atomsCache)) ||
47372 !GetCallableProperty(cx, atomsCache->passLongLong_id, &callable)) {
47373 aRv.Throw(NS_ERROR_UNEXPECTED);
47374 return;
47375 }
47376 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47377 if (!JS::Call(cx, thisValue, callable,
47378 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47379 aRv.NoteJSContextException(cx);
47380 return;
47381 }
47382}
47383
47384int64_t
47385TestJSImplInterfaceJSImpl::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm)
47386{
47387 CallSetup s(this, aRv, "TestJSImplInterface.receiveLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47388 if (aRv.Failed()) {
47389 return int64_t(0);
47390 }
47391 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47391); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47391; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47392 BindingCallContext& cx = s.GetCallContext();
47393
47394 JS::Rooted<JS::Value> rval(cx);
47395
47396 JS::Rooted<JS::Value> callable(cx);
47397 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47398 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47399 !InitIds(cx, atomsCache)) ||
47400 !GetCallableProperty(cx, atomsCache->receiveLongLong_id, &callable)) {
47401 aRv.Throw(NS_ERROR_UNEXPECTED);
47402 return int64_t(0);
47403 }
47404 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47405 if (!JS::Call(cx, thisValue, callable,
47406 JS::HandleValueArray::empty(), &rval)) {
47407 aRv.NoteJSContextException(cx);
47408 return int64_t(0);
47409 }
47410 int64_t rvalDecl;
47411 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveLongLong", &rvalDecl)) {
47412 aRv.Throw(NS_ERROR_UNEXPECTED);
47413 return int64_t(0);
47414 }
47415 return rvalDecl;
47416}
47417
47418void
47419TestJSImplInterfaceJSImpl::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47420{
47421 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47422 if (aRv.Failed()) {
47423 return;
47424 }
47425 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47425); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47425; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47426 BindingCallContext& cx = s.GetCallContext();
47427
47428 JS::Rooted<JS::Value> rval(cx);
47429 JS::RootedVector<JS::Value> argv(cx);
47430 if (!argv.resize(1)) {
47431 // That threw an exception on the JSContext, and our CallSetup will do
47432 // the right thing with that.
47433 return;
47434 }
47435 unsigned argc = 1;
47436
47437 do {
47438 if (arg.WasPassed()) {
47439 argv[0].set(JS_NumberValue(double(arg.Value())));
47440 break;
47441 } else if (argc == 1) {
47442 // This is our current trailing argument; reduce argc
47443 --argc;
47444 } else {
47445 argv[0].setUndefined();
47446 }
47447 } while (false);
47448
47449 JS::Rooted<JS::Value> callable(cx);
47450 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47451 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47452 !InitIds(cx, atomsCache)) ||
47453 !GetCallableProperty(cx, atomsCache->passOptionalLongLong_id, &callable)) {
47454 aRv.Throw(NS_ERROR_UNEXPECTED);
47455 return;
47456 }
47457 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47458 if (!JS::Call(cx, thisValue, callable,
47459 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47460 aRv.NoteJSContextException(cx);
47461 return;
47462 }
47463}
47464
47465void
47466TestJSImplInterfaceJSImpl::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47467{
47468 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47469 if (aRv.Failed()) {
47470 return;
47471 }
47472 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47472); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47472; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47473 BindingCallContext& cx = s.GetCallContext();
47474
47475 JS::Rooted<JS::Value> rval(cx);
47476 JS::RootedVector<JS::Value> argv(cx);
47477 if (!argv.resize(1)) {
47478 // That threw an exception on the JSContext, and our CallSetup will do
47479 // the right thing with that.
47480 return;
47481 }
47482 unsigned argc = 1;
47483
47484 do {
47485 argv[0].set(JS_NumberValue(double(arg)));
47486 break;
47487 } while (false);
47488
47489 JS::Rooted<JS::Value> callable(cx);
47490 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47491 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47492 !InitIds(cx, atomsCache)) ||
47493 !GetCallableProperty(cx, atomsCache->passOptionalLongLongWithDefault_id, &callable)) {
47494 aRv.Throw(NS_ERROR_UNEXPECTED);
47495 return;
47496 }
47497 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47498 if (!JS::Call(cx, thisValue, callable,
47499 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47500 aRv.NoteJSContextException(cx);
47501 return;
47502 }
47503}
47504
47505void
47506TestJSImplInterfaceJSImpl::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47507{
47508 CallSetup s(this, aRv, "TestJSImplInterface.passOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47509 if (aRv.Failed()) {
47510 return;
47511 }
47512 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47512); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47512; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47513 BindingCallContext& cx = s.GetCallContext();
47514
47515 JS::Rooted<JS::Value> rval(cx);
47516 JS::RootedVector<JS::Value> argv(cx);
47517 if (!argv.resize(1)) {
47518 // That threw an exception on the JSContext, and our CallSetup will do
47519 // the right thing with that.
47520 return;
47521 }
47522 unsigned argc = 1;
47523
47524 do {
47525 argv[0].setInt32(int32_t(arg));
47526 break;
47527 } while (false);
47528
47529 JS::Rooted<JS::Value> callable(cx);
47530 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47531 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47532 !InitIds(cx, atomsCache)) ||
47533 !GetCallableProperty(cx, atomsCache->passOctet_id, &callable)) {
47534 aRv.Throw(NS_ERROR_UNEXPECTED);
47535 return;
47536 }
47537 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47538 if (!JS::Call(cx, thisValue, callable,
47539 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47540 aRv.NoteJSContextException(cx);
47541 return;
47542 }
47543}
47544
47545uint8_t
47546TestJSImplInterfaceJSImpl::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm)
47547{
47548 CallSetup s(this, aRv, "TestJSImplInterface.receiveOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47549 if (aRv.Failed()) {
47550 return uint8_t(0);
47551 }
47552 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47552; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47553 BindingCallContext& cx = s.GetCallContext();
47554
47555 JS::Rooted<JS::Value> rval(cx);
47556
47557 JS::Rooted<JS::Value> callable(cx);
47558 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47559 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47560 !InitIds(cx, atomsCache)) ||
47561 !GetCallableProperty(cx, atomsCache->receiveOctet_id, &callable)) {
47562 aRv.Throw(NS_ERROR_UNEXPECTED);
47563 return uint8_t(0);
47564 }
47565 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47566 if (!JS::Call(cx, thisValue, callable,
47567 JS::HandleValueArray::empty(), &rval)) {
47568 aRv.NoteJSContextException(cx);
47569 return uint8_t(0);
47570 }
47571 uint8_t rvalDecl;
47572 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveOctet", &rvalDecl)) {
47573 aRv.Throw(NS_ERROR_UNEXPECTED);
47574 return uint8_t(0);
47575 }
47576 return rvalDecl;
47577}
47578
47579void
47580TestJSImplInterfaceJSImpl::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47581{
47582 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47583 if (aRv.Failed()) {
47584 return;
47585 }
47586 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47586); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47586; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47587 BindingCallContext& cx = s.GetCallContext();
47588
47589 JS::Rooted<JS::Value> rval(cx);
47590 JS::RootedVector<JS::Value> argv(cx);
47591 if (!argv.resize(1)) {
47592 // That threw an exception on the JSContext, and our CallSetup will do
47593 // the right thing with that.
47594 return;
47595 }
47596 unsigned argc = 1;
47597
47598 do {
47599 if (arg.WasPassed()) {
47600 argv[0].setInt32(int32_t(arg.Value()));
47601 break;
47602 } else if (argc == 1) {
47603 // This is our current trailing argument; reduce argc
47604 --argc;
47605 } else {
47606 argv[0].setUndefined();
47607 }
47608 } while (false);
47609
47610 JS::Rooted<JS::Value> callable(cx);
47611 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47612 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47613 !InitIds(cx, atomsCache)) ||
47614 !GetCallableProperty(cx, atomsCache->passOptionalOctet_id, &callable)) {
47615 aRv.Throw(NS_ERROR_UNEXPECTED);
47616 return;
47617 }
47618 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47619 if (!JS::Call(cx, thisValue, callable,
47620 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47621 aRv.NoteJSContextException(cx);
47622 return;
47623 }
47624}
47625
47626void
47627TestJSImplInterfaceJSImpl::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47628{
47629 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalOctetWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47630 if (aRv.Failed()) {
47631 return;
47632 }
47633 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47633); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47633; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47634 BindingCallContext& cx = s.GetCallContext();
47635
47636 JS::Rooted<JS::Value> rval(cx);
47637 JS::RootedVector<JS::Value> argv(cx);
47638 if (!argv.resize(1)) {
47639 // That threw an exception on the JSContext, and our CallSetup will do
47640 // the right thing with that.
47641 return;
47642 }
47643 unsigned argc = 1;
47644
47645 do {
47646 argv[0].setInt32(int32_t(arg));
47647 break;
47648 } while (false);
47649
47650 JS::Rooted<JS::Value> callable(cx);
47651 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47652 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47653 !InitIds(cx, atomsCache)) ||
47654 !GetCallableProperty(cx, atomsCache->passOptionalOctetWithDefault_id, &callable)) {
47655 aRv.Throw(NS_ERROR_UNEXPECTED);
47656 return;
47657 }
47658 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47659 if (!JS::Call(cx, thisValue, callable,
47660 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47661 aRv.NoteJSContextException(cx);
47662 return;
47663 }
47664}
47665
47666void
47667TestJSImplInterfaceJSImpl::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47668{
47669 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47670 if (aRv.Failed()) {
47671 return;
47672 }
47673 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47673); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47673; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47674 BindingCallContext& cx = s.GetCallContext();
47675
47676 JS::Rooted<JS::Value> rval(cx);
47677 JS::RootedVector<JS::Value> argv(cx);
47678 if (!argv.resize(1)) {
47679 // That threw an exception on the JSContext, and our CallSetup will do
47680 // the right thing with that.
47681 return;
47682 }
47683 unsigned argc = 1;
47684
47685 do {
47686 argv[0].setInt32(int32_t(arg));
47687 break;
47688 } while (false);
47689
47690 JS::Rooted<JS::Value> callable(cx);
47691 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47692 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47693 !InitIds(cx, atomsCache)) ||
47694 !GetCallableProperty(cx, atomsCache->passUnsignedShort_id, &callable)) {
47695 aRv.Throw(NS_ERROR_UNEXPECTED);
47696 return;
47697 }
47698 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47699 if (!JS::Call(cx, thisValue, callable,
47700 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47701 aRv.NoteJSContextException(cx);
47702 return;
47703 }
47704}
47705
47706uint16_t
47707TestJSImplInterfaceJSImpl::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
47708{
47709 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47710 if (aRv.Failed()) {
47711 return uint16_t(0);
47712 }
47713 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47713); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47713; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47714 BindingCallContext& cx = s.GetCallContext();
47715
47716 JS::Rooted<JS::Value> rval(cx);
47717
47718 JS::Rooted<JS::Value> callable(cx);
47719 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47720 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47721 !InitIds(cx, atomsCache)) ||
47722 !GetCallableProperty(cx, atomsCache->receiveUnsignedShort_id, &callable)) {
47723 aRv.Throw(NS_ERROR_UNEXPECTED);
47724 return uint16_t(0);
47725 }
47726 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47727 if (!JS::Call(cx, thisValue, callable,
47728 JS::HandleValueArray::empty(), &rval)) {
47729 aRv.NoteJSContextException(cx);
47730 return uint16_t(0);
47731 }
47732 uint16_t rvalDecl;
47733 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedShort", &rvalDecl)) {
47734 aRv.Throw(NS_ERROR_UNEXPECTED);
47735 return uint16_t(0);
47736 }
47737 return rvalDecl;
47738}
47739
47740void
47741TestJSImplInterfaceJSImpl::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47742{
47743 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47744 if (aRv.Failed()) {
47745 return;
47746 }
47747 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47747); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47747; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47748 BindingCallContext& cx = s.GetCallContext();
47749
47750 JS::Rooted<JS::Value> rval(cx);
47751 JS::RootedVector<JS::Value> argv(cx);
47752 if (!argv.resize(1)) {
47753 // That threw an exception on the JSContext, and our CallSetup will do
47754 // the right thing with that.
47755 return;
47756 }
47757 unsigned argc = 1;
47758
47759 do {
47760 if (arg.WasPassed()) {
47761 argv[0].setInt32(int32_t(arg.Value()));
47762 break;
47763 } else if (argc == 1) {
47764 // This is our current trailing argument; reduce argc
47765 --argc;
47766 } else {
47767 argv[0].setUndefined();
47768 }
47769 } while (false);
47770
47771 JS::Rooted<JS::Value> callable(cx);
47772 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47773 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47774 !InitIds(cx, atomsCache)) ||
47775 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShort_id, &callable)) {
47776 aRv.Throw(NS_ERROR_UNEXPECTED);
47777 return;
47778 }
47779 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47780 if (!JS::Call(cx, thisValue, callable,
47781 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47782 aRv.NoteJSContextException(cx);
47783 return;
47784 }
47785}
47786
47787void
47788TestJSImplInterfaceJSImpl::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47789{
47790 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedShortWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47791 if (aRv.Failed()) {
47792 return;
47793 }
47794 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47794); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47794; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47795 BindingCallContext& cx = s.GetCallContext();
47796
47797 JS::Rooted<JS::Value> rval(cx);
47798 JS::RootedVector<JS::Value> argv(cx);
47799 if (!argv.resize(1)) {
47800 // That threw an exception on the JSContext, and our CallSetup will do
47801 // the right thing with that.
47802 return;
47803 }
47804 unsigned argc = 1;
47805
47806 do {
47807 argv[0].setInt32(int32_t(arg));
47808 break;
47809 } while (false);
47810
47811 JS::Rooted<JS::Value> callable(cx);
47812 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47813 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47814 !InitIds(cx, atomsCache)) ||
47815 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedShortWithDefault_id, &callable)) {
47816 aRv.Throw(NS_ERROR_UNEXPECTED);
47817 return;
47818 }
47819 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47820 if (!JS::Call(cx, thisValue, callable,
47821 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47822 aRv.NoteJSContextException(cx);
47823 return;
47824 }
47825}
47826
47827void
47828TestJSImplInterfaceJSImpl::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47829{
47830 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47831 if (aRv.Failed()) {
47832 return;
47833 }
47834 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47834; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47835 BindingCallContext& cx = s.GetCallContext();
47836
47837 JS::Rooted<JS::Value> rval(cx);
47838 JS::RootedVector<JS::Value> argv(cx);
47839 if (!argv.resize(1)) {
47840 // That threw an exception on the JSContext, and our CallSetup will do
47841 // the right thing with that.
47842 return;
47843 }
47844 unsigned argc = 1;
47845
47846 do {
47847 argv[0].setNumber(arg);
47848 break;
47849 } while (false);
47850
47851 JS::Rooted<JS::Value> callable(cx);
47852 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47853 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47854 !InitIds(cx, atomsCache)) ||
47855 !GetCallableProperty(cx, atomsCache->passUnsignedLong_id, &callable)) {
47856 aRv.Throw(NS_ERROR_UNEXPECTED);
47857 return;
47858 }
47859 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47860 if (!JS::Call(cx, thisValue, callable,
47861 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47862 aRv.NoteJSContextException(cx);
47863 return;
47864 }
47865}
47866
47867uint32_t
47868TestJSImplInterfaceJSImpl::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
47869{
47870 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47871 if (aRv.Failed()) {
47872 return uint32_t(0);
47873 }
47874 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47874; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47875 BindingCallContext& cx = s.GetCallContext();
47876
47877 JS::Rooted<JS::Value> rval(cx);
47878
47879 JS::Rooted<JS::Value> callable(cx);
47880 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47881 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47882 !InitIds(cx, atomsCache)) ||
47883 !GetCallableProperty(cx, atomsCache->receiveUnsignedLong_id, &callable)) {
47884 aRv.Throw(NS_ERROR_UNEXPECTED);
47885 return uint32_t(0);
47886 }
47887 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47888 if (!JS::Call(cx, thisValue, callable,
47889 JS::HandleValueArray::empty(), &rval)) {
47890 aRv.NoteJSContextException(cx);
47891 return uint32_t(0);
47892 }
47893 uint32_t rvalDecl;
47894 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLong", &rvalDecl)) {
47895 aRv.Throw(NS_ERROR_UNEXPECTED);
47896 return uint32_t(0);
47897 }
47898 return rvalDecl;
47899}
47900
47901void
47902TestJSImplInterfaceJSImpl::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
47903{
47904 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47905 if (aRv.Failed()) {
47906 return;
47907 }
47908 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47908); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47908; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47909 BindingCallContext& cx = s.GetCallContext();
47910
47911 JS::Rooted<JS::Value> rval(cx);
47912 JS::RootedVector<JS::Value> argv(cx);
47913 if (!argv.resize(1)) {
47914 // That threw an exception on the JSContext, and our CallSetup will do
47915 // the right thing with that.
47916 return;
47917 }
47918 unsigned argc = 1;
47919
47920 do {
47921 if (arg.WasPassed()) {
47922 argv[0].setNumber(arg.Value());
47923 break;
47924 } else if (argc == 1) {
47925 // This is our current trailing argument; reduce argc
47926 --argc;
47927 } else {
47928 argv[0].setUndefined();
47929 }
47930 } while (false);
47931
47932 JS::Rooted<JS::Value> callable(cx);
47933 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47934 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47935 !InitIds(cx, atomsCache)) ||
47936 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLong_id, &callable)) {
47937 aRv.Throw(NS_ERROR_UNEXPECTED);
47938 return;
47939 }
47940 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47941 if (!JS::Call(cx, thisValue, callable,
47942 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47943 aRv.NoteJSContextException(cx);
47944 return;
47945 }
47946}
47947
47948void
47949TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47950{
47951 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47952 if (aRv.Failed()) {
47953 return;
47954 }
47955 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47955); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47955; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47956 BindingCallContext& cx = s.GetCallContext();
47957
47958 JS::Rooted<JS::Value> rval(cx);
47959 JS::RootedVector<JS::Value> argv(cx);
47960 if (!argv.resize(1)) {
47961 // That threw an exception on the JSContext, and our CallSetup will do
47962 // the right thing with that.
47963 return;
47964 }
47965 unsigned argc = 1;
47966
47967 do {
47968 argv[0].setNumber(arg);
47969 break;
47970 } while (false);
47971
47972 JS::Rooted<JS::Value> callable(cx);
47973 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
47974 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
47975 !InitIds(cx, atomsCache)) ||
47976 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongWithDefault_id, &callable)) {
47977 aRv.Throw(NS_ERROR_UNEXPECTED);
47978 return;
47979 }
47980 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
47981 if (!JS::Call(cx, thisValue, callable,
47982 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
47983 aRv.NoteJSContextException(cx);
47984 return;
47985 }
47986}
47987
47988void
47989TestJSImplInterfaceJSImpl::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
47990{
47991 CallSetup s(this, aRv, "TestJSImplInterface.passUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
47992 if (aRv.Failed()) {
47993 return;
47994 }
47995 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 47995); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 47995; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
47996 BindingCallContext& cx = s.GetCallContext();
47997
47998 JS::Rooted<JS::Value> rval(cx);
47999 JS::RootedVector<JS::Value> argv(cx);
48000 if (!argv.resize(1)) {
48001 // That threw an exception on the JSContext, and our CallSetup will do
48002 // the right thing with that.
48003 return;
48004 }
48005 unsigned argc = 1;
48006
48007 do {
48008 argv[0].set(JS_NumberValue(double(arg)));
48009 break;
48010 } while (false);
48011
48012 JS::Rooted<JS::Value> callable(cx);
48013 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48014 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48015 !InitIds(cx, atomsCache)) ||
48016 !GetCallableProperty(cx, atomsCache->passUnsignedLongLong_id, &callable)) {
48017 aRv.Throw(NS_ERROR_UNEXPECTED);
48018 return;
48019 }
48020 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48021 if (!JS::Call(cx, thisValue, callable,
48022 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48023 aRv.NoteJSContextException(cx);
48024 return;
48025 }
48026}
48027
48028uint64_t
48029TestJSImplInterfaceJSImpl::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
48030{
48031 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48032 if (aRv.Failed()) {
48033 return uint64_t(0);
48034 }
48035 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48035); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48035; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48036 BindingCallContext& cx = s.GetCallContext();
48037
48038 JS::Rooted<JS::Value> rval(cx);
48039
48040 JS::Rooted<JS::Value> callable(cx);
48041 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48042 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48043 !InitIds(cx, atomsCache)) ||
48044 !GetCallableProperty(cx, atomsCache->receiveUnsignedLongLong_id, &callable)) {
48045 aRv.Throw(NS_ERROR_UNEXPECTED);
48046 return uint64_t(0);
48047 }
48048 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48049 if (!JS::Call(cx, thisValue, callable,
48050 JS::HandleValueArray::empty(), &rval)) {
48051 aRv.NoteJSContextException(cx);
48052 return uint64_t(0);
48053 }
48054 uint64_t rvalDecl;
48055 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.receiveUnsignedLongLong", &rvalDecl)) {
48056 aRv.Throw(NS_ERROR_UNEXPECTED);
48057 return uint64_t(0);
48058 }
48059 return rvalDecl;
48060}
48061
48062void
48063TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
48064{
48065 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48066 if (aRv.Failed()) {
48067 return;
48068 }
48069 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48069); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48069; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48070 BindingCallContext& cx = s.GetCallContext();
48071
48072 JS::Rooted<JS::Value> rval(cx);
48073 JS::RootedVector<JS::Value> argv(cx);
48074 if (!argv.resize(1)) {
48075 // That threw an exception on the JSContext, and our CallSetup will do
48076 // the right thing with that.
48077 return;
48078 }
48079 unsigned argc = 1;
48080
48081 do {
48082 if (arg.WasPassed()) {
48083 argv[0].set(JS_NumberValue(double(arg.Value())));
48084 break;
48085 } else if (argc == 1) {
48086 // This is our current trailing argument; reduce argc
48087 --argc;
48088 } else {
48089 argv[0].setUndefined();
48090 }
48091 } while (false);
48092
48093 JS::Rooted<JS::Value> callable(cx);
48094 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48095 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48096 !InitIds(cx, atomsCache)) ||
48097 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLong_id, &callable)) {
48098 aRv.Throw(NS_ERROR_UNEXPECTED);
48099 return;
48100 }
48101 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48102 if (!JS::Call(cx, thisValue, callable,
48103 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48104 aRv.NoteJSContextException(cx);
48105 return;
48106 }
48107}
48108
48109void
48110TestJSImplInterfaceJSImpl::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
48111{
48112 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnsignedLongLongWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48113 if (aRv.Failed()) {
48114 return;
48115 }
48116 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48116); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48116; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48117 BindingCallContext& cx = s.GetCallContext();
48118
48119 JS::Rooted<JS::Value> rval(cx);
48120 JS::RootedVector<JS::Value> argv(cx);
48121 if (!argv.resize(1)) {
48122 // That threw an exception on the JSContext, and our CallSetup will do
48123 // the right thing with that.
48124 return;
48125 }
48126 unsigned argc = 1;
48127
48128 do {
48129 argv[0].set(JS_NumberValue(double(arg)));
48130 break;
48131 } while (false);
48132
48133 JS::Rooted<JS::Value> callable(cx);
48134 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48135 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48136 !InitIds(cx, atomsCache)) ||
48137 !GetCallableProperty(cx, atomsCache->passOptionalUnsignedLongLongWithDefault_id, &callable)) {
48138 aRv.Throw(NS_ERROR_UNEXPECTED);
48139 return;
48140 }
48141 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48142 if (!JS::Call(cx, thisValue, callable,
48143 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48144 aRv.NoteJSContextException(cx);
48145 return;
48146 }
48147}
48148
48149void
48150TestJSImplInterfaceJSImpl::PassFloat(float arg1, float arg2, const Nullable<float>& arg3, const Nullable<float>& arg4, double arg5, double arg6, const Nullable<double>& arg7, const Nullable<double>& arg8, const Sequence<float>& arg9, const Sequence<float>& arg10, const Sequence<Nullable<float>>& arg11, const Sequence<Nullable<float>>& arg12, const Sequence<double>& arg13, const Sequence<double>& arg14, const Sequence<Nullable<double>>& arg15, const Sequence<Nullable<double>>& arg16, ErrorResult& aRv, JS::Realm* aRealm)
48151{
48152 CallSetup s(this, aRv, "TestJSImplInterface.passFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48153 if (aRv.Failed()) {
48154 return;
48155 }
48156 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48156); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48156; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48157 BindingCallContext& cx = s.GetCallContext();
48158
48159 JS::Rooted<JS::Value> rval(cx);
48160 JS::RootedVector<JS::Value> argv(cx);
48161 if (!argv.resize(16)) {
48162 // That threw an exception on the JSContext, and our CallSetup will do
48163 // the right thing with that.
48164 return;
48165 }
48166 unsigned argc = 16;
48167
48168 do {
48169
48170 uint32_t length = arg16.Length();
48171 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48172 if (!returnArray) {
48173 aRv.Throw(NS_ERROR_UNEXPECTED);
48174 return;
48175 }
48176 // Scope for 'tmp'
48177 {
48178 JS::Rooted<JS::Value> tmp(cx);
48179 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48180 // Control block to let us common up the JS_DefineElement calls when there
48181 // are different ways to succeed at wrapping the object.
48182 do {
48183 if (arg16[sequenceIdx0].IsNull()) {
48184 tmp.setNull();
48185 break;
48186 }
48187 tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value())));
48188 break;
48189 } while (false);
48190 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48191 JSPROP_ENUMERATE)) {
48192 aRv.Throw(NS_ERROR_UNEXPECTED);
48193 return;
48194 }
48195 }
48196 }
48197 argv[15].setObject(*returnArray);
48198 break;
48199 } while (false);
48200
48201 do {
48202
48203 uint32_t length = arg15.Length();
48204 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48205 if (!returnArray) {
48206 aRv.Throw(NS_ERROR_UNEXPECTED);
48207 return;
48208 }
48209 // Scope for 'tmp'
48210 {
48211 JS::Rooted<JS::Value> tmp(cx);
48212 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48213 // Control block to let us common up the JS_DefineElement calls when there
48214 // are different ways to succeed at wrapping the object.
48215 do {
48216 if (arg15[sequenceIdx0].IsNull()) {
48217 tmp.setNull();
48218 break;
48219 }
48220 tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value())));
48221 break;
48222 } while (false);
48223 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48224 JSPROP_ENUMERATE)) {
48225 aRv.Throw(NS_ERROR_UNEXPECTED);
48226 return;
48227 }
48228 }
48229 }
48230 argv[14].setObject(*returnArray);
48231 break;
48232 } while (false);
48233
48234 do {
48235
48236 uint32_t length = arg14.Length();
48237 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48238 if (!returnArray) {
48239 aRv.Throw(NS_ERROR_UNEXPECTED);
48240 return;
48241 }
48242 // Scope for 'tmp'
48243 {
48244 JS::Rooted<JS::Value> tmp(cx);
48245 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48246 // Control block to let us common up the JS_DefineElement calls when there
48247 // are different ways to succeed at wrapping the object.
48248 do {
48249 tmp.set(JS_NumberValue(double(arg14[sequenceIdx0])));
48250 break;
48251 } while (false);
48252 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48253 JSPROP_ENUMERATE)) {
48254 aRv.Throw(NS_ERROR_UNEXPECTED);
48255 return;
48256 }
48257 }
48258 }
48259 argv[13].setObject(*returnArray);
48260 break;
48261 } while (false);
48262
48263 do {
48264
48265 uint32_t length = arg13.Length();
48266 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48267 if (!returnArray) {
48268 aRv.Throw(NS_ERROR_UNEXPECTED);
48269 return;
48270 }
48271 // Scope for 'tmp'
48272 {
48273 JS::Rooted<JS::Value> tmp(cx);
48274 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48275 // Control block to let us common up the JS_DefineElement calls when there
48276 // are different ways to succeed at wrapping the object.
48277 do {
48278 tmp.set(JS_NumberValue(double(arg13[sequenceIdx0])));
48279 break;
48280 } while (false);
48281 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48282 JSPROP_ENUMERATE)) {
48283 aRv.Throw(NS_ERROR_UNEXPECTED);
48284 return;
48285 }
48286 }
48287 }
48288 argv[12].setObject(*returnArray);
48289 break;
48290 } while (false);
48291
48292 do {
48293
48294 uint32_t length = arg12.Length();
48295 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48296 if (!returnArray) {
48297 aRv.Throw(NS_ERROR_UNEXPECTED);
48298 return;
48299 }
48300 // Scope for 'tmp'
48301 {
48302 JS::Rooted<JS::Value> tmp(cx);
48303 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48304 // Control block to let us common up the JS_DefineElement calls when there
48305 // are different ways to succeed at wrapping the object.
48306 do {
48307 if (arg12[sequenceIdx0].IsNull()) {
48308 tmp.setNull();
48309 break;
48310 }
48311 tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value())));
48312 break;
48313 } while (false);
48314 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48315 JSPROP_ENUMERATE)) {
48316 aRv.Throw(NS_ERROR_UNEXPECTED);
48317 return;
48318 }
48319 }
48320 }
48321 argv[11].setObject(*returnArray);
48322 break;
48323 } while (false);
48324
48325 do {
48326
48327 uint32_t length = arg11.Length();
48328 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48329 if (!returnArray) {
48330 aRv.Throw(NS_ERROR_UNEXPECTED);
48331 return;
48332 }
48333 // Scope for 'tmp'
48334 {
48335 JS::Rooted<JS::Value> tmp(cx);
48336 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48337 // Control block to let us common up the JS_DefineElement calls when there
48338 // are different ways to succeed at wrapping the object.
48339 do {
48340 if (arg11[sequenceIdx0].IsNull()) {
48341 tmp.setNull();
48342 break;
48343 }
48344 tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value())));
48345 break;
48346 } while (false);
48347 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48348 JSPROP_ENUMERATE)) {
48349 aRv.Throw(NS_ERROR_UNEXPECTED);
48350 return;
48351 }
48352 }
48353 }
48354 argv[10].setObject(*returnArray);
48355 break;
48356 } while (false);
48357
48358 do {
48359
48360 uint32_t length = arg10.Length();
48361 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48362 if (!returnArray) {
48363 aRv.Throw(NS_ERROR_UNEXPECTED);
48364 return;
48365 }
48366 // Scope for 'tmp'
48367 {
48368 JS::Rooted<JS::Value> tmp(cx);
48369 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48370 // Control block to let us common up the JS_DefineElement calls when there
48371 // are different ways to succeed at wrapping the object.
48372 do {
48373 tmp.set(JS_NumberValue(double(arg10[sequenceIdx0])));
48374 break;
48375 } while (false);
48376 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48377 JSPROP_ENUMERATE)) {
48378 aRv.Throw(NS_ERROR_UNEXPECTED);
48379 return;
48380 }
48381 }
48382 }
48383 argv[9].setObject(*returnArray);
48384 break;
48385 } while (false);
48386
48387 do {
48388
48389 uint32_t length = arg9.Length();
48390 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48391 if (!returnArray) {
48392 aRv.Throw(NS_ERROR_UNEXPECTED);
48393 return;
48394 }
48395 // Scope for 'tmp'
48396 {
48397 JS::Rooted<JS::Value> tmp(cx);
48398 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48399 // Control block to let us common up the JS_DefineElement calls when there
48400 // are different ways to succeed at wrapping the object.
48401 do {
48402 tmp.set(JS_NumberValue(double(arg9[sequenceIdx0])));
48403 break;
48404 } while (false);
48405 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48406 JSPROP_ENUMERATE)) {
48407 aRv.Throw(NS_ERROR_UNEXPECTED);
48408 return;
48409 }
48410 }
48411 }
48412 argv[8].setObject(*returnArray);
48413 break;
48414 } while (false);
48415
48416 do {
48417 if (arg8.IsNull()) {
48418 argv[7].setNull();
48419 break;
48420 }
48421 argv[7].set(JS_NumberValue(double(arg8.Value())));
48422 break;
48423 } while (false);
48424
48425 do {
48426 if (arg7.IsNull()) {
48427 argv[6].setNull();
48428 break;
48429 }
48430 argv[6].set(JS_NumberValue(double(arg7.Value())));
48431 break;
48432 } while (false);
48433
48434 do {
48435 argv[5].set(JS_NumberValue(double(arg6)));
48436 break;
48437 } while (false);
48438
48439 do {
48440 argv[4].set(JS_NumberValue(double(arg5)));
48441 break;
48442 } while (false);
48443
48444 do {
48445 if (arg4.IsNull()) {
48446 argv[3].setNull();
48447 break;
48448 }
48449 argv[3].set(JS_NumberValue(double(arg4.Value())));
48450 break;
48451 } while (false);
48452
48453 do {
48454 if (arg3.IsNull()) {
48455 argv[2].setNull();
48456 break;
48457 }
48458 argv[2].set(JS_NumberValue(double(arg3.Value())));
48459 break;
48460 } while (false);
48461
48462 do {
48463 argv[1].set(JS_NumberValue(double(arg2)));
48464 break;
48465 } while (false);
48466
48467 do {
48468 argv[0].set(JS_NumberValue(double(arg1)));
48469 break;
48470 } while (false);
48471
48472 JS::Rooted<JS::Value> callable(cx);
48473 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48474 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48475 !InitIds(cx, atomsCache)) ||
48476 !GetCallableProperty(cx, atomsCache->passFloat_id, &callable)) {
48477 aRv.Throw(NS_ERROR_UNEXPECTED);
48478 return;
48479 }
48480 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48481 if (!JS::Call(cx, thisValue, callable,
48482 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48483 aRv.NoteJSContextException(cx);
48484 return;
48485 }
48486}
48487
48488void
48489TestJSImplInterfaceJSImpl::PassLenientFloat(float arg1, float arg2, const Nullable<float>& arg3, const Nullable<float>& arg4, double arg5, double arg6, const Nullable<double>& arg7, const Nullable<double>& arg8, const Sequence<float>& arg9, const Sequence<float>& arg10, const Sequence<Nullable<float>>& arg11, const Sequence<Nullable<float>>& arg12, const Sequence<double>& arg13, const Sequence<double>& arg14, const Sequence<Nullable<double>>& arg15, const Sequence<Nullable<double>>& arg16, ErrorResult& aRv, JS::Realm* aRealm)
48490{
48491 CallSetup s(this, aRv, "TestJSImplInterface.passLenientFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48492 if (aRv.Failed()) {
48493 return;
48494 }
48495 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48495); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48495; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48496 BindingCallContext& cx = s.GetCallContext();
48497
48498 JS::Rooted<JS::Value> rval(cx);
48499 JS::RootedVector<JS::Value> argv(cx);
48500 if (!argv.resize(16)) {
48501 // That threw an exception on the JSContext, and our CallSetup will do
48502 // the right thing with that.
48503 return;
48504 }
48505 unsigned argc = 16;
48506
48507 do {
48508
48509 uint32_t length = arg16.Length();
48510 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48511 if (!returnArray) {
48512 aRv.Throw(NS_ERROR_UNEXPECTED);
48513 return;
48514 }
48515 // Scope for 'tmp'
48516 {
48517 JS::Rooted<JS::Value> tmp(cx);
48518 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48519 // Control block to let us common up the JS_DefineElement calls when there
48520 // are different ways to succeed at wrapping the object.
48521 do {
48522 if (arg16[sequenceIdx0].IsNull()) {
48523 tmp.setNull();
48524 break;
48525 }
48526 tmp.set(JS_NumberValue(double(arg16[sequenceIdx0].Value())));
48527 break;
48528 } while (false);
48529 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48530 JSPROP_ENUMERATE)) {
48531 aRv.Throw(NS_ERROR_UNEXPECTED);
48532 return;
48533 }
48534 }
48535 }
48536 argv[15].setObject(*returnArray);
48537 break;
48538 } while (false);
48539
48540 do {
48541
48542 uint32_t length = arg15.Length();
48543 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48544 if (!returnArray) {
48545 aRv.Throw(NS_ERROR_UNEXPECTED);
48546 return;
48547 }
48548 // Scope for 'tmp'
48549 {
48550 JS::Rooted<JS::Value> tmp(cx);
48551 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48552 // Control block to let us common up the JS_DefineElement calls when there
48553 // are different ways to succeed at wrapping the object.
48554 do {
48555 if (arg15[sequenceIdx0].IsNull()) {
48556 tmp.setNull();
48557 break;
48558 }
48559 tmp.set(JS_NumberValue(double(arg15[sequenceIdx0].Value())));
48560 break;
48561 } while (false);
48562 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48563 JSPROP_ENUMERATE)) {
48564 aRv.Throw(NS_ERROR_UNEXPECTED);
48565 return;
48566 }
48567 }
48568 }
48569 argv[14].setObject(*returnArray);
48570 break;
48571 } while (false);
48572
48573 do {
48574
48575 uint32_t length = arg14.Length();
48576 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48577 if (!returnArray) {
48578 aRv.Throw(NS_ERROR_UNEXPECTED);
48579 return;
48580 }
48581 // Scope for 'tmp'
48582 {
48583 JS::Rooted<JS::Value> tmp(cx);
48584 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48585 // Control block to let us common up the JS_DefineElement calls when there
48586 // are different ways to succeed at wrapping the object.
48587 do {
48588 tmp.set(JS_NumberValue(double(arg14[sequenceIdx0])));
48589 break;
48590 } while (false);
48591 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48592 JSPROP_ENUMERATE)) {
48593 aRv.Throw(NS_ERROR_UNEXPECTED);
48594 return;
48595 }
48596 }
48597 }
48598 argv[13].setObject(*returnArray);
48599 break;
48600 } while (false);
48601
48602 do {
48603
48604 uint32_t length = arg13.Length();
48605 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48606 if (!returnArray) {
48607 aRv.Throw(NS_ERROR_UNEXPECTED);
48608 return;
48609 }
48610 // Scope for 'tmp'
48611 {
48612 JS::Rooted<JS::Value> tmp(cx);
48613 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48614 // Control block to let us common up the JS_DefineElement calls when there
48615 // are different ways to succeed at wrapping the object.
48616 do {
48617 tmp.set(JS_NumberValue(double(arg13[sequenceIdx0])));
48618 break;
48619 } while (false);
48620 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48621 JSPROP_ENUMERATE)) {
48622 aRv.Throw(NS_ERROR_UNEXPECTED);
48623 return;
48624 }
48625 }
48626 }
48627 argv[12].setObject(*returnArray);
48628 break;
48629 } while (false);
48630
48631 do {
48632
48633 uint32_t length = arg12.Length();
48634 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48635 if (!returnArray) {
48636 aRv.Throw(NS_ERROR_UNEXPECTED);
48637 return;
48638 }
48639 // Scope for 'tmp'
48640 {
48641 JS::Rooted<JS::Value> tmp(cx);
48642 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48643 // Control block to let us common up the JS_DefineElement calls when there
48644 // are different ways to succeed at wrapping the object.
48645 do {
48646 if (arg12[sequenceIdx0].IsNull()) {
48647 tmp.setNull();
48648 break;
48649 }
48650 tmp.set(JS_NumberValue(double(arg12[sequenceIdx0].Value())));
48651 break;
48652 } while (false);
48653 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48654 JSPROP_ENUMERATE)) {
48655 aRv.Throw(NS_ERROR_UNEXPECTED);
48656 return;
48657 }
48658 }
48659 }
48660 argv[11].setObject(*returnArray);
48661 break;
48662 } while (false);
48663
48664 do {
48665
48666 uint32_t length = arg11.Length();
48667 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48668 if (!returnArray) {
48669 aRv.Throw(NS_ERROR_UNEXPECTED);
48670 return;
48671 }
48672 // Scope for 'tmp'
48673 {
48674 JS::Rooted<JS::Value> tmp(cx);
48675 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48676 // Control block to let us common up the JS_DefineElement calls when there
48677 // are different ways to succeed at wrapping the object.
48678 do {
48679 if (arg11[sequenceIdx0].IsNull()) {
48680 tmp.setNull();
48681 break;
48682 }
48683 tmp.set(JS_NumberValue(double(arg11[sequenceIdx0].Value())));
48684 break;
48685 } while (false);
48686 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48687 JSPROP_ENUMERATE)) {
48688 aRv.Throw(NS_ERROR_UNEXPECTED);
48689 return;
48690 }
48691 }
48692 }
48693 argv[10].setObject(*returnArray);
48694 break;
48695 } while (false);
48696
48697 do {
48698
48699 uint32_t length = arg10.Length();
48700 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48701 if (!returnArray) {
48702 aRv.Throw(NS_ERROR_UNEXPECTED);
48703 return;
48704 }
48705 // Scope for 'tmp'
48706 {
48707 JS::Rooted<JS::Value> tmp(cx);
48708 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48709 // Control block to let us common up the JS_DefineElement calls when there
48710 // are different ways to succeed at wrapping the object.
48711 do {
48712 tmp.set(JS_NumberValue(double(arg10[sequenceIdx0])));
48713 break;
48714 } while (false);
48715 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48716 JSPROP_ENUMERATE)) {
48717 aRv.Throw(NS_ERROR_UNEXPECTED);
48718 return;
48719 }
48720 }
48721 }
48722 argv[9].setObject(*returnArray);
48723 break;
48724 } while (false);
48725
48726 do {
48727
48728 uint32_t length = arg9.Length();
48729 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
48730 if (!returnArray) {
48731 aRv.Throw(NS_ERROR_UNEXPECTED);
48732 return;
48733 }
48734 // Scope for 'tmp'
48735 {
48736 JS::Rooted<JS::Value> tmp(cx);
48737 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
48738 // Control block to let us common up the JS_DefineElement calls when there
48739 // are different ways to succeed at wrapping the object.
48740 do {
48741 tmp.set(JS_NumberValue(double(arg9[sequenceIdx0])));
48742 break;
48743 } while (false);
48744 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
48745 JSPROP_ENUMERATE)) {
48746 aRv.Throw(NS_ERROR_UNEXPECTED);
48747 return;
48748 }
48749 }
48750 }
48751 argv[8].setObject(*returnArray);
48752 break;
48753 } while (false);
48754
48755 do {
48756 if (arg8.IsNull()) {
48757 argv[7].setNull();
48758 break;
48759 }
48760 argv[7].set(JS_NumberValue(double(arg8.Value())));
48761 break;
48762 } while (false);
48763
48764 do {
48765 if (arg7.IsNull()) {
48766 argv[6].setNull();
48767 break;
48768 }
48769 argv[6].set(JS_NumberValue(double(arg7.Value())));
48770 break;
48771 } while (false);
48772
48773 do {
48774 argv[5].set(JS_NumberValue(double(arg6)));
48775 break;
48776 } while (false);
48777
48778 do {
48779 argv[4].set(JS_NumberValue(double(arg5)));
48780 break;
48781 } while (false);
48782
48783 do {
48784 if (arg4.IsNull()) {
48785 argv[3].setNull();
48786 break;
48787 }
48788 argv[3].set(JS_NumberValue(double(arg4.Value())));
48789 break;
48790 } while (false);
48791
48792 do {
48793 if (arg3.IsNull()) {
48794 argv[2].setNull();
48795 break;
48796 }
48797 argv[2].set(JS_NumberValue(double(arg3.Value())));
48798 break;
48799 } while (false);
48800
48801 do {
48802 argv[1].set(JS_NumberValue(double(arg2)));
48803 break;
48804 } while (false);
48805
48806 do {
48807 argv[0].set(JS_NumberValue(double(arg1)));
48808 break;
48809 } while (false);
48810
48811 JS::Rooted<JS::Value> callable(cx);
48812 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48813 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48814 !InitIds(cx, atomsCache)) ||
48815 !GetCallableProperty(cx, atomsCache->passLenientFloat_id, &callable)) {
48816 aRv.Throw(NS_ERROR_UNEXPECTED);
48817 return;
48818 }
48819 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48820 if (!JS::Call(cx, thisValue, callable,
48821 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
48822 aRv.NoteJSContextException(cx);
48823 return;
48824 }
48825}
48826
48827already_AddRefed<TestJSImplInterface>
48828TestJSImplInterfaceJSImpl::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm)
48829{
48830 CallSetup s(this, aRv, "TestJSImplInterface.receiveSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48831 if (aRv.Failed()) {
48832 return nullptr;
48833 }
48834 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48834; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48835 BindingCallContext& cx = s.GetCallContext();
48836
48837 JS::Rooted<JS::Value> rval(cx);
48838
48839 JS::Rooted<JS::Value> callable(cx);
48840 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48841 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48842 !InitIds(cx, atomsCache)) ||
48843 !GetCallableProperty(cx, atomsCache->receiveSelf_id, &callable)) {
48844 aRv.Throw(NS_ERROR_UNEXPECTED);
48845 return nullptr;
48846 }
48847 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48848 if (!JS::Call(cx, thisValue, callable,
48849 JS::HandleValueArray::empty(), &rval)) {
48850 aRv.NoteJSContextException(cx);
48851 return nullptr;
48852 }
48853 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
48854 if (rval.isObject()) {
48855 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
48856 {
48857 // Our JSContext should be in the right global to do unwrapping in.
48858 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
48859 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
48860 // Be careful to not wrap random DOM objects here, even if
48861 // they're wrapped in opaque security wrappers for some reason.
48862 // XXXbz Wish we could check for a JS-implemented object
48863 // that already has a content reflection...
48864 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
48865 nsCOMPtr<nsIGlobalObject> contentGlobal;
48866 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
48867 if (!callback ||
48868 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
48869 aRv.Throw(NS_ERROR_UNEXPECTED);
48870 return nullptr;
48871 }
48872 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
48873 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 48874); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 48874; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
48874 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 48874); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 48874; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
48875 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
48876 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
48877 } else {
48878 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveSelf", "TestJSImplInterface");
48879 aRv.Throw(NS_ERROR_UNEXPECTED);
48880 return nullptr;
48881 }
48882 }
48883 }
48884 } else {
48885 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveSelf");
48886 aRv.Throw(NS_ERROR_UNEXPECTED);
48887 return nullptr;
48888 }
48889 return rvalDecl.forget();
48890}
48891
48892already_AddRefed<TestJSImplInterface>
48893TestJSImplInterfaceJSImpl::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
48894{
48895 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48896 if (aRv.Failed()) {
48897 return nullptr;
48898 }
48899 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48899); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48899; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48900 BindingCallContext& cx = s.GetCallContext();
48901
48902 JS::Rooted<JS::Value> rval(cx);
48903
48904 JS::Rooted<JS::Value> callable(cx);
48905 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48906 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48907 !InitIds(cx, atomsCache)) ||
48908 !GetCallableProperty(cx, atomsCache->receiveNullableSelf_id, &callable)) {
48909 aRv.Throw(NS_ERROR_UNEXPECTED);
48910 return nullptr;
48911 }
48912 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48913 if (!JS::Call(cx, thisValue, callable,
48914 JS::HandleValueArray::empty(), &rval)) {
48915 aRv.NoteJSContextException(cx);
48916 return nullptr;
48917 }
48918 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
48919 if (rval.isObject()) {
48920 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
48921 {
48922 // Our JSContext should be in the right global to do unwrapping in.
48923 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
48924 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
48925 // Be careful to not wrap random DOM objects here, even if
48926 // they're wrapped in opaque security wrappers for some reason.
48927 // XXXbz Wish we could check for a JS-implemented object
48928 // that already has a content reflection...
48929 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
48930 nsCOMPtr<nsIGlobalObject> contentGlobal;
48931 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
48932 if (!callback ||
48933 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
48934 aRv.Throw(NS_ERROR_UNEXPECTED);
48935 return nullptr;
48936 }
48937 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
48938 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 48939); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 48939; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
48939 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 48939); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 48939; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
48940 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
48941 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
48942 } else {
48943 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableSelf", "TestJSImplInterface");
48944 aRv.Throw(NS_ERROR_UNEXPECTED);
48945 return nullptr;
48946 }
48947 }
48948 }
48949 } else if (rval.isNullOrUndefined()) {
48950 rvalDecl = nullptr;
48951 } else {
48952 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableSelf");
48953 aRv.Throw(NS_ERROR_UNEXPECTED);
48954 return nullptr;
48955 }
48956 return rvalDecl.forget();
48957}
48958
48959already_AddRefed<TestJSImplInterface>
48960TestJSImplInterfaceJSImpl::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm)
48961{
48962 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
48963 if (aRv.Failed()) {
48964 return nullptr;
48965 }
48966 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 48966); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 48966; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
48967 BindingCallContext& cx = s.GetCallContext();
48968
48969 JS::Rooted<JS::Value> rval(cx);
48970
48971 JS::Rooted<JS::Value> callable(cx);
48972 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
48973 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
48974 !InitIds(cx, atomsCache)) ||
48975 !GetCallableProperty(cx, atomsCache->receiveWeakSelf_id, &callable)) {
48976 aRv.Throw(NS_ERROR_UNEXPECTED);
48977 return nullptr;
48978 }
48979 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
48980 if (!JS::Call(cx, thisValue, callable,
48981 JS::HandleValueArray::empty(), &rval)) {
48982 aRv.NoteJSContextException(cx);
48983 return nullptr;
48984 }
48985 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
48986 if (rval.isObject()) {
48987 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
48988 {
48989 // Our JSContext should be in the right global to do unwrapping in.
48990 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
48991 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
48992 // Be careful to not wrap random DOM objects here, even if
48993 // they're wrapped in opaque security wrappers for some reason.
48994 // XXXbz Wish we could check for a JS-implemented object
48995 // that already has a content reflection...
48996 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
48997 nsCOMPtr<nsIGlobalObject> contentGlobal;
48998 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
48999 if (!callback ||
49000 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49001 aRv.Throw(NS_ERROR_UNEXPECTED);
49002 return nullptr;
49003 }
49004 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49005 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 49006); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 49006; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49006 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 49006); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 49006; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49007 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49008 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49009 } else {
49010 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakSelf", "TestJSImplInterface");
49011 aRv.Throw(NS_ERROR_UNEXPECTED);
49012 return nullptr;
49013 }
49014 }
49015 }
49016 } else {
49017 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakSelf");
49018 aRv.Throw(NS_ERROR_UNEXPECTED);
49019 return nullptr;
49020 }
49021 return rvalDecl.forget();
49022}
49023
49024already_AddRefed<TestJSImplInterface>
49025TestJSImplInterfaceJSImpl::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
49026{
49027 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49028 if (aRv.Failed()) {
49029 return nullptr;
49030 }
49031 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49031; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49032 BindingCallContext& cx = s.GetCallContext();
49033
49034 JS::Rooted<JS::Value> rval(cx);
49035
49036 JS::Rooted<JS::Value> callable(cx);
49037 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49038 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49039 !InitIds(cx, atomsCache)) ||
49040 !GetCallableProperty(cx, atomsCache->receiveWeakNullableSelf_id, &callable)) {
49041 aRv.Throw(NS_ERROR_UNEXPECTED);
49042 return nullptr;
49043 }
49044 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49045 if (!JS::Call(cx, thisValue, callable,
49046 JS::HandleValueArray::empty(), &rval)) {
49047 aRv.NoteJSContextException(cx);
49048 return nullptr;
49049 }
49050 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
49051 if (rval.isObject()) {
49052 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
49053 {
49054 // Our JSContext should be in the right global to do unwrapping in.
49055 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
49056 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49057 // Be careful to not wrap random DOM objects here, even if
49058 // they're wrapped in opaque security wrappers for some reason.
49059 // XXXbz Wish we could check for a JS-implemented object
49060 // that already has a content reflection...
49061 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
49062 nsCOMPtr<nsIGlobalObject> contentGlobal;
49063 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
49064 if (!callback ||
49065 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
49066 aRv.Throw(NS_ERROR_UNEXPECTED);
49067 return nullptr;
49068 }
49069 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
49070 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 49071); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 49071; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
49071 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 49071); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 49071; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
49072 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
49073 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
49074 } else {
49075 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableSelf", "TestJSImplInterface");
49076 aRv.Throw(NS_ERROR_UNEXPECTED);
49077 return nullptr;
49078 }
49079 }
49080 }
49081 } else if (rval.isNullOrUndefined()) {
49082 rvalDecl = nullptr;
49083 } else {
49084 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableSelf");
49085 aRv.Throw(NS_ERROR_UNEXPECTED);
49086 return nullptr;
49087 }
49088 return rvalDecl.forget();
49089}
49090
49091void
49092TestJSImplInterfaceJSImpl::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
49093{
49094 CallSetup s(this, aRv, "TestJSImplInterface.passSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49095 if (aRv.Failed()) {
49096 return;
49097 }
49098 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49098); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49098; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49099 BindingCallContext& cx = s.GetCallContext();
49100
49101 JS::Rooted<JS::Value> rval(cx);
49102 JS::RootedVector<JS::Value> argv(cx);
49103 if (!argv.resize(1)) {
49104 // That threw an exception on the JSContext, and our CallSetup will do
49105 // the right thing with that.
49106 return;
49107 }
49108 unsigned argc = 1;
49109
49110 do {
49111 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49112 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49112); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 49112; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49113 aRv.Throw(NS_ERROR_UNEXPECTED);
49114 return;
49115 }
49116 break;
49117 } while (false);
49118
49119 JS::Rooted<JS::Value> callable(cx);
49120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49122 !InitIds(cx, atomsCache)) ||
49123 !GetCallableProperty(cx, atomsCache->passSelf_id, &callable)) {
49124 aRv.Throw(NS_ERROR_UNEXPECTED);
49125 return;
49126 }
49127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49128 if (!JS::Call(cx, thisValue, callable,
49129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49130 aRv.NoteJSContextException(cx);
49131 return;
49132 }
49133}
49134
49135void
49136TestJSImplInterfaceJSImpl::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
49137{
49138 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49139 if (aRv.Failed()) {
49140 return;
49141 }
49142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49142; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49143 BindingCallContext& cx = s.GetCallContext();
49144
49145 JS::Rooted<JS::Value> rval(cx);
49146 JS::RootedVector<JS::Value> argv(cx);
49147 if (!argv.resize(1)) {
49148 // That threw an exception on the JSContext, and our CallSetup will do
49149 // the right thing with that.
49150 return;
49151 }
49152 unsigned argc = 1;
49153
49154 do {
49155 if (!arg) {
49156 argv[0].setNull();
49157 break;
49158 }
49159 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49160 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 49160; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49161 aRv.Throw(NS_ERROR_UNEXPECTED);
49162 return;
49163 }
49164 break;
49165 } while (false);
49166
49167 JS::Rooted<JS::Value> callable(cx);
49168 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49169 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49170 !InitIds(cx, atomsCache)) ||
49171 !GetCallableProperty(cx, atomsCache->passNullableSelf_id, &callable)) {
49172 aRv.Throw(NS_ERROR_UNEXPECTED);
49173 return;
49174 }
49175 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49176 if (!JS::Call(cx, thisValue, callable,
49177 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49178 aRv.NoteJSContextException(cx);
49179 return;
49180 }
49181}
49182
49183void
49184TestJSImplInterfaceJSImpl::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
49185{
49186 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49187 if (aRv.Failed()) {
49188 return;
49189 }
49190 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49190; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49191 BindingCallContext& cx = s.GetCallContext();
49192
49193 JS::Rooted<JS::Value> rval(cx);
49194 JS::RootedVector<JS::Value> argv(cx);
49195 if (!argv.resize(1)) {
49196 // That threw an exception on the JSContext, and our CallSetup will do
49197 // the right thing with that.
49198 return;
49199 }
49200 unsigned argc = 1;
49201
49202 do {
49203 if (arg.WasPassed()) {
49204 if (!arg.Value()) {
49205 argv[0].setNull();
49206 break;
49207 }
49208 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
49209 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49209); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 49209; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49210 aRv.Throw(NS_ERROR_UNEXPECTED);
49211 return;
49212 }
49213 break;
49214 } else if (argc == 1) {
49215 // This is our current trailing argument; reduce argc
49216 --argc;
49217 } else {
49218 argv[0].setUndefined();
49219 }
49220 } while (false);
49221
49222 JS::Rooted<JS::Value> callable(cx);
49223 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49224 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49225 !InitIds(cx, atomsCache)) ||
49226 !GetCallableProperty(cx, atomsCache->passOptionalSelf_id, &callable)) {
49227 aRv.Throw(NS_ERROR_UNEXPECTED);
49228 return;
49229 }
49230 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49231 if (!JS::Call(cx, thisValue, callable,
49232 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49233 aRv.NoteJSContextException(cx);
49234 return;
49235 }
49236}
49237
49238void
49239TestJSImplInterfaceJSImpl::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
49240{
49241 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49242 if (aRv.Failed()) {
49243 return;
49244 }
49245 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49245); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49245; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49246 BindingCallContext& cx = s.GetCallContext();
49247
49248 JS::Rooted<JS::Value> rval(cx);
49249 JS::RootedVector<JS::Value> argv(cx);
49250 if (!argv.resize(1)) {
49251 // That threw an exception on the JSContext, and our CallSetup will do
49252 // the right thing with that.
49253 return;
49254 }
49255 unsigned argc = 1;
49256
49257 do {
49258 if (arg.WasPassed()) {
49259 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
49260 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49260); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 49260; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49261 aRv.Throw(NS_ERROR_UNEXPECTED);
49262 return;
49263 }
49264 break;
49265 } else if (argc == 1) {
49266 // This is our current trailing argument; reduce argc
49267 --argc;
49268 } else {
49269 argv[0].setUndefined();
49270 }
49271 } while (false);
49272
49273 JS::Rooted<JS::Value> callable(cx);
49274 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49275 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49276 !InitIds(cx, atomsCache)) ||
49277 !GetCallableProperty(cx, atomsCache->passOptionalNonNullSelf_id, &callable)) {
49278 aRv.Throw(NS_ERROR_UNEXPECTED);
49279 return;
49280 }
49281 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49282 if (!JS::Call(cx, thisValue, callable,
49283 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49284 aRv.NoteJSContextException(cx);
49285 return;
49286 }
49287}
49288
49289void
49290TestJSImplInterfaceJSImpl::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
49291{
49292 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSelfWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49293 if (aRv.Failed()) {
49294 return;
49295 }
49296 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49296); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49296; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49297 BindingCallContext& cx = s.GetCallContext();
49298
49299 JS::Rooted<JS::Value> rval(cx);
49300 JS::RootedVector<JS::Value> argv(cx);
49301 if (!argv.resize(1)) {
49302 // That threw an exception on the JSContext, and our CallSetup will do
49303 // the right thing with that.
49304 return;
49305 }
49306 unsigned argc = 1;
49307
49308 do {
49309 if (!arg) {
49310 argv[0].setNull();
49311 break;
49312 }
49313 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
49314 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 49314); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 49314; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49315 aRv.Throw(NS_ERROR_UNEXPECTED);
49316 return;
49317 }
49318 break;
49319 } while (false);
49320
49321 JS::Rooted<JS::Value> callable(cx);
49322 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49323 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49324 !InitIds(cx, atomsCache)) ||
49325 !GetCallableProperty(cx, atomsCache->passOptionalSelfWithDefault_id, &callable)) {
49326 aRv.Throw(NS_ERROR_UNEXPECTED);
49327 return;
49328 }
49329 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49330 if (!JS::Call(cx, thisValue, callable,
49331 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49332 aRv.NoteJSContextException(cx);
49333 return;
49334 }
49335}
49336
49337already_AddRefed<TestNonWrapperCacheInterface>
49338TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
49339{
49340 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49341 if (aRv.Failed()) {
49342 return nullptr;
49343 }
49344 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49344); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49344; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49345 BindingCallContext& cx = s.GetCallContext();
49346
49347 JS::Rooted<JS::Value> rval(cx);
49348
49349 JS::Rooted<JS::Value> callable(cx);
49350 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49351 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49352 !InitIds(cx, atomsCache)) ||
49353 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterface_id, &callable)) {
49354 aRv.Throw(NS_ERROR_UNEXPECTED);
49355 return nullptr;
49356 }
49357 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49358 if (!JS::Call(cx, thisValue, callable,
49359 JS::HandleValueArray::empty(), &rval)) {
49360 aRv.NoteJSContextException(cx);
49361 return nullptr;
49362 }
49363 RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl;
49364 if (rval.isObject()) {
49365 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49366 {
49367 // Our JSContext should be in the right global to do unwrapping in.
49368 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx);
49369 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49370 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface", "TestNonWrapperCacheInterface");
49371 aRv.Throw(NS_ERROR_UNEXPECTED);
49372 return nullptr;
49373 }
49374 }
49375 } else {
49376 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterface");
49377 aRv.Throw(NS_ERROR_UNEXPECTED);
49378 return nullptr;
49379 }
49380 return rvalDecl.forget();
49381}
49382
49383already_AddRefed<TestNonWrapperCacheInterface>
49384TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
49385{
49386 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49387 if (aRv.Failed()) {
49388 return nullptr;
49389 }
49390 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49390); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49390; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49391 BindingCallContext& cx = s.GetCallContext();
49392
49393 JS::Rooted<JS::Value> rval(cx);
49394
49395 JS::Rooted<JS::Value> callable(cx);
49396 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49397 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49398 !InitIds(cx, atomsCache)) ||
49399 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterface_id, &callable)) {
49400 aRv.Throw(NS_ERROR_UNEXPECTED);
49401 return nullptr;
49402 }
49403 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49404 if (!JS::Call(cx, thisValue, callable,
49405 JS::HandleValueArray::empty(), &rval)) {
49406 aRv.NoteJSContextException(cx);
49407 return nullptr;
49408 }
49409 RefPtr<mozilla::dom::TestNonWrapperCacheInterface> rvalDecl;
49410 if (rval.isObject()) {
49411 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49412 {
49413 // Our JSContext should be in the right global to do unwrapping in.
49414 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(rval, rvalDecl, cx);
49415 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49416 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface", "TestNonWrapperCacheInterface");
49417 aRv.Throw(NS_ERROR_UNEXPECTED);
49418 return nullptr;
49419 }
49420 }
49421 } else if (rval.isNullOrUndefined()) {
49422 rvalDecl = nullptr;
49423 } else {
49424 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterface");
49425 aRv.Throw(NS_ERROR_UNEXPECTED);
49426 return nullptr;
49427 }
49428 return rvalDecl.forget();
49429}
49430
49431void
49432TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49433{
49434 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49435 if (aRv.Failed()) {
49436 return;
49437 }
49438 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49438); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49438; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49439 BindingCallContext& cx = s.GetCallContext();
49440
49441 JS::Rooted<JS::Value> rval(cx);
49442
49443 JS::Rooted<JS::Value> callable(cx);
49444 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49445 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49446 !InitIds(cx, atomsCache)) ||
49447 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceSequence_id, &callable)) {
49448 aRv.Throw(NS_ERROR_UNEXPECTED);
49449 return;
49450 }
49451 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49452 if (!JS::Call(cx, thisValue, callable,
49453 JS::HandleValueArray::empty(), &rval)) {
49454 aRv.NoteJSContextException(cx);
49455 return;
49456 }
49457 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl;
49458 if (rval.isObject()) {
49459 JS::ForOfIterator iter(cx);
49460 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49461 aRv.Throw(NS_ERROR_UNEXPECTED);
49462 return;
49463 }
49464 if (!iter.valueIsIterable()) {
49465 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence");
49466 aRv.Throw(NS_ERROR_UNEXPECTED);
49467 return;
49468 }
49469 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl;
49470 JS::Rooted<JS::Value> temp(cx);
49471 while (true) {
49472 bool done;
49473 if (!iter.next(&temp, &done)) {
49474 aRv.Throw(NS_ERROR_UNEXPECTED);
49475 return;
49476 }
49477 if (done) {
49478 break;
49479 }
49480 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49481 if (!slotPtr) {
49482 JS_ReportOutOfMemory(cx);
49483 aRv.Throw(NS_ERROR_UNEXPECTED);
49484 return;
49485 }
49486 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49487 if (temp.isObject()) {
49488 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49489 {
49490 // Our JSContext should be in the right global to do unwrapping in.
49491 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49492 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49493 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface");
49494 aRv.Throw(NS_ERROR_UNEXPECTED);
49495 return;
49496 }
49497 }
49498 } else {
49499 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence");
49500 aRv.Throw(NS_ERROR_UNEXPECTED);
49501 return;
49502 }
49503 }
49504 } else {
49505 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceSequence", "sequence");
49506 aRv.Throw(NS_ERROR_UNEXPECTED);
49507 return;
49508 }
49509 aRetVal = std::move(rvalDecl);
49510}
49511
49512void
49513TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49514{
49515 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49516 if (aRv.Failed()) {
49517 return;
49518 }
49519 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49519); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49519; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49520 BindingCallContext& cx = s.GetCallContext();
49521
49522 JS::Rooted<JS::Value> rval(cx);
49523
49524 JS::Rooted<JS::Value> callable(cx);
49525 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49526 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49527 !InitIds(cx, atomsCache)) ||
49528 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id, &callable)) {
49529 aRv.Throw(NS_ERROR_UNEXPECTED);
49530 return;
49531 }
49532 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49533 if (!JS::Call(cx, thisValue, callable,
49534 JS::HandleValueArray::empty(), &rval)) {
49535 aRv.NoteJSContextException(cx);
49536 return;
49537 }
49538 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> rvalDecl;
49539 if (rval.isObject()) {
49540 JS::ForOfIterator iter(cx);
49541 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49542 aRv.Throw(NS_ERROR_UNEXPECTED);
49543 return;
49544 }
49545 if (!iter.valueIsIterable()) {
49546 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence");
49547 aRv.Throw(NS_ERROR_UNEXPECTED);
49548 return;
49549 }
49550 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl;
49551 JS::Rooted<JS::Value> temp(cx);
49552 while (true) {
49553 bool done;
49554 if (!iter.next(&temp, &done)) {
49555 aRv.Throw(NS_ERROR_UNEXPECTED);
49556 return;
49557 }
49558 if (done) {
49559 break;
49560 }
49561 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49562 if (!slotPtr) {
49563 JS_ReportOutOfMemory(cx);
49564 aRv.Throw(NS_ERROR_UNEXPECTED);
49565 return;
49566 }
49567 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49568 if (temp.isObject()) {
49569 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49570 {
49571 // Our JSContext should be in the right global to do unwrapping in.
49572 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49573 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49574 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "TestNonWrapperCacheInterface");
49575 aRv.Throw(NS_ERROR_UNEXPECTED);
49576 return;
49577 }
49578 }
49579 } else if (temp.isNullOrUndefined()) {
49580 slot = nullptr;
49581 } else {
49582 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence");
49583 aRv.Throw(NS_ERROR_UNEXPECTED);
49584 return;
49585 }
49586 }
49587 } else {
49588 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceSequence", "sequence");
49589 aRv.Throw(NS_ERROR_UNEXPECTED);
49590 return;
49591 }
49592 aRetVal = std::move(rvalDecl);
49593}
49594
49595void
49596TestJSImplInterfaceJSImpl::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49597{
49598 CallSetup s(this, aRv, "TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49599 if (aRv.Failed()) {
49600 return;
49601 }
49602 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49602); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49602; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49603 BindingCallContext& cx = s.GetCallContext();
49604
49605 JS::Rooted<JS::Value> rval(cx);
49606
49607 JS::Rooted<JS::Value> callable(cx);
49608 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49609 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49610 !InitIds(cx, atomsCache)) ||
49611 !GetCallableProperty(cx, atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id, &callable)) {
49612 aRv.Throw(NS_ERROR_UNEXPECTED);
49613 return;
49614 }
49615 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49616 if (!JS::Call(cx, thisValue, callable,
49617 JS::HandleValueArray::empty(), &rval)) {
49618 aRv.NoteJSContextException(cx);
49619 return;
49620 }
49621 Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl;
49622 if (rval.isObject()) {
49623 JS::ForOfIterator iter(cx);
49624 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49625 aRv.Throw(NS_ERROR_UNEXPECTED);
49626 return;
49627 }
49628 if (!iter.valueIsIterable()) {
49629 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence");
49630 aRv.Throw(NS_ERROR_UNEXPECTED);
49631 return;
49632 }
49633 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue();
49634 JS::Rooted<JS::Value> temp(cx);
49635 while (true) {
49636 bool done;
49637 if (!iter.next(&temp, &done)) {
49638 aRv.Throw(NS_ERROR_UNEXPECTED);
49639 return;
49640 }
49641 if (done) {
49642 break;
49643 }
49644 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49645 if (!slotPtr) {
49646 JS_ReportOutOfMemory(cx);
49647 aRv.Throw(NS_ERROR_UNEXPECTED);
49648 return;
49649 }
49650 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49651 if (temp.isObject()) {
49652 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49653 {
49654 // Our JSContext should be in the right global to do unwrapping in.
49655 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49656 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49657 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface");
49658 aRv.Throw(NS_ERROR_UNEXPECTED);
49659 return;
49660 }
49661 }
49662 } else {
49663 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence");
49664 aRv.Throw(NS_ERROR_UNEXPECTED);
49665 return;
49666 }
49667 }
49668 } else if (rval.isNullOrUndefined()) {
49669 rvalDecl.SetNull();
49670 } else {
49671 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNonWrapperCacheInterfaceNullableSequence", "sequence");
49672 aRv.Throw(NS_ERROR_UNEXPECTED);
49673 return;
49674 }
49675 if (rvalDecl.IsNull()) {
49676 aRetVal.SetNull();
49677 } else {
49678 aRetVal.SetValue() = std::move(rvalDecl.Value());
49679 }
49680}
49681
49682void
49683TestJSImplInterfaceJSImpl::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
49684{
49685 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49686 if (aRv.Failed()) {
49687 return;
49688 }
49689 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49689); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49689; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49690 BindingCallContext& cx = s.GetCallContext();
49691
49692 JS::Rooted<JS::Value> rval(cx);
49693
49694 JS::Rooted<JS::Value> callable(cx);
49695 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49696 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49697 !InitIds(cx, atomsCache)) ||
49698 !GetCallableProperty(cx, atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id, &callable)) {
49699 aRv.Throw(NS_ERROR_UNEXPECTED);
49700 return;
49701 }
49702 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49703 if (!JS::Call(cx, thisValue, callable,
49704 JS::HandleValueArray::empty(), &rval)) {
49705 aRv.NoteJSContextException(cx);
49706 return;
49707 }
49708 Nullable<Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>>> rvalDecl;
49709 if (rval.isObject()) {
49710 JS::ForOfIterator iter(cx);
49711 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
49712 aRv.Throw(NS_ERROR_UNEXPECTED);
49713 return;
49714 }
49715 if (!iter.valueIsIterable()) {
49716 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence");
49717 aRv.Throw(NS_ERROR_UNEXPECTED);
49718 return;
49719 }
49720 Sequence<RefPtr<mozilla::dom::TestNonWrapperCacheInterface>> &arr = rvalDecl.SetValue();
49721 JS::Rooted<JS::Value> temp(cx);
49722 while (true) {
49723 bool done;
49724 if (!iter.next(&temp, &done)) {
49725 aRv.Throw(NS_ERROR_UNEXPECTED);
49726 return;
49727 }
49728 if (done) {
49729 break;
49730 }
49731 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
49732 if (!slotPtr) {
49733 JS_ReportOutOfMemory(cx);
49734 aRv.Throw(NS_ERROR_UNEXPECTED);
49735 return;
49736 }
49737 RefPtr<mozilla::dom::TestNonWrapperCacheInterface>& slot = *slotPtr;
49738 if (temp.isObject()) {
49739 static_assert(IsRefcounted<mozilla::dom::TestNonWrapperCacheInterface>::value, "We can only store refcounted classes.");
49740 {
49741 // Our JSContext should be in the right global to do unwrapping in.
49742 nsresult rv = UnwrapObject<prototypes::id::TestNonWrapperCacheInterface, mozilla::dom::TestNonWrapperCacheInterface>(&temp, slot, cx);
49743 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
49744 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "TestNonWrapperCacheInterface");
49745 aRv.Throw(NS_ERROR_UNEXPECTED);
49746 return;
49747 }
49748 }
49749 } else if (temp.isNullOrUndefined()) {
49750 slot = nullptr;
49751 } else {
49752 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence");
49753 aRv.Throw(NS_ERROR_UNEXPECTED);
49754 return;
49755 }
49756 }
49757 } else if (rval.isNullOrUndefined()) {
49758 rvalDecl.SetNull();
49759 } else {
49760 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableNonWrapperCacheInterfaceNullableSequence", "sequence");
49761 aRv.Throw(NS_ERROR_UNEXPECTED);
49762 return;
49763 }
49764 if (rvalDecl.IsNull()) {
49765 aRetVal.SetNull();
49766 } else {
49767 aRetVal.SetValue() = std::move(rvalDecl.Value());
49768 }
49769}
49770
49771already_AddRefed<TestExternalInterface>
49772TestJSImplInterfaceJSImpl::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm)
49773{
49774 CallSetup s(this, aRv, "TestJSImplInterface.receiveExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49775 if (aRv.Failed()) {
49776 return nullptr;
49777 }
49778 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49778); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49778; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49779 BindingCallContext& cx = s.GetCallContext();
49780
49781 JS::Rooted<JS::Value> rval(cx);
49782
49783 JS::Rooted<JS::Value> callable(cx);
49784 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49785 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49786 !InitIds(cx, atomsCache)) ||
49787 !GetCallableProperty(cx, atomsCache->receiveExternal_id, &callable)) {
49788 aRv.Throw(NS_ERROR_UNEXPECTED);
49789 return nullptr;
49790 }
49791 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49792 if (!JS::Call(cx, thisValue, callable,
49793 JS::HandleValueArray::empty(), &rval)) {
49794 aRv.NoteJSContextException(cx);
49795 return nullptr;
49796 }
49797 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49798 if (rval.isObject()) {
49799 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49800 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49801 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49802 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
49803 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveExternal", "TestExternalInterface");
49804 aRv.Throw(NS_ERROR_UNEXPECTED);
49805 return nullptr;
49806 }
49807 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 49807); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 49807; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49808 rvalDecl = rvalHolder;
49809 } else {
49810 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveExternal");
49811 aRv.Throw(NS_ERROR_UNEXPECTED);
49812 return nullptr;
49813 }
49814 return rvalDecl.forget();
49815}
49816
49817already_AddRefed<TestExternalInterface>
49818TestJSImplInterfaceJSImpl::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
49819{
49820 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49821 if (aRv.Failed()) {
49822 return nullptr;
49823 }
49824 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49824); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49824; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49825 BindingCallContext& cx = s.GetCallContext();
49826
49827 JS::Rooted<JS::Value> rval(cx);
49828
49829 JS::Rooted<JS::Value> callable(cx);
49830 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49831 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49832 !InitIds(cx, atomsCache)) ||
49833 !GetCallableProperty(cx, atomsCache->receiveNullableExternal_id, &callable)) {
49834 aRv.Throw(NS_ERROR_UNEXPECTED);
49835 return nullptr;
49836 }
49837 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49838 if (!JS::Call(cx, thisValue, callable,
49839 JS::HandleValueArray::empty(), &rval)) {
49840 aRv.NoteJSContextException(cx);
49841 return nullptr;
49842 }
49843 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49844 if (rval.isObject()) {
49845 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49846 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49847 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49848 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
49849 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveNullableExternal", "TestExternalInterface");
49850 aRv.Throw(NS_ERROR_UNEXPECTED);
49851 return nullptr;
49852 }
49853 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 49853); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 49853; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49854 rvalDecl = rvalHolder;
49855 } else if (rval.isNullOrUndefined()) {
49856 rvalDecl = nullptr;
49857 } else {
49858 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableExternal");
49859 aRv.Throw(NS_ERROR_UNEXPECTED);
49860 return nullptr;
49861 }
49862 return rvalDecl.forget();
49863}
49864
49865already_AddRefed<TestExternalInterface>
49866TestJSImplInterfaceJSImpl::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm)
49867{
49868 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49869 if (aRv.Failed()) {
49870 return nullptr;
49871 }
49872 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49872); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49872; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49873 BindingCallContext& cx = s.GetCallContext();
49874
49875 JS::Rooted<JS::Value> rval(cx);
49876
49877 JS::Rooted<JS::Value> callable(cx);
49878 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49879 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49880 !InitIds(cx, atomsCache)) ||
49881 !GetCallableProperty(cx, atomsCache->receiveWeakExternal_id, &callable)) {
49882 aRv.Throw(NS_ERROR_UNEXPECTED);
49883 return nullptr;
49884 }
49885 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49886 if (!JS::Call(cx, thisValue, callable,
49887 JS::HandleValueArray::empty(), &rval)) {
49888 aRv.NoteJSContextException(cx);
49889 return nullptr;
49890 }
49891 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49892 if (rval.isObject()) {
49893 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49894 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49895 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49896 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
49897 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakExternal", "TestExternalInterface");
49898 aRv.Throw(NS_ERROR_UNEXPECTED);
49899 return nullptr;
49900 }
49901 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 49901); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 49901; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49902 rvalDecl = rvalHolder;
49903 } else {
49904 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakExternal");
49905 aRv.Throw(NS_ERROR_UNEXPECTED);
49906 return nullptr;
49907 }
49908 return rvalDecl.forget();
49909}
49910
49911already_AddRefed<TestExternalInterface>
49912TestJSImplInterfaceJSImpl::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
49913{
49914 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49915 if (aRv.Failed()) {
49916 return nullptr;
49917 }
49918 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49918); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49918; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49919 BindingCallContext& cx = s.GetCallContext();
49920
49921 JS::Rooted<JS::Value> rval(cx);
49922
49923 JS::Rooted<JS::Value> callable(cx);
49924 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49925 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49926 !InitIds(cx, atomsCache)) ||
49927 !GetCallableProperty(cx, atomsCache->receiveWeakNullableExternal_id, &callable)) {
49928 aRv.Throw(NS_ERROR_UNEXPECTED);
49929 return nullptr;
49930 }
49931 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49932 if (!JS::Call(cx, thisValue, callable,
49933 JS::HandleValueArray::empty(), &rval)) {
49934 aRv.NoteJSContextException(cx);
49935 return nullptr;
49936 }
49937 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
49938 if (rval.isObject()) {
49939 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
49940 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
49941 JS::Rooted<JSObject*> source(cx, &rval.toObject());
49942 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
49943 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveWeakNullableExternal", "TestExternalInterface");
49944 aRv.Throw(NS_ERROR_UNEXPECTED);
49945 return nullptr;
49946 }
49947 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 49947); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 49947; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
49948 rvalDecl = rvalHolder;
49949 } else if (rval.isNullOrUndefined()) {
49950 rvalDecl = nullptr;
49951 } else {
49952 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableExternal");
49953 aRv.Throw(NS_ERROR_UNEXPECTED);
49954 return nullptr;
49955 }
49956 return rvalDecl.forget();
49957}
49958
49959void
49960TestJSImplInterfaceJSImpl::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
49961{
49962 CallSetup s(this, aRv, "TestJSImplInterface.passExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
49963 if (aRv.Failed()) {
49964 return;
49965 }
49966 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 49966); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 49966; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
49967 BindingCallContext& cx = s.GetCallContext();
49968
49969 JS::Rooted<JS::Value> rval(cx);
49970 JS::RootedVector<JS::Value> argv(cx);
49971 if (!argv.resize(1)) {
49972 // That threw an exception on the JSContext, and our CallSetup will do
49973 // the right thing with that.
49974 return;
49975 }
49976 unsigned argc = 1;
49977
49978 do {
49979 if (!WrapObject(cx, arg, argv[0])) {
49980 aRv.Throw(NS_ERROR_UNEXPECTED);
49981 return;
49982 }
49983 break;
49984 } while (false);
49985
49986 JS::Rooted<JS::Value> callable(cx);
49987 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
49988 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
49989 !InitIds(cx, atomsCache)) ||
49990 !GetCallableProperty(cx, atomsCache->passExternal_id, &callable)) {
49991 aRv.Throw(NS_ERROR_UNEXPECTED);
49992 return;
49993 }
49994 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
49995 if (!JS::Call(cx, thisValue, callable,
49996 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
49997 aRv.NoteJSContextException(cx);
49998 return;
49999 }
50000}
50001
50002void
50003TestJSImplInterfaceJSImpl::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50004{
50005 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50006 if (aRv.Failed()) {
50007 return;
50008 }
50009 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50009; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50010 BindingCallContext& cx = s.GetCallContext();
50011
50012 JS::Rooted<JS::Value> rval(cx);
50013 JS::RootedVector<JS::Value> argv(cx);
50014 if (!argv.resize(1)) {
50015 // That threw an exception on the JSContext, and our CallSetup will do
50016 // the right thing with that.
50017 return;
50018 }
50019 unsigned argc = 1;
50020
50021 do {
50022 if (!arg) {
50023 argv[0].setNull();
50024 break;
50025 }
50026 if (!WrapObject(cx, arg, argv[0])) {
50027 aRv.Throw(NS_ERROR_UNEXPECTED);
50028 return;
50029 }
50030 break;
50031 } while (false);
50032
50033 JS::Rooted<JS::Value> callable(cx);
50034 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50035 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50036 !InitIds(cx, atomsCache)) ||
50037 !GetCallableProperty(cx, atomsCache->passNullableExternal_id, &callable)) {
50038 aRv.Throw(NS_ERROR_UNEXPECTED);
50039 return;
50040 }
50041 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50042 if (!JS::Call(cx, thisValue, callable,
50043 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50044 aRv.NoteJSContextException(cx);
50045 return;
50046 }
50047}
50048
50049void
50050TestJSImplInterfaceJSImpl::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50051{
50052 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50053 if (aRv.Failed()) {
50054 return;
50055 }
50056 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50056); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50056; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50057 BindingCallContext& cx = s.GetCallContext();
50058
50059 JS::Rooted<JS::Value> rval(cx);
50060 JS::RootedVector<JS::Value> argv(cx);
50061 if (!argv.resize(1)) {
50062 // That threw an exception on the JSContext, and our CallSetup will do
50063 // the right thing with that.
50064 return;
50065 }
50066 unsigned argc = 1;
50067
50068 do {
50069 if (arg.WasPassed()) {
50070 if (!arg.Value()) {
50071 argv[0].setNull();
50072 break;
50073 }
50074 if (!WrapObject(cx, arg.Value(), argv[0])) {
50075 aRv.Throw(NS_ERROR_UNEXPECTED);
50076 return;
50077 }
50078 break;
50079 } else if (argc == 1) {
50080 // This is our current trailing argument; reduce argc
50081 --argc;
50082 } else {
50083 argv[0].setUndefined();
50084 }
50085 } while (false);
50086
50087 JS::Rooted<JS::Value> callable(cx);
50088 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50089 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50090 !InitIds(cx, atomsCache)) ||
50091 !GetCallableProperty(cx, atomsCache->passOptionalExternal_id, &callable)) {
50092 aRv.Throw(NS_ERROR_UNEXPECTED);
50093 return;
50094 }
50095 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50096 if (!JS::Call(cx, thisValue, callable,
50097 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50098 aRv.NoteJSContextException(cx);
50099 return;
50100 }
50101}
50102
50103void
50104TestJSImplInterfaceJSImpl::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50105{
50106 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50107 if (aRv.Failed()) {
50108 return;
50109 }
50110 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50111 BindingCallContext& cx = s.GetCallContext();
50112
50113 JS::Rooted<JS::Value> rval(cx);
50114 JS::RootedVector<JS::Value> argv(cx);
50115 if (!argv.resize(1)) {
50116 // That threw an exception on the JSContext, and our CallSetup will do
50117 // the right thing with that.
50118 return;
50119 }
50120 unsigned argc = 1;
50121
50122 do {
50123 if (arg.WasPassed()) {
50124 if (!WrapObject(cx, arg.Value(), argv[0])) {
50125 aRv.Throw(NS_ERROR_UNEXPECTED);
50126 return;
50127 }
50128 break;
50129 } else if (argc == 1) {
50130 // This is our current trailing argument; reduce argc
50131 --argc;
50132 } else {
50133 argv[0].setUndefined();
50134 }
50135 } while (false);
50136
50137 JS::Rooted<JS::Value> callable(cx);
50138 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50139 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50140 !InitIds(cx, atomsCache)) ||
50141 !GetCallableProperty(cx, atomsCache->passOptionalNonNullExternal_id, &callable)) {
50142 aRv.Throw(NS_ERROR_UNEXPECTED);
50143 return;
50144 }
50145 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50146 if (!JS::Call(cx, thisValue, callable,
50147 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50148 aRv.NoteJSContextException(cx);
50149 return;
50150 }
50151}
50152
50153void
50154TestJSImplInterfaceJSImpl::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50155{
50156 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalExternalWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50157 if (aRv.Failed()) {
50158 return;
50159 }
50160 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50160; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50161 BindingCallContext& cx = s.GetCallContext();
50162
50163 JS::Rooted<JS::Value> rval(cx);
50164 JS::RootedVector<JS::Value> argv(cx);
50165 if (!argv.resize(1)) {
50166 // That threw an exception on the JSContext, and our CallSetup will do
50167 // the right thing with that.
50168 return;
50169 }
50170 unsigned argc = 1;
50171
50172 do {
50173 if (!arg) {
50174 argv[0].setNull();
50175 break;
50176 }
50177 if (!WrapObject(cx, arg, argv[0])) {
50178 aRv.Throw(NS_ERROR_UNEXPECTED);
50179 return;
50180 }
50181 break;
50182 } while (false);
50183
50184 JS::Rooted<JS::Value> callable(cx);
50185 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50186 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50187 !InitIds(cx, atomsCache)) ||
50188 !GetCallableProperty(cx, atomsCache->passOptionalExternalWithDefault_id, &callable)) {
50189 aRv.Throw(NS_ERROR_UNEXPECTED);
50190 return;
50191 }
50192 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50193 if (!JS::Call(cx, thisValue, callable,
50194 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50195 aRv.NoteJSContextException(cx);
50196 return;
50197 }
50198}
50199
50200already_AddRefed<TestCallbackInterface>
50201TestJSImplInterfaceJSImpl::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50202{
50203 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50204 if (aRv.Failed()) {
50205 return nullptr;
50206 }
50207 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50207); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50207; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50208 BindingCallContext& cx = s.GetCallContext();
50209
50210 JS::Rooted<JS::Value> rval(cx);
50211
50212 JS::Rooted<JS::Value> callable(cx);
50213 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50214 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50215 !InitIds(cx, atomsCache)) ||
50216 !GetCallableProperty(cx, atomsCache->receiveCallbackInterface_id, &callable)) {
50217 aRv.Throw(NS_ERROR_UNEXPECTED);
50218 return nullptr;
50219 }
50220 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50221 if (!JS::Call(cx, thisValue, callable,
50222 JS::HandleValueArray::empty(), &rval)) {
50223 aRv.NoteJSContextException(cx);
50224 return nullptr;
50225 }
50226 RefPtr<TestCallbackInterface> rvalDecl;
50227 if (rval.isObject()) {
50228 { // scope for tempRoot and tempGlobalRoot if needed
50229 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50230 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50231 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50232 }
50233 } else {
50234 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallbackInterface");
50235 aRv.Throw(NS_ERROR_UNEXPECTED);
50236 return nullptr;
50237 }
50238 return rvalDecl.forget();
50239}
50240
50241already_AddRefed<TestCallbackInterface>
50242TestJSImplInterfaceJSImpl::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50243{
50244 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50245 if (aRv.Failed()) {
50246 return nullptr;
50247 }
50248 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50248; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50249 BindingCallContext& cx = s.GetCallContext();
50250
50251 JS::Rooted<JS::Value> rval(cx);
50252
50253 JS::Rooted<JS::Value> callable(cx);
50254 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50255 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50256 !InitIds(cx, atomsCache)) ||
50257 !GetCallableProperty(cx, atomsCache->receiveNullableCallbackInterface_id, &callable)) {
50258 aRv.Throw(NS_ERROR_UNEXPECTED);
50259 return nullptr;
50260 }
50261 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50262 if (!JS::Call(cx, thisValue, callable,
50263 JS::HandleValueArray::empty(), &rval)) {
50264 aRv.NoteJSContextException(cx);
50265 return nullptr;
50266 }
50267 RefPtr<TestCallbackInterface> rvalDecl;
50268 if (rval.isObject()) {
50269 { // scope for tempRoot and tempGlobalRoot if needed
50270 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50271 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50272 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50273 }
50274 } else if (rval.isNullOrUndefined()) {
50275 rvalDecl = nullptr;
50276 } else {
50277 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallbackInterface");
50278 aRv.Throw(NS_ERROR_UNEXPECTED);
50279 return nullptr;
50280 }
50281 return rvalDecl.forget();
50282}
50283
50284already_AddRefed<TestCallbackInterface>
50285TestJSImplInterfaceJSImpl::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50286{
50287 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50288 if (aRv.Failed()) {
50289 return nullptr;
50290 }
50291 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50291); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50291; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50292 BindingCallContext& cx = s.GetCallContext();
50293
50294 JS::Rooted<JS::Value> rval(cx);
50295
50296 JS::Rooted<JS::Value> callable(cx);
50297 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50298 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50299 !InitIds(cx, atomsCache)) ||
50300 !GetCallableProperty(cx, atomsCache->receiveWeakCallbackInterface_id, &callable)) {
50301 aRv.Throw(NS_ERROR_UNEXPECTED);
50302 return nullptr;
50303 }
50304 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50305 if (!JS::Call(cx, thisValue, callable,
50306 JS::HandleValueArray::empty(), &rval)) {
50307 aRv.NoteJSContextException(cx);
50308 return nullptr;
50309 }
50310 RefPtr<TestCallbackInterface> rvalDecl;
50311 if (rval.isObject()) {
50312 { // scope for tempRoot and tempGlobalRoot if needed
50313 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50314 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50315 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50316 }
50317 } else {
50318 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakCallbackInterface");
50319 aRv.Throw(NS_ERROR_UNEXPECTED);
50320 return nullptr;
50321 }
50322 return rvalDecl.forget();
50323}
50324
50325already_AddRefed<TestCallbackInterface>
50326TestJSImplInterfaceJSImpl::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
50327{
50328 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50329 if (aRv.Failed()) {
50330 return nullptr;
50331 }
50332 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50332); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50332; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50333 BindingCallContext& cx = s.GetCallContext();
50334
50335 JS::Rooted<JS::Value> rval(cx);
50336
50337 JS::Rooted<JS::Value> callable(cx);
50338 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50339 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50340 !InitIds(cx, atomsCache)) ||
50341 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCallbackInterface_id, &callable)) {
50342 aRv.Throw(NS_ERROR_UNEXPECTED);
50343 return nullptr;
50344 }
50345 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50346 if (!JS::Call(cx, thisValue, callable,
50347 JS::HandleValueArray::empty(), &rval)) {
50348 aRv.NoteJSContextException(cx);
50349 return nullptr;
50350 }
50351 RefPtr<TestCallbackInterface> rvalDecl;
50352 if (rval.isObject()) {
50353 { // scope for tempRoot and tempGlobalRoot if needed
50354 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
50355 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
50356 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
50357 }
50358 } else if (rval.isNullOrUndefined()) {
50359 rvalDecl = nullptr;
50360 } else {
50361 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveWeakNullableCallbackInterface");
50362 aRv.Throw(NS_ERROR_UNEXPECTED);
50363 return nullptr;
50364 }
50365 return rvalDecl.forget();
50366}
50367
50368void
50369TestJSImplInterfaceJSImpl::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
50370{
50371 CallSetup s(this, aRv, "TestJSImplInterface.passCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50372 if (aRv.Failed()) {
50373 return;
50374 }
50375 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50375); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50375; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50376 BindingCallContext& cx = s.GetCallContext();
50377
50378 JS::Rooted<JS::Value> rval(cx);
50379 JS::RootedVector<JS::Value> argv(cx);
50380 if (!argv.resize(1)) {
50381 // That threw an exception on the JSContext, and our CallSetup will do
50382 // the right thing with that.
50383 return;
50384 }
50385 unsigned argc = 1;
50386
50387 do {
50388 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50389 if (!MaybeWrapObjectValue(cx, argv[0])) {
50390 aRv.Throw(NS_ERROR_UNEXPECTED);
50391 return;
50392 }
50393 break;
50394 } while (false);
50395
50396 JS::Rooted<JS::Value> callable(cx);
50397 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50398 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50399 !InitIds(cx, atomsCache)) ||
50400 !GetCallableProperty(cx, atomsCache->passCallbackInterface_id, &callable)) {
50401 aRv.Throw(NS_ERROR_UNEXPECTED);
50402 return;
50403 }
50404 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50405 if (!JS::Call(cx, thisValue, callable,
50406 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50407 aRv.NoteJSContextException(cx);
50408 return;
50409 }
50410}
50411
50412void
50413TestJSImplInterfaceJSImpl::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50414{
50415 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50416 if (aRv.Failed()) {
50417 return;
50418 }
50419 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50419); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50419; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50420 BindingCallContext& cx = s.GetCallContext();
50421
50422 JS::Rooted<JS::Value> rval(cx);
50423 JS::RootedVector<JS::Value> argv(cx);
50424 if (!argv.resize(1)) {
50425 // That threw an exception on the JSContext, and our CallSetup will do
50426 // the right thing with that.
50427 return;
50428 }
50429 unsigned argc = 1;
50430
50431 do {
50432 if (arg) {
50433 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50434 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50435 aRv.Throw(NS_ERROR_UNEXPECTED);
50436 return;
50437 }
50438 break;
50439 } else {
50440 argv[0].setNull();
50441 break;
50442 }
50443 } while (false);
50444
50445 JS::Rooted<JS::Value> callable(cx);
50446 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50447 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50448 !InitIds(cx, atomsCache)) ||
50449 !GetCallableProperty(cx, atomsCache->passNullableCallbackInterface_id, &callable)) {
50450 aRv.Throw(NS_ERROR_UNEXPECTED);
50451 return;
50452 }
50453 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50454 if (!JS::Call(cx, thisValue, callable,
50455 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50456 aRv.NoteJSContextException(cx);
50457 return;
50458 }
50459}
50460
50461void
50462TestJSImplInterfaceJSImpl::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50463{
50464 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50465 if (aRv.Failed()) {
50466 return;
50467 }
50468 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50468); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50468; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50469 BindingCallContext& cx = s.GetCallContext();
50470
50471 JS::Rooted<JS::Value> rval(cx);
50472 JS::RootedVector<JS::Value> argv(cx);
50473 if (!argv.resize(1)) {
50474 // That threw an exception on the JSContext, and our CallSetup will do
50475 // the right thing with that.
50476 return;
50477 }
50478 unsigned argc = 1;
50479
50480 do {
50481 if (arg.WasPassed()) {
50482 if (arg.Value()) {
50483 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
50484 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50485 aRv.Throw(NS_ERROR_UNEXPECTED);
50486 return;
50487 }
50488 break;
50489 } else {
50490 argv[0].setNull();
50491 break;
50492 }
50493 } else if (argc == 1) {
50494 // This is our current trailing argument; reduce argc
50495 --argc;
50496 } else {
50497 argv[0].setUndefined();
50498 }
50499 } while (false);
50500
50501 JS::Rooted<JS::Value> callable(cx);
50502 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50503 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50504 !InitIds(cx, atomsCache)) ||
50505 !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterface_id, &callable)) {
50506 aRv.Throw(NS_ERROR_UNEXPECTED);
50507 return;
50508 }
50509 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50510 if (!JS::Call(cx, thisValue, callable,
50511 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50512 aRv.NoteJSContextException(cx);
50513 return;
50514 }
50515}
50516
50517void
50518TestJSImplInterfaceJSImpl::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50519{
50520 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50521 if (aRv.Failed()) {
50522 return;
50523 }
50524 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50524); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50524; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50525 BindingCallContext& cx = s.GetCallContext();
50526
50527 JS::Rooted<JS::Value> rval(cx);
50528 JS::RootedVector<JS::Value> argv(cx);
50529 if (!argv.resize(1)) {
50530 // That threw an exception on the JSContext, and our CallSetup will do
50531 // the right thing with that.
50532 return;
50533 }
50534 unsigned argc = 1;
50535
50536 do {
50537 if (arg.WasPassed()) {
50538 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
50539 if (!MaybeWrapObjectValue(cx, argv[0])) {
50540 aRv.Throw(NS_ERROR_UNEXPECTED);
50541 return;
50542 }
50543 break;
50544 } else if (argc == 1) {
50545 // This is our current trailing argument; reduce argc
50546 --argc;
50547 } else {
50548 argv[0].setUndefined();
50549 }
50550 } while (false);
50551
50552 JS::Rooted<JS::Value> callable(cx);
50553 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50554 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50555 !InitIds(cx, atomsCache)) ||
50556 !GetCallableProperty(cx, atomsCache->passOptionalNonNullCallbackInterface_id, &callable)) {
50557 aRv.Throw(NS_ERROR_UNEXPECTED);
50558 return;
50559 }
50560 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50561 if (!JS::Call(cx, thisValue, callable,
50562 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50563 aRv.NoteJSContextException(cx);
50564 return;
50565 }
50566}
50567
50568void
50569TestJSImplInterfaceJSImpl::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
50570{
50571 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallbackInterfaceWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50572 if (aRv.Failed()) {
50573 return;
50574 }
50575 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50575; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50576 BindingCallContext& cx = s.GetCallContext();
50577
50578 JS::Rooted<JS::Value> rval(cx);
50579 JS::RootedVector<JS::Value> argv(cx);
50580 if (!argv.resize(1)) {
50581 // That threw an exception on the JSContext, and our CallSetup will do
50582 // the right thing with that.
50583 return;
50584 }
50585 unsigned argc = 1;
50586
50587 do {
50588 if (arg) {
50589 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
50590 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
50591 aRv.Throw(NS_ERROR_UNEXPECTED);
50592 return;
50593 }
50594 break;
50595 } else {
50596 argv[0].setNull();
50597 break;
50598 }
50599 } while (false);
50600
50601 JS::Rooted<JS::Value> callable(cx);
50602 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50603 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50604 !InitIds(cx, atomsCache)) ||
50605 !GetCallableProperty(cx, atomsCache->passOptionalCallbackInterfaceWithDefault_id, &callable)) {
50606 aRv.Throw(NS_ERROR_UNEXPECTED);
50607 return;
50608 }
50609 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50610 if (!JS::Call(cx, thisValue, callable,
50611 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50612 aRv.NoteJSContextException(cx);
50613 return;
50614 }
50615}
50616
50617void
50618TestJSImplInterfaceJSImpl::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50619{
50620 CallSetup s(this, aRv, "TestJSImplInterface.receiveSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50621 if (aRv.Failed()) {
50622 return;
50623 }
50624 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50624); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50624; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50625 BindingCallContext& cx = s.GetCallContext();
50626
50627 JS::Rooted<JS::Value> rval(cx);
50628
50629 JS::Rooted<JS::Value> callable(cx);
50630 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50631 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50632 !InitIds(cx, atomsCache)) ||
50633 !GetCallableProperty(cx, atomsCache->receiveSequence_id, &callable)) {
50634 aRv.Throw(NS_ERROR_UNEXPECTED);
50635 return;
50636 }
50637 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50638 if (!JS::Call(cx, thisValue, callable,
50639 JS::HandleValueArray::empty(), &rval)) {
50640 aRv.NoteJSContextException(cx);
50641 return;
50642 }
50643 Sequence<int32_t> rvalDecl;
50644 if (rval.isObject()) {
50645 JS::ForOfIterator iter(cx);
50646 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50647 aRv.Throw(NS_ERROR_UNEXPECTED);
50648 return;
50649 }
50650 if (!iter.valueIsIterable()) {
50651 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence");
50652 aRv.Throw(NS_ERROR_UNEXPECTED);
50653 return;
50654 }
50655 Sequence<int32_t> &arr = rvalDecl;
50656 JS::Rooted<JS::Value> temp(cx);
50657 while (true) {
50658 bool done;
50659 if (!iter.next(&temp, &done)) {
50660 aRv.Throw(NS_ERROR_UNEXPECTED);
50661 return;
50662 }
50663 if (done) {
50664 break;
50665 }
50666 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
50667 if (!slotPtr) {
50668 JS_ReportOutOfMemory(cx);
50669 aRv.Throw(NS_ERROR_UNEXPECTED);
50670 return;
50671 }
50672 int32_t& slot = *slotPtr;
50673 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequence", &slot)) {
50674 aRv.Throw(NS_ERROR_UNEXPECTED);
50675 return;
50676 }
50677 }
50678 } else {
50679 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequence", "sequence");
50680 aRv.Throw(NS_ERROR_UNEXPECTED);
50681 return;
50682 }
50683 aRetVal = std::move(rvalDecl);
50684}
50685
50686void
50687TestJSImplInterfaceJSImpl::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50688{
50689 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50690 if (aRv.Failed()) {
50691 return;
50692 }
50693 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50693); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50693; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50694 BindingCallContext& cx = s.GetCallContext();
50695
50696 JS::Rooted<JS::Value> rval(cx);
50697
50698 JS::Rooted<JS::Value> callable(cx);
50699 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50700 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50701 !InitIds(cx, atomsCache)) ||
50702 !GetCallableProperty(cx, atomsCache->receiveNullableSequence_id, &callable)) {
50703 aRv.Throw(NS_ERROR_UNEXPECTED);
50704 return;
50705 }
50706 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50707 if (!JS::Call(cx, thisValue, callable,
50708 JS::HandleValueArray::empty(), &rval)) {
50709 aRv.NoteJSContextException(cx);
50710 return;
50711 }
50712 Nullable<Sequence<int32_t>> rvalDecl;
50713 if (rval.isObject()) {
50714 JS::ForOfIterator iter(cx);
50715 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50716 aRv.Throw(NS_ERROR_UNEXPECTED);
50717 return;
50718 }
50719 if (!iter.valueIsIterable()) {
50720 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence");
50721 aRv.Throw(NS_ERROR_UNEXPECTED);
50722 return;
50723 }
50724 Sequence<int32_t> &arr = rvalDecl.SetValue();
50725 JS::Rooted<JS::Value> temp(cx);
50726 while (true) {
50727 bool done;
50728 if (!iter.next(&temp, &done)) {
50729 aRv.Throw(NS_ERROR_UNEXPECTED);
50730 return;
50731 }
50732 if (done) {
50733 break;
50734 }
50735 int32_t* slotPtr = arr.AppendElement(mozilla::fallible);
50736 if (!slotPtr) {
50737 JS_ReportOutOfMemory(cx);
50738 aRv.Throw(NS_ERROR_UNEXPECTED);
50739 return;
50740 }
50741 int32_t& slot = *slotPtr;
50742 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequence", &slot)) {
50743 aRv.Throw(NS_ERROR_UNEXPECTED);
50744 return;
50745 }
50746 }
50747 } else if (rval.isNullOrUndefined()) {
50748 rvalDecl.SetNull();
50749 } else {
50750 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequence", "sequence");
50751 aRv.Throw(NS_ERROR_UNEXPECTED);
50752 return;
50753 }
50754 if (rvalDecl.IsNull()) {
50755 aRetVal.SetNull();
50756 } else {
50757 aRetVal.SetValue() = std::move(rvalDecl.Value());
50758 }
50759}
50760
50761void
50762TestJSImplInterfaceJSImpl::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50763{
50764 CallSetup s(this, aRv, "TestJSImplInterface.receiveSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50765 if (aRv.Failed()) {
50766 return;
50767 }
50768 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50768); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50768; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50769 BindingCallContext& cx = s.GetCallContext();
50770
50771 JS::Rooted<JS::Value> rval(cx);
50772
50773 JS::Rooted<JS::Value> callable(cx);
50774 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50775 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50776 !InitIds(cx, atomsCache)) ||
50777 !GetCallableProperty(cx, atomsCache->receiveSequenceOfNullableInts_id, &callable)) {
50778 aRv.Throw(NS_ERROR_UNEXPECTED);
50779 return;
50780 }
50781 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50782 if (!JS::Call(cx, thisValue, callable,
50783 JS::HandleValueArray::empty(), &rval)) {
50784 aRv.NoteJSContextException(cx);
50785 return;
50786 }
50787 Sequence<Nullable<int32_t>> rvalDecl;
50788 if (rval.isObject()) {
50789 JS::ForOfIterator iter(cx);
50790 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50791 aRv.Throw(NS_ERROR_UNEXPECTED);
50792 return;
50793 }
50794 if (!iter.valueIsIterable()) {
50795 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence");
50796 aRv.Throw(NS_ERROR_UNEXPECTED);
50797 return;
50798 }
50799 Sequence<Nullable<int32_t>> &arr = rvalDecl;
50800 JS::Rooted<JS::Value> temp(cx);
50801 while (true) {
50802 bool done;
50803 if (!iter.next(&temp, &done)) {
50804 aRv.Throw(NS_ERROR_UNEXPECTED);
50805 return;
50806 }
50807 if (done) {
50808 break;
50809 }
50810 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
50811 if (!slotPtr) {
50812 JS_ReportOutOfMemory(cx);
50813 aRv.Throw(NS_ERROR_UNEXPECTED);
50814 return;
50815 }
50816 Nullable<int32_t>& slot = *slotPtr;
50817 if (temp.isNullOrUndefined()) {
50818 slot.SetNull();
50819 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveSequenceOfNullableInts", &slot.SetValue())) {
50820 aRv.Throw(NS_ERROR_UNEXPECTED);
50821 return;
50822 }
50823 }
50824 } else {
50825 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveSequenceOfNullableInts", "sequence");
50826 aRv.Throw(NS_ERROR_UNEXPECTED);
50827 return;
50828 }
50829 aRetVal = std::move(rvalDecl);
50830}
50831
50832void
50833TestJSImplInterfaceJSImpl::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
50834{
50835 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50836 if (aRv.Failed()) {
50837 return;
50838 }
50839 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50839); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50839; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50840 BindingCallContext& cx = s.GetCallContext();
50841
50842 JS::Rooted<JS::Value> rval(cx);
50843
50844 JS::Rooted<JS::Value> callable(cx);
50845 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50846 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50847 !InitIds(cx, atomsCache)) ||
50848 !GetCallableProperty(cx, atomsCache->receiveNullableSequenceOfNullableInts_id, &callable)) {
50849 aRv.Throw(NS_ERROR_UNEXPECTED);
50850 return;
50851 }
50852 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50853 if (!JS::Call(cx, thisValue, callable,
50854 JS::HandleValueArray::empty(), &rval)) {
50855 aRv.NoteJSContextException(cx);
50856 return;
50857 }
50858 Nullable<Sequence<Nullable<int32_t>>> rvalDecl;
50859 if (rval.isObject()) {
50860 JS::ForOfIterator iter(cx);
50861 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
50862 aRv.Throw(NS_ERROR_UNEXPECTED);
50863 return;
50864 }
50865 if (!iter.valueIsIterable()) {
50866 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence");
50867 aRv.Throw(NS_ERROR_UNEXPECTED);
50868 return;
50869 }
50870 Sequence<Nullable<int32_t>> &arr = rvalDecl.SetValue();
50871 JS::Rooted<JS::Value> temp(cx);
50872 while (true) {
50873 bool done;
50874 if (!iter.next(&temp, &done)) {
50875 aRv.Throw(NS_ERROR_UNEXPECTED);
50876 return;
50877 }
50878 if (done) {
50879 break;
50880 }
50881 Nullable<int32_t>* slotPtr = arr.AppendElement(mozilla::fallible);
50882 if (!slotPtr) {
50883 JS_ReportOutOfMemory(cx);
50884 aRv.Throw(NS_ERROR_UNEXPECTED);
50885 return;
50886 }
50887 Nullable<int32_t>& slot = *slotPtr;
50888 if (temp.isNullOrUndefined()) {
50889 slot.SetNull();
50890 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Element of return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", &slot.SetValue())) {
50891 aRv.Throw(NS_ERROR_UNEXPECTED);
50892 return;
50893 }
50894 }
50895 } else if (rval.isNullOrUndefined()) {
50896 rvalDecl.SetNull();
50897 } else {
50898 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableSequenceOfNullableInts", "sequence");
50899 aRv.Throw(NS_ERROR_UNEXPECTED);
50900 return;
50901 }
50902 if (rvalDecl.IsNull()) {
50903 aRetVal.SetNull();
50904 } else {
50905 aRetVal.SetValue() = std::move(rvalDecl.Value());
50906 }
50907}
50908
50909void
50910TestJSImplInterfaceJSImpl::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50911{
50912 CallSetup s(this, aRv, "TestJSImplInterface.passSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50913 if (aRv.Failed()) {
50914 return;
50915 }
50916 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50916); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50916; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50917 BindingCallContext& cx = s.GetCallContext();
50918
50919 JS::Rooted<JS::Value> rval(cx);
50920 JS::RootedVector<JS::Value> argv(cx);
50921 if (!argv.resize(1)) {
50922 // That threw an exception on the JSContext, and our CallSetup will do
50923 // the right thing with that.
50924 return;
50925 }
50926 unsigned argc = 1;
50927
50928 do {
50929
50930 uint32_t length = arg.Length();
50931 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
50932 if (!returnArray) {
50933 aRv.Throw(NS_ERROR_UNEXPECTED);
50934 return;
50935 }
50936 // Scope for 'tmp'
50937 {
50938 JS::Rooted<JS::Value> tmp(cx);
50939 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
50940 // Control block to let us common up the JS_DefineElement calls when there
50941 // are different ways to succeed at wrapping the object.
50942 do {
50943 tmp.setInt32(int32_t(arg[sequenceIdx0]));
50944 break;
50945 } while (false);
50946 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
50947 JSPROP_ENUMERATE)) {
50948 aRv.Throw(NS_ERROR_UNEXPECTED);
50949 return;
50950 }
50951 }
50952 }
50953 argv[0].setObject(*returnArray);
50954 break;
50955 } while (false);
50956
50957 JS::Rooted<JS::Value> callable(cx);
50958 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
50959 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
50960 !InitIds(cx, atomsCache)) ||
50961 !GetCallableProperty(cx, atomsCache->passSequence_id, &callable)) {
50962 aRv.Throw(NS_ERROR_UNEXPECTED);
50963 return;
50964 }
50965 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
50966 if (!JS::Call(cx, thisValue, callable,
50967 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
50968 aRv.NoteJSContextException(cx);
50969 return;
50970 }
50971}
50972
50973void
50974TestJSImplInterfaceJSImpl::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
50975{
50976 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
50977 if (aRv.Failed()) {
50978 return;
50979 }
50980 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 50980); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 50980; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
50981 BindingCallContext& cx = s.GetCallContext();
50982
50983 JS::Rooted<JS::Value> rval(cx);
50984 JS::RootedVector<JS::Value> argv(cx);
50985 if (!argv.resize(1)) {
50986 // That threw an exception on the JSContext, and our CallSetup will do
50987 // the right thing with that.
50988 return;
50989 }
50990 unsigned argc = 1;
50991
50992 do {
50993
50994 if (arg.IsNull()) {
50995 argv[0].setNull();
50996 break;
50997 }
50998
50999 uint32_t length = arg.Value().Length();
51000 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51001 if (!returnArray) {
51002 aRv.Throw(NS_ERROR_UNEXPECTED);
51003 return;
51004 }
51005 // Scope for 'tmp'
51006 {
51007 JS::Rooted<JS::Value> tmp(cx);
51008 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51009 // Control block to let us common up the JS_DefineElement calls when there
51010 // are different ways to succeed at wrapping the object.
51011 do {
51012 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
51013 break;
51014 } while (false);
51015 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51016 JSPROP_ENUMERATE)) {
51017 aRv.Throw(NS_ERROR_UNEXPECTED);
51018 return;
51019 }
51020 }
51021 }
51022 argv[0].setObject(*returnArray);
51023 break;
51024 } while (false);
51025
51026 JS::Rooted<JS::Value> callable(cx);
51027 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51028 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51029 !InitIds(cx, atomsCache)) ||
51030 !GetCallableProperty(cx, atomsCache->passNullableSequence_id, &callable)) {
51031 aRv.Throw(NS_ERROR_UNEXPECTED);
51032 return;
51033 }
51034 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51035 if (!JS::Call(cx, thisValue, callable,
51036 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51037 aRv.NoteJSContextException(cx);
51038 return;
51039 }
51040}
51041
51042void
51043TestJSImplInterfaceJSImpl::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51044{
51045 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51046 if (aRv.Failed()) {
51047 return;
51048 }
51049 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51049); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51049; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51050 BindingCallContext& cx = s.GetCallContext();
51051
51052 JS::Rooted<JS::Value> rval(cx);
51053 JS::RootedVector<JS::Value> argv(cx);
51054 if (!argv.resize(1)) {
51055 // That threw an exception on the JSContext, and our CallSetup will do
51056 // the right thing with that.
51057 return;
51058 }
51059 unsigned argc = 1;
51060
51061 do {
51062
51063 uint32_t length = arg.Length();
51064 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51065 if (!returnArray) {
51066 aRv.Throw(NS_ERROR_UNEXPECTED);
51067 return;
51068 }
51069 // Scope for 'tmp'
51070 {
51071 JS::Rooted<JS::Value> tmp(cx);
51072 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51073 // Control block to let us common up the JS_DefineElement calls when there
51074 // are different ways to succeed at wrapping the object.
51075 do {
51076 if (arg[sequenceIdx0].IsNull()) {
51077 tmp.setNull();
51078 break;
51079 }
51080 tmp.setInt32(int32_t(arg[sequenceIdx0].Value()));
51081 break;
51082 } while (false);
51083 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51084 JSPROP_ENUMERATE)) {
51085 aRv.Throw(NS_ERROR_UNEXPECTED);
51086 return;
51087 }
51088 }
51089 }
51090 argv[0].setObject(*returnArray);
51091 break;
51092 } while (false);
51093
51094 JS::Rooted<JS::Value> callable(cx);
51095 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51096 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51097 !InitIds(cx, atomsCache)) ||
51098 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableInts_id, &callable)) {
51099 aRv.Throw(NS_ERROR_UNEXPECTED);
51100 return;
51101 }
51102 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51103 if (!JS::Call(cx, thisValue, callable,
51104 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51105 aRv.NoteJSContextException(cx);
51106 return;
51107 }
51108}
51109
51110void
51111TestJSImplInterfaceJSImpl::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51112{
51113 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51114 if (aRv.Failed()) {
51115 return;
51116 }
51117 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51117); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51117; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51118 BindingCallContext& cx = s.GetCallContext();
51119
51120 JS::Rooted<JS::Value> rval(cx);
51121 JS::RootedVector<JS::Value> argv(cx);
51122 if (!argv.resize(1)) {
51123 // That threw an exception on the JSContext, and our CallSetup will do
51124 // the right thing with that.
51125 return;
51126 }
51127 unsigned argc = 1;
51128
51129 do {
51130 if (arg.WasPassed()) {
51131
51132 uint32_t length = arg.Value().Length();
51133 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51134 if (!returnArray) {
51135 aRv.Throw(NS_ERROR_UNEXPECTED);
51136 return;
51137 }
51138 // Scope for 'tmp'
51139 {
51140 JS::Rooted<JS::Value> tmp(cx);
51141 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51142 // Control block to let us common up the JS_DefineElement calls when there
51143 // are different ways to succeed at wrapping the object.
51144 do {
51145 if (arg.Value()[sequenceIdx0].IsNull()) {
51146 tmp.setNull();
51147 break;
51148 }
51149 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0].Value()));
51150 break;
51151 } while (false);
51152 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51153 JSPROP_ENUMERATE)) {
51154 aRv.Throw(NS_ERROR_UNEXPECTED);
51155 return;
51156 }
51157 }
51158 }
51159 argv[0].setObject(*returnArray);
51160 break;
51161 } else if (argc == 1) {
51162 // This is our current trailing argument; reduce argc
51163 --argc;
51164 } else {
51165 argv[0].setUndefined();
51166 }
51167 } while (false);
51168
51169 JS::Rooted<JS::Value> callable(cx);
51170 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51171 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51172 !InitIds(cx, atomsCache)) ||
51173 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfNullableInts_id, &callable)) {
51174 aRv.Throw(NS_ERROR_UNEXPECTED);
51175 return;
51176 }
51177 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51178 if (!JS::Call(cx, thisValue, callable,
51179 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51180 aRv.NoteJSContextException(cx);
51181 return;
51182 }
51183}
51184
51185void
51186TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
51187{
51188 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51189 if (aRv.Failed()) {
51190 return;
51191 }
51192 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51192); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51192; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51193 BindingCallContext& cx = s.GetCallContext();
51194
51195 JS::Rooted<JS::Value> rval(cx);
51196 JS::RootedVector<JS::Value> argv(cx);
51197 if (!argv.resize(1)) {
51198 // That threw an exception on the JSContext, and our CallSetup will do
51199 // the right thing with that.
51200 return;
51201 }
51202 unsigned argc = 1;
51203
51204 do {
51205 if (arg.WasPassed()) {
51206
51207 if (arg.Value().IsNull()) {
51208 argv[0].setNull();
51209 break;
51210 }
51211
51212 uint32_t length = arg.Value().Value().Length();
51213 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
51214 if (!returnArray) {
51215 aRv.Throw(NS_ERROR_UNEXPECTED);
51216 return;
51217 }
51218 // Scope for 'tmp'
51219 {
51220 JS::Rooted<JS::Value> tmp(cx);
51221 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
51222 // Control block to let us common up the JS_DefineElement calls when there
51223 // are different ways to succeed at wrapping the object.
51224 do {
51225 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
51226 tmp.setNull();
51227 break;
51228 }
51229 tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0].Value()));
51230 break;
51231 } while (false);
51232 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
51233 JSPROP_ENUMERATE)) {
51234 aRv.Throw(NS_ERROR_UNEXPECTED);
51235 return;
51236 }
51237 }
51238 }
51239 argv[0].setObject(*returnArray);
51240 break;
51241 } else if (argc == 1) {
51242 // This is our current trailing argument; reduce argc
51243 --argc;
51244 } else {
51245 argv[0].setUndefined();
51246 }
51247 } while (false);
51248
51249 JS::Rooted<JS::Value> callable(cx);
51250 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51251 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51252 !InitIds(cx, atomsCache)) ||
51253 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableInts_id, &callable)) {
51254 aRv.Throw(NS_ERROR_UNEXPECTED);
51255 return;
51256 }
51257 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51258 if (!JS::Call(cx, thisValue, callable,
51259 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
51260 aRv.NoteJSContextException(cx);
51261 return;
51262 }
51263}
51264
51265void
51266TestJSImplInterfaceJSImpl::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51267{
51268 CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51269 if (aRv.Failed()) {
51270 return;
51271 }
51272 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51272); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51272; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51273 BindingCallContext& cx = s.GetCallContext();
51274
51275 JS::Rooted<JS::Value> rval(cx);
51276
51277 JS::Rooted<JS::Value> callable(cx);
51278 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51279 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51280 !InitIds(cx, atomsCache)) ||
51281 !GetCallableProperty(cx, atomsCache->receiveCastableObjectSequence_id, &callable)) {
51282 aRv.Throw(NS_ERROR_UNEXPECTED);
51283 return;
51284 }
51285 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51286 if (!JS::Call(cx, thisValue, callable,
51287 JS::HandleValueArray::empty(), &rval)) {
51288 aRv.NoteJSContextException(cx);
51289 return;
51290 }
51291 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51292 if (rval.isObject()) {
51293 JS::ForOfIterator iter(cx);
51294 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51295 aRv.Throw(NS_ERROR_UNEXPECTED);
51296 return;
51297 }
51298 if (!iter.valueIsIterable()) {
51299 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence");
51300 aRv.Throw(NS_ERROR_UNEXPECTED);
51301 return;
51302 }
51303 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51304 JS::Rooted<JS::Value> temp(cx);
51305 while (true) {
51306 bool done;
51307 if (!iter.next(&temp, &done)) {
51308 aRv.Throw(NS_ERROR_UNEXPECTED);
51309 return;
51310 }
51311 if (done) {
51312 break;
51313 }
51314 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51315 if (!slotPtr) {
51316 JS_ReportOutOfMemory(cx);
51317 aRv.Throw(NS_ERROR_UNEXPECTED);
51318 return;
51319 }
51320 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51321 if (temp.isObject()) {
51322 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51323 {
51324 // Our JSContext should be in the right global to do unwrapping in.
51325 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51326 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51327 // Be careful to not wrap random DOM objects here, even if
51328 // they're wrapped in opaque security wrappers for some reason.
51329 // XXXbz Wish we could check for a JS-implemented object
51330 // that already has a content reflection...
51331 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51332 nsCOMPtr<nsIGlobalObject> contentGlobal;
51333 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51334 if (!callback ||
51335 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51336 aRv.Throw(NS_ERROR_UNEXPECTED);
51337 return;
51338 }
51339 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51340 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51341); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51341; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51341 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51341); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51341; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51342 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51343 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51344 } else {
51345 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence", "TestJSImplInterface");
51346 aRv.Throw(NS_ERROR_UNEXPECTED);
51347 return;
51348 }
51349 }
51350 }
51351 } else {
51352 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectSequence");
51353 aRv.Throw(NS_ERROR_UNEXPECTED);
51354 return;
51355 }
51356 }
51357 } else {
51358 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectSequence", "sequence");
51359 aRv.Throw(NS_ERROR_UNEXPECTED);
51360 return;
51361 }
51362 aRetVal = std::move(rvalDecl);
51363}
51364
51365void
51366TestJSImplInterfaceJSImpl::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51367{
51368 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51369 if (aRv.Failed()) {
51370 return;
51371 }
51372 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51372); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51372; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51373 BindingCallContext& cx = s.GetCallContext();
51374
51375 JS::Rooted<JS::Value> rval(cx);
51376
51377 JS::Rooted<JS::Value> callable(cx);
51378 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51379 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51380 !InitIds(cx, atomsCache)) ||
51381 !GetCallableProperty(cx, atomsCache->receiveCallbackObjectSequence_id, &callable)) {
51382 aRv.Throw(NS_ERROR_UNEXPECTED);
51383 return;
51384 }
51385 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51386 if (!JS::Call(cx, thisValue, callable,
51387 JS::HandleValueArray::empty(), &rval)) {
51388 aRv.NoteJSContextException(cx);
51389 return;
51390 }
51391 Sequence<RefPtr<TestCallbackInterface>> rvalDecl;
51392 if (rval.isObject()) {
51393 JS::ForOfIterator iter(cx);
51394 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51395 aRv.Throw(NS_ERROR_UNEXPECTED);
51396 return;
51397 }
51398 if (!iter.valueIsIterable()) {
51399 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence");
51400 aRv.Throw(NS_ERROR_UNEXPECTED);
51401 return;
51402 }
51403 Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl;
51404 JS::Rooted<JS::Value> temp(cx);
51405 while (true) {
51406 bool done;
51407 if (!iter.next(&temp, &done)) {
51408 aRv.Throw(NS_ERROR_UNEXPECTED);
51409 return;
51410 }
51411 if (done) {
51412 break;
51413 }
51414 RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51415 if (!slotPtr) {
51416 JS_ReportOutOfMemory(cx);
51417 aRv.Throw(NS_ERROR_UNEXPECTED);
51418 return;
51419 }
51420 RefPtr<TestCallbackInterface>& slot = *slotPtr;
51421 if (temp.isObject()) {
51422 { // scope for tempRoot and tempGlobalRoot if needed
51423 JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject());
51424 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
51425 slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
51426 }
51427 } else {
51428 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCallbackObjectSequence");
51429 aRv.Throw(NS_ERROR_UNEXPECTED);
51430 return;
51431 }
51432 }
51433 } else {
51434 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCallbackObjectSequence", "sequence");
51435 aRv.Throw(NS_ERROR_UNEXPECTED);
51436 return;
51437 }
51438 aRetVal = std::move(rvalDecl);
51439}
51440
51441void
51442TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51443{
51444 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51445 if (aRv.Failed()) {
51446 return;
51447 }
51448 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51448); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51448; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51449 BindingCallContext& cx = s.GetCallContext();
51450
51451 JS::Rooted<JS::Value> rval(cx);
51452
51453 JS::Rooted<JS::Value> callable(cx);
51454 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51455 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51456 !InitIds(cx, atomsCache)) ||
51457 !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectSequence_id, &callable)) {
51458 aRv.Throw(NS_ERROR_UNEXPECTED);
51459 return;
51460 }
51461 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51462 if (!JS::Call(cx, thisValue, callable,
51463 JS::HandleValueArray::empty(), &rval)) {
51464 aRv.NoteJSContextException(cx);
51465 return;
51466 }
51467 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51468 if (rval.isObject()) {
51469 JS::ForOfIterator iter(cx);
51470 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51471 aRv.Throw(NS_ERROR_UNEXPECTED);
51472 return;
51473 }
51474 if (!iter.valueIsIterable()) {
51475 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence");
51476 aRv.Throw(NS_ERROR_UNEXPECTED);
51477 return;
51478 }
51479 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51480 JS::Rooted<JS::Value> temp(cx);
51481 while (true) {
51482 bool done;
51483 if (!iter.next(&temp, &done)) {
51484 aRv.Throw(NS_ERROR_UNEXPECTED);
51485 return;
51486 }
51487 if (done) {
51488 break;
51489 }
51490 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51491 if (!slotPtr) {
51492 JS_ReportOutOfMemory(cx);
51493 aRv.Throw(NS_ERROR_UNEXPECTED);
51494 return;
51495 }
51496 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51497 if (temp.isObject()) {
51498 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51499 {
51500 // Our JSContext should be in the right global to do unwrapping in.
51501 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51502 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51503 // Be careful to not wrap random DOM objects here, even if
51504 // they're wrapped in opaque security wrappers for some reason.
51505 // XXXbz Wish we could check for a JS-implemented object
51506 // that already has a content reflection...
51507 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51508 nsCOMPtr<nsIGlobalObject> contentGlobal;
51509 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51510 if (!callback ||
51511 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51512 aRv.Throw(NS_ERROR_UNEXPECTED);
51513 return;
51514 }
51515 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51516 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51517); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51517; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51517 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51517); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51517; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51518 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51519 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51520 } else {
51521 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "TestJSImplInterface");
51522 aRv.Throw(NS_ERROR_UNEXPECTED);
51523 return;
51524 }
51525 }
51526 }
51527 } else if (temp.isNullOrUndefined()) {
51528 slot = nullptr;
51529 } else {
51530 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectSequence");
51531 aRv.Throw(NS_ERROR_UNEXPECTED);
51532 return;
51533 }
51534 }
51535 } else {
51536 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectSequence", "sequence");
51537 aRv.Throw(NS_ERROR_UNEXPECTED);
51538 return;
51539 }
51540 aRetVal = std::move(rvalDecl);
51541}
51542
51543void
51544TestJSImplInterfaceJSImpl::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51545{
51546 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallbackObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51547 if (aRv.Failed()) {
51548 return;
51549 }
51550 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51550); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51550; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51551 BindingCallContext& cx = s.GetCallContext();
51552
51553 JS::Rooted<JS::Value> rval(cx);
51554
51555 JS::Rooted<JS::Value> callable(cx);
51556 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51557 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51558 !InitIds(cx, atomsCache)) ||
51559 !GetCallableProperty(cx, atomsCache->receiveNullableCallbackObjectSequence_id, &callable)) {
51560 aRv.Throw(NS_ERROR_UNEXPECTED);
51561 return;
51562 }
51563 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51564 if (!JS::Call(cx, thisValue, callable,
51565 JS::HandleValueArray::empty(), &rval)) {
51566 aRv.NoteJSContextException(cx);
51567 return;
51568 }
51569 Sequence<RefPtr<TestCallbackInterface>> rvalDecl;
51570 if (rval.isObject()) {
51571 JS::ForOfIterator iter(cx);
51572 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51573 aRv.Throw(NS_ERROR_UNEXPECTED);
51574 return;
51575 }
51576 if (!iter.valueIsIterable()) {
51577 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence");
51578 aRv.Throw(NS_ERROR_UNEXPECTED);
51579 return;
51580 }
51581 Sequence<RefPtr<TestCallbackInterface>> &arr = rvalDecl;
51582 JS::Rooted<JS::Value> temp(cx);
51583 while (true) {
51584 bool done;
51585 if (!iter.next(&temp, &done)) {
51586 aRv.Throw(NS_ERROR_UNEXPECTED);
51587 return;
51588 }
51589 if (done) {
51590 break;
51591 }
51592 RefPtr<TestCallbackInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51593 if (!slotPtr) {
51594 JS_ReportOutOfMemory(cx);
51595 aRv.Throw(NS_ERROR_UNEXPECTED);
51596 return;
51597 }
51598 RefPtr<TestCallbackInterface>& slot = *slotPtr;
51599 if (temp.isObject()) {
51600 { // scope for tempRoot and tempGlobalRoot if needed
51601 JS::Rooted<JSObject*> tempRoot(cx, &temp.toObject());
51602 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
51603 slot = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
51604 }
51605 } else if (temp.isNullOrUndefined()) {
51606 slot = nullptr;
51607 } else {
51608 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCallbackObjectSequence");
51609 aRv.Throw(NS_ERROR_UNEXPECTED);
51610 return;
51611 }
51612 }
51613 } else {
51614 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCallbackObjectSequence", "sequence");
51615 aRv.Throw(NS_ERROR_UNEXPECTED);
51616 return;
51617 }
51618 aRetVal = std::move(rvalDecl);
51619}
51620
51621void
51622TestJSImplInterfaceJSImpl::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51623{
51624 CallSetup s(this, aRv, "TestJSImplInterface.receiveCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51625 if (aRv.Failed()) {
51626 return;
51627 }
51628 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51628); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51628; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51629 BindingCallContext& cx = s.GetCallContext();
51630
51631 JS::Rooted<JS::Value> rval(cx);
51632
51633 JS::Rooted<JS::Value> callable(cx);
51634 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51635 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51636 !InitIds(cx, atomsCache)) ||
51637 !GetCallableProperty(cx, atomsCache->receiveCastableObjectNullableSequence_id, &callable)) {
51638 aRv.Throw(NS_ERROR_UNEXPECTED);
51639 return;
51640 }
51641 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51642 if (!JS::Call(cx, thisValue, callable,
51643 JS::HandleValueArray::empty(), &rval)) {
51644 aRv.NoteJSContextException(cx);
51645 return;
51646 }
51647 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
51648 if (rval.isObject()) {
51649 JS::ForOfIterator iter(cx);
51650 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51651 aRv.Throw(NS_ERROR_UNEXPECTED);
51652 return;
51653 }
51654 if (!iter.valueIsIterable()) {
51655 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence");
51656 aRv.Throw(NS_ERROR_UNEXPECTED);
51657 return;
51658 }
51659 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
51660 JS::Rooted<JS::Value> temp(cx);
51661 while (true) {
51662 bool done;
51663 if (!iter.next(&temp, &done)) {
51664 aRv.Throw(NS_ERROR_UNEXPECTED);
51665 return;
51666 }
51667 if (done) {
51668 break;
51669 }
51670 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51671 if (!slotPtr) {
51672 JS_ReportOutOfMemory(cx);
51673 aRv.Throw(NS_ERROR_UNEXPECTED);
51674 return;
51675 }
51676 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51677 if (temp.isObject()) {
51678 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51679 {
51680 // Our JSContext should be in the right global to do unwrapping in.
51681 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51682 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51683 // Be careful to not wrap random DOM objects here, even if
51684 // they're wrapped in opaque security wrappers for some reason.
51685 // XXXbz Wish we could check for a JS-implemented object
51686 // that already has a content reflection...
51687 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51688 nsCOMPtr<nsIGlobalObject> contentGlobal;
51689 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51690 if (!callback ||
51691 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51692 aRv.Throw(NS_ERROR_UNEXPECTED);
51693 return;
51694 }
51695 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51696 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51697); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51697; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51697 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51697); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51697; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51698 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51699 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51700 } else {
51701 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "TestJSImplInterface");
51702 aRv.Throw(NS_ERROR_UNEXPECTED);
51703 return;
51704 }
51705 }
51706 }
51707 } else {
51708 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveCastableObjectNullableSequence");
51709 aRv.Throw(NS_ERROR_UNEXPECTED);
51710 return;
51711 }
51712 }
51713 } else if (rval.isNullOrUndefined()) {
51714 rvalDecl.SetNull();
51715 } else {
51716 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveCastableObjectNullableSequence", "sequence");
51717 aRv.Throw(NS_ERROR_UNEXPECTED);
51718 return;
51719 }
51720 if (rvalDecl.IsNull()) {
51721 aRetVal.SetNull();
51722 } else {
51723 aRetVal.SetValue() = std::move(rvalDecl.Value());
51724 }
51725}
51726
51727void
51728TestJSImplInterfaceJSImpl::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51729{
51730 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51731 if (aRv.Failed()) {
51732 return;
51733 }
51734 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51734; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51735 BindingCallContext& cx = s.GetCallContext();
51736
51737 JS::Rooted<JS::Value> rval(cx);
51738
51739 JS::Rooted<JS::Value> callable(cx);
51740 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51741 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51742 !InitIds(cx, atomsCache)) ||
51743 !GetCallableProperty(cx, atomsCache->receiveNullableCastableObjectNullableSequence_id, &callable)) {
51744 aRv.Throw(NS_ERROR_UNEXPECTED);
51745 return;
51746 }
51747 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51748 if (!JS::Call(cx, thisValue, callable,
51749 JS::HandleValueArray::empty(), &rval)) {
51750 aRv.NoteJSContextException(cx);
51751 return;
51752 }
51753 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
51754 if (rval.isObject()) {
51755 JS::ForOfIterator iter(cx);
51756 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51757 aRv.Throw(NS_ERROR_UNEXPECTED);
51758 return;
51759 }
51760 if (!iter.valueIsIterable()) {
51761 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence");
51762 aRv.Throw(NS_ERROR_UNEXPECTED);
51763 return;
51764 }
51765 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
51766 JS::Rooted<JS::Value> temp(cx);
51767 while (true) {
51768 bool done;
51769 if (!iter.next(&temp, &done)) {
51770 aRv.Throw(NS_ERROR_UNEXPECTED);
51771 return;
51772 }
51773 if (done) {
51774 break;
51775 }
51776 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51777 if (!slotPtr) {
51778 JS_ReportOutOfMemory(cx);
51779 aRv.Throw(NS_ERROR_UNEXPECTED);
51780 return;
51781 }
51782 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51783 if (temp.isObject()) {
51784 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51785 {
51786 // Our JSContext should be in the right global to do unwrapping in.
51787 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51788 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51789 // Be careful to not wrap random DOM objects here, even if
51790 // they're wrapped in opaque security wrappers for some reason.
51791 // XXXbz Wish we could check for a JS-implemented object
51792 // that already has a content reflection...
51793 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51794 nsCOMPtr<nsIGlobalObject> contentGlobal;
51795 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51796 if (!callback ||
51797 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51798 aRv.Throw(NS_ERROR_UNEXPECTED);
51799 return;
51800 }
51801 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51802 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51803); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51803; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51803 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51803); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51803; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51804 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51805 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51806 } else {
51807 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "TestJSImplInterface");
51808 aRv.Throw(NS_ERROR_UNEXPECTED);
51809 return;
51810 }
51811 }
51812 }
51813 } else if (temp.isNullOrUndefined()) {
51814 slot = nullptr;
51815 } else {
51816 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence");
51817 aRv.Throw(NS_ERROR_UNEXPECTED);
51818 return;
51819 }
51820 }
51821 } else if (rval.isNullOrUndefined()) {
51822 rvalDecl.SetNull();
51823 } else {
51824 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableCastableObjectNullableSequence", "sequence");
51825 aRv.Throw(NS_ERROR_UNEXPECTED);
51826 return;
51827 }
51828 if (rvalDecl.IsNull()) {
51829 aRetVal.SetNull();
51830 } else {
51831 aRetVal.SetValue() = std::move(rvalDecl.Value());
51832 }
51833}
51834
51835void
51836TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51837{
51838 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51839 if (aRv.Failed()) {
51840 return;
51841 }
51842 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51842); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51842; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51843 BindingCallContext& cx = s.GetCallContext();
51844
51845 JS::Rooted<JS::Value> rval(cx);
51846
51847 JS::Rooted<JS::Value> callable(cx);
51848 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51849 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51850 !InitIds(cx, atomsCache)) ||
51851 !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectSequence_id, &callable)) {
51852 aRv.Throw(NS_ERROR_UNEXPECTED);
51853 return;
51854 }
51855 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51856 if (!JS::Call(cx, thisValue, callable,
51857 JS::HandleValueArray::empty(), &rval)) {
51858 aRv.NoteJSContextException(cx);
51859 return;
51860 }
51861 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51862 if (rval.isObject()) {
51863 JS::ForOfIterator iter(cx);
51864 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51865 aRv.Throw(NS_ERROR_UNEXPECTED);
51866 return;
51867 }
51868 if (!iter.valueIsIterable()) {
51869 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence");
51870 aRv.Throw(NS_ERROR_UNEXPECTED);
51871 return;
51872 }
51873 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51874 JS::Rooted<JS::Value> temp(cx);
51875 while (true) {
51876 bool done;
51877 if (!iter.next(&temp, &done)) {
51878 aRv.Throw(NS_ERROR_UNEXPECTED);
51879 return;
51880 }
51881 if (done) {
51882 break;
51883 }
51884 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51885 if (!slotPtr) {
51886 JS_ReportOutOfMemory(cx);
51887 aRv.Throw(NS_ERROR_UNEXPECTED);
51888 return;
51889 }
51890 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51891 if (temp.isObject()) {
51892 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51893 {
51894 // Our JSContext should be in the right global to do unwrapping in.
51895 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51896 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51897 // Be careful to not wrap random DOM objects here, even if
51898 // they're wrapped in opaque security wrappers for some reason.
51899 // XXXbz Wish we could check for a JS-implemented object
51900 // that already has a content reflection...
51901 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
51902 nsCOMPtr<nsIGlobalObject> contentGlobal;
51903 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
51904 if (!callback ||
51905 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
51906 aRv.Throw(NS_ERROR_UNEXPECTED);
51907 return;
51908 }
51909 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
51910 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51911); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51911; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
51911 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 51911); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 51911; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
51912 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
51913 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
51914 } else {
51915 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "TestJSImplInterface");
51916 aRv.Throw(NS_ERROR_UNEXPECTED);
51917 return;
51918 }
51919 }
51920 }
51921 } else {
51922 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectSequence");
51923 aRv.Throw(NS_ERROR_UNEXPECTED);
51924 return;
51925 }
51926 }
51927 } else {
51928 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectSequence", "sequence");
51929 aRv.Throw(NS_ERROR_UNEXPECTED);
51930 return;
51931 }
51932 aRetVal = std::move(rvalDecl);
51933}
51934
51935void
51936TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
51937{
51938 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
51939 if (aRv.Failed()) {
51940 return;
51941 }
51942 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 51942); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 51942; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
51943 BindingCallContext& cx = s.GetCallContext();
51944
51945 JS::Rooted<JS::Value> rval(cx);
51946
51947 JS::Rooted<JS::Value> callable(cx);
51948 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
51949 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
51950 !InitIds(cx, atomsCache)) ||
51951 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectSequence_id, &callable)) {
51952 aRv.Throw(NS_ERROR_UNEXPECTED);
51953 return;
51954 }
51955 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
51956 if (!JS::Call(cx, thisValue, callable,
51957 JS::HandleValueArray::empty(), &rval)) {
51958 aRv.NoteJSContextException(cx);
51959 return;
51960 }
51961 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> rvalDecl;
51962 if (rval.isObject()) {
51963 JS::ForOfIterator iter(cx);
51964 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
51965 aRv.Throw(NS_ERROR_UNEXPECTED);
51966 return;
51967 }
51968 if (!iter.valueIsIterable()) {
51969 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence");
51970 aRv.Throw(NS_ERROR_UNEXPECTED);
51971 return;
51972 }
51973 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl;
51974 JS::Rooted<JS::Value> temp(cx);
51975 while (true) {
51976 bool done;
51977 if (!iter.next(&temp, &done)) {
51978 aRv.Throw(NS_ERROR_UNEXPECTED);
51979 return;
51980 }
51981 if (done) {
51982 break;
51983 }
51984 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
51985 if (!slotPtr) {
51986 JS_ReportOutOfMemory(cx);
51987 aRv.Throw(NS_ERROR_UNEXPECTED);
51988 return;
51989 }
51990 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
51991 if (temp.isObject()) {
51992 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
51993 {
51994 // Our JSContext should be in the right global to do unwrapping in.
51995 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
51996 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
51997 // Be careful to not wrap random DOM objects here, even if
51998 // they're wrapped in opaque security wrappers for some reason.
51999 // XXXbz Wish we could check for a JS-implemented object
52000 // that already has a content reflection...
52001 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52002 nsCOMPtr<nsIGlobalObject> contentGlobal;
52003 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52004 if (!callback ||
52005 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52006 aRv.Throw(NS_ERROR_UNEXPECTED);
52007 return;
52008 }
52009 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52010 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52011); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52011; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52011 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52011); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52011; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52012 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52013 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52014 } else {
52015 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "TestJSImplInterface");
52016 aRv.Throw(NS_ERROR_UNEXPECTED);
52017 return;
52018 }
52019 }
52020 }
52021 } else if (temp.isNullOrUndefined()) {
52022 slot = nullptr;
52023 } else {
52024 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence");
52025 aRv.Throw(NS_ERROR_UNEXPECTED);
52026 return;
52027 }
52028 }
52029 } else {
52030 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectSequence", "sequence");
52031 aRv.Throw(NS_ERROR_UNEXPECTED);
52032 return;
52033 }
52034 aRetVal = std::move(rvalDecl);
52035}
52036
52037void
52038TestJSImplInterfaceJSImpl::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
52039{
52040 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52041 if (aRv.Failed()) {
52042 return;
52043 }
52044 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52044); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52044; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52045 BindingCallContext& cx = s.GetCallContext();
52046
52047 JS::Rooted<JS::Value> rval(cx);
52048
52049 JS::Rooted<JS::Value> callable(cx);
52050 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52051 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52052 !InitIds(cx, atomsCache)) ||
52053 !GetCallableProperty(cx, atomsCache->receiveWeakCastableObjectNullableSequence_id, &callable)) {
52054 aRv.Throw(NS_ERROR_UNEXPECTED);
52055 return;
52056 }
52057 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52058 if (!JS::Call(cx, thisValue, callable,
52059 JS::HandleValueArray::empty(), &rval)) {
52060 aRv.NoteJSContextException(cx);
52061 return;
52062 }
52063 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
52064 if (rval.isObject()) {
52065 JS::ForOfIterator iter(cx);
52066 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
52067 aRv.Throw(NS_ERROR_UNEXPECTED);
52068 return;
52069 }
52070 if (!iter.valueIsIterable()) {
52071 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence");
52072 aRv.Throw(NS_ERROR_UNEXPECTED);
52073 return;
52074 }
52075 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
52076 JS::Rooted<JS::Value> temp(cx);
52077 while (true) {
52078 bool done;
52079 if (!iter.next(&temp, &done)) {
52080 aRv.Throw(NS_ERROR_UNEXPECTED);
52081 return;
52082 }
52083 if (done) {
52084 break;
52085 }
52086 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52087 if (!slotPtr) {
52088 JS_ReportOutOfMemory(cx);
52089 aRv.Throw(NS_ERROR_UNEXPECTED);
52090 return;
52091 }
52092 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52093 if (temp.isObject()) {
52094 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52095 {
52096 // Our JSContext should be in the right global to do unwrapping in.
52097 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52098 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52099 // Be careful to not wrap random DOM objects here, even if
52100 // they're wrapped in opaque security wrappers for some reason.
52101 // XXXbz Wish we could check for a JS-implemented object
52102 // that already has a content reflection...
52103 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52104 nsCOMPtr<nsIGlobalObject> contentGlobal;
52105 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52106 if (!callback ||
52107 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52108 aRv.Throw(NS_ERROR_UNEXPECTED);
52109 return;
52110 }
52111 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52112 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52113); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52113; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52113 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52113); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52113; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52114 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52115 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52116 } else {
52117 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "TestJSImplInterface");
52118 aRv.Throw(NS_ERROR_UNEXPECTED);
52119 return;
52120 }
52121 }
52122 }
52123 } else {
52124 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence");
52125 aRv.Throw(NS_ERROR_UNEXPECTED);
52126 return;
52127 }
52128 }
52129 } else if (rval.isNullOrUndefined()) {
52130 rvalDecl.SetNull();
52131 } else {
52132 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakCastableObjectNullableSequence", "sequence");
52133 aRv.Throw(NS_ERROR_UNEXPECTED);
52134 return;
52135 }
52136 if (rvalDecl.IsNull()) {
52137 aRetVal.SetNull();
52138 } else {
52139 aRetVal.SetValue() = std::move(rvalDecl.Value());
52140 }
52141}
52142
52143void
52144TestJSImplInterfaceJSImpl::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
52145{
52146 CallSetup s(this, aRv, "TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52147 if (aRv.Failed()) {
52148 return;
52149 }
52150 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52150); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52150; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52151 BindingCallContext& cx = s.GetCallContext();
52152
52153 JS::Rooted<JS::Value> rval(cx);
52154
52155 JS::Rooted<JS::Value> callable(cx);
52156 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52157 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52158 !InitIds(cx, atomsCache)) ||
52159 !GetCallableProperty(cx, atomsCache->receiveWeakNullableCastableObjectNullableSequence_id, &callable)) {
52160 aRv.Throw(NS_ERROR_UNEXPECTED);
52161 return;
52162 }
52163 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52164 if (!JS::Call(cx, thisValue, callable,
52165 JS::HandleValueArray::empty(), &rval)) {
52166 aRv.NoteJSContextException(cx);
52167 return;
52168 }
52169 Nullable<Sequence<RefPtr<mozilla::dom::TestJSImplInterface>>> rvalDecl;
52170 if (rval.isObject()) {
52171 JS::ForOfIterator iter(cx);
52172 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
52173 aRv.Throw(NS_ERROR_UNEXPECTED);
52174 return;
52175 }
52176 if (!iter.valueIsIterable()) {
52177 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence");
52178 aRv.Throw(NS_ERROR_UNEXPECTED);
52179 return;
52180 }
52181 Sequence<RefPtr<mozilla::dom::TestJSImplInterface>> &arr = rvalDecl.SetValue();
52182 JS::Rooted<JS::Value> temp(cx);
52183 while (true) {
52184 bool done;
52185 if (!iter.next(&temp, &done)) {
52186 aRv.Throw(NS_ERROR_UNEXPECTED);
52187 return;
52188 }
52189 if (done) {
52190 break;
52191 }
52192 RefPtr<mozilla::dom::TestJSImplInterface>* slotPtr = arr.AppendElement(mozilla::fallible);
52193 if (!slotPtr) {
52194 JS_ReportOutOfMemory(cx);
52195 aRv.Throw(NS_ERROR_UNEXPECTED);
52196 return;
52197 }
52198 RefPtr<mozilla::dom::TestJSImplInterface>& slot = *slotPtr;
52199 if (temp.isObject()) {
52200 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
52201 {
52202 // Our JSContext should be in the right global to do unwrapping in.
52203 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(&temp, slot, cx);
52204 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
52205 // Be careful to not wrap random DOM objects here, even if
52206 // they're wrapped in opaque security wrappers for some reason.
52207 // XXXbz Wish we could check for a JS-implemented object
52208 // that already has a content reflection...
52209 if (!IsDOMObject(js::UncheckedUnwrap(&temp.toObject()))) {
52210 nsCOMPtr<nsIGlobalObject> contentGlobal;
52211 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
52212 if (!callback ||
52213 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
52214 aRv.Throw(NS_ERROR_UNEXPECTED);
52215 return;
52216 }
52217 JS::Rooted<JSObject*> jsImplSourceObj(cx, &temp.toObject());
52218 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52219); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52219; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
52219 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 52219); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 52219; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
52220 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
52221 slot = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
52222 } else {
52223 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "TestJSImplInterface");
52224 aRv.Throw(NS_ERROR_UNEXPECTED);
52225 return;
52226 }
52227 }
52228 }
52229 } else if (temp.isNullOrUndefined()) {
52230 slot = nullptr;
52231 } else {
52232 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence");
52233 aRv.Throw(NS_ERROR_UNEXPECTED);
52234 return;
52235 }
52236 }
52237 } else if (rval.isNullOrUndefined()) {
52238 rvalDecl.SetNull();
52239 } else {
52240 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveWeakNullableCastableObjectNullableSequence", "sequence");
52241 aRv.Throw(NS_ERROR_UNEXPECTED);
52242 return;
52243 }
52244 if (rvalDecl.IsNull()) {
52245 aRetVal.SetNull();
52246 } else {
52247 aRetVal.SetValue() = std::move(rvalDecl.Value());
52248 }
52249}
52250
52251void
52252TestJSImplInterfaceJSImpl::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52253{
52254 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52255 if (aRv.Failed()) {
52256 return;
52257 }
52258 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52258); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52258; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52259 BindingCallContext& cx = s.GetCallContext();
52260
52261 JS::Rooted<JS::Value> rval(cx);
52262 JS::RootedVector<JS::Value> argv(cx);
52263 if (!argv.resize(1)) {
52264 // That threw an exception on the JSContext, and our CallSetup will do
52265 // the right thing with that.
52266 return;
52267 }
52268 unsigned argc = 1;
52269
52270 do {
52271
52272 uint32_t length = arg.Length();
52273 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52274 if (!returnArray) {
52275 aRv.Throw(NS_ERROR_UNEXPECTED);
52276 return;
52277 }
52278 // Scope for 'tmp'
52279 {
52280 JS::Rooted<JS::Value> tmp(cx);
52281 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52282 // Control block to let us common up the JS_DefineElement calls when there
52283 // are different ways to succeed at wrapping the object.
52284 do {
52285 if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) {
52286 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52286); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 52286; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52287 aRv.Throw(NS_ERROR_UNEXPECTED);
52288 return;
52289 }
52290 break;
52291 } while (false);
52292 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52293 JSPROP_ENUMERATE)) {
52294 aRv.Throw(NS_ERROR_UNEXPECTED);
52295 return;
52296 }
52297 }
52298 }
52299 argv[0].setObject(*returnArray);
52300 break;
52301 } while (false);
52302
52303 JS::Rooted<JS::Value> callable(cx);
52304 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52305 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52306 !InitIds(cx, atomsCache)) ||
52307 !GetCallableProperty(cx, atomsCache->passCastableObjectSequence_id, &callable)) {
52308 aRv.Throw(NS_ERROR_UNEXPECTED);
52309 return;
52310 }
52311 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52312 if (!JS::Call(cx, thisValue, callable,
52313 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52314 aRv.NoteJSContextException(cx);
52315 return;
52316 }
52317}
52318
52319void
52320TestJSImplInterfaceJSImpl::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52321{
52322 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52323 if (aRv.Failed()) {
52324 return;
52325 }
52326 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52326); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52326; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52327 BindingCallContext& cx = s.GetCallContext();
52328
52329 JS::Rooted<JS::Value> rval(cx);
52330 JS::RootedVector<JS::Value> argv(cx);
52331 if (!argv.resize(1)) {
52332 // That threw an exception on the JSContext, and our CallSetup will do
52333 // the right thing with that.
52334 return;
52335 }
52336 unsigned argc = 1;
52337
52338 do {
52339
52340 uint32_t length = arg.Length();
52341 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52342 if (!returnArray) {
52343 aRv.Throw(NS_ERROR_UNEXPECTED);
52344 return;
52345 }
52346 // Scope for 'tmp'
52347 {
52348 JS::Rooted<JS::Value> tmp(cx);
52349 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52350 // Control block to let us common up the JS_DefineElement calls when there
52351 // are different ways to succeed at wrapping the object.
52352 do {
52353 if (!arg[sequenceIdx0]) {
52354 tmp.setNull();
52355 break;
52356 }
52357 if (!GetOrCreateDOMReflector(cx, arg[sequenceIdx0], &tmp)) {
52358 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52358); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 52358; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52359 aRv.Throw(NS_ERROR_UNEXPECTED);
52360 return;
52361 }
52362 break;
52363 } while (false);
52364 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52365 JSPROP_ENUMERATE)) {
52366 aRv.Throw(NS_ERROR_UNEXPECTED);
52367 return;
52368 }
52369 }
52370 }
52371 argv[0].setObject(*returnArray);
52372 break;
52373 } while (false);
52374
52375 JS::Rooted<JS::Value> callable(cx);
52376 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52377 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52378 !InitIds(cx, atomsCache)) ||
52379 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectSequence_id, &callable)) {
52380 aRv.Throw(NS_ERROR_UNEXPECTED);
52381 return;
52382 }
52383 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52384 if (!JS::Call(cx, thisValue, callable,
52385 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52386 aRv.NoteJSContextException(cx);
52387 return;
52388 }
52389}
52390
52391void
52392TestJSImplInterfaceJSImpl::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52393{
52394 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52395 if (aRv.Failed()) {
52396 return;
52397 }
52398 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52398); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52398; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52399 BindingCallContext& cx = s.GetCallContext();
52400
52401 JS::Rooted<JS::Value> rval(cx);
52402 JS::RootedVector<JS::Value> argv(cx);
52403 if (!argv.resize(1)) {
52404 // That threw an exception on the JSContext, and our CallSetup will do
52405 // the right thing with that.
52406 return;
52407 }
52408 unsigned argc = 1;
52409
52410 do {
52411
52412 if (arg.IsNull()) {
52413 argv[0].setNull();
52414 break;
52415 }
52416
52417 uint32_t length = arg.Value().Length();
52418 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52419 if (!returnArray) {
52420 aRv.Throw(NS_ERROR_UNEXPECTED);
52421 return;
52422 }
52423 // Scope for 'tmp'
52424 {
52425 JS::Rooted<JS::Value> tmp(cx);
52426 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52427 // Control block to let us common up the JS_DefineElement calls when there
52428 // are different ways to succeed at wrapping the object.
52429 do {
52430 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
52431 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52431); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 52431; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52432 aRv.Throw(NS_ERROR_UNEXPECTED);
52433 return;
52434 }
52435 break;
52436 } while (false);
52437 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52438 JSPROP_ENUMERATE)) {
52439 aRv.Throw(NS_ERROR_UNEXPECTED);
52440 return;
52441 }
52442 }
52443 }
52444 argv[0].setObject(*returnArray);
52445 break;
52446 } while (false);
52447
52448 JS::Rooted<JS::Value> callable(cx);
52449 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52450 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52451 !InitIds(cx, atomsCache)) ||
52452 !GetCallableProperty(cx, atomsCache->passCastableObjectNullableSequence_id, &callable)) {
52453 aRv.Throw(NS_ERROR_UNEXPECTED);
52454 return;
52455 }
52456 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52457 if (!JS::Call(cx, thisValue, callable,
52458 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52459 aRv.NoteJSContextException(cx);
52460 return;
52461 }
52462}
52463
52464void
52465TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52466{
52467 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52468 if (aRv.Failed()) {
52469 return;
52470 }
52471 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52471); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52471; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52472 BindingCallContext& cx = s.GetCallContext();
52473
52474 JS::Rooted<JS::Value> rval(cx);
52475 JS::RootedVector<JS::Value> argv(cx);
52476 if (!argv.resize(1)) {
52477 // That threw an exception on the JSContext, and our CallSetup will do
52478 // the right thing with that.
52479 return;
52480 }
52481 unsigned argc = 1;
52482
52483 do {
52484
52485 if (arg.IsNull()) {
52486 argv[0].setNull();
52487 break;
52488 }
52489
52490 uint32_t length = arg.Value().Length();
52491 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52492 if (!returnArray) {
52493 aRv.Throw(NS_ERROR_UNEXPECTED);
52494 return;
52495 }
52496 // Scope for 'tmp'
52497 {
52498 JS::Rooted<JS::Value> tmp(cx);
52499 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52500 // Control block to let us common up the JS_DefineElement calls when there
52501 // are different ways to succeed at wrapping the object.
52502 do {
52503 if (!arg.Value()[sequenceIdx0]) {
52504 tmp.setNull();
52505 break;
52506 }
52507 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
52508 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52508); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 52508; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52509 aRv.Throw(NS_ERROR_UNEXPECTED);
52510 return;
52511 }
52512 break;
52513 } while (false);
52514 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52515 JSPROP_ENUMERATE)) {
52516 aRv.Throw(NS_ERROR_UNEXPECTED);
52517 return;
52518 }
52519 }
52520 }
52521 argv[0].setObject(*returnArray);
52522 break;
52523 } while (false);
52524
52525 JS::Rooted<JS::Value> callable(cx);
52526 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52527 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52528 !InitIds(cx, atomsCache)) ||
52529 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableSequence_id, &callable)) {
52530 aRv.Throw(NS_ERROR_UNEXPECTED);
52531 return;
52532 }
52533 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52534 if (!JS::Call(cx, thisValue, callable,
52535 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52536 aRv.NoteJSContextException(cx);
52537 return;
52538 }
52539}
52540
52541void
52542TestJSImplInterfaceJSImpl::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52543{
52544 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52545 if (aRv.Failed()) {
52546 return;
52547 }
52548 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52548); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52548; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52549 BindingCallContext& cx = s.GetCallContext();
52550
52551 JS::Rooted<JS::Value> rval(cx);
52552 JS::RootedVector<JS::Value> argv(cx);
52553 if (!argv.resize(1)) {
52554 // That threw an exception on the JSContext, and our CallSetup will do
52555 // the right thing with that.
52556 return;
52557 }
52558 unsigned argc = 1;
52559
52560 do {
52561 if (arg.WasPassed()) {
52562
52563 uint32_t length = arg.Value().Length();
52564 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52565 if (!returnArray) {
52566 aRv.Throw(NS_ERROR_UNEXPECTED);
52567 return;
52568 }
52569 // Scope for 'tmp'
52570 {
52571 JS::Rooted<JS::Value> tmp(cx);
52572 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52573 // Control block to let us common up the JS_DefineElement calls when there
52574 // are different ways to succeed at wrapping the object.
52575 do {
52576 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52577 break;
52578 } while (false);
52579 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52580 JSPROP_ENUMERATE)) {
52581 aRv.Throw(NS_ERROR_UNEXPECTED);
52582 return;
52583 }
52584 }
52585 }
52586 argv[0].setObject(*returnArray);
52587 break;
52588 } else if (argc == 1) {
52589 // This is our current trailing argument; reduce argc
52590 --argc;
52591 } else {
52592 argv[0].setUndefined();
52593 }
52594 } while (false);
52595
52596 JS::Rooted<JS::Value> callable(cx);
52597 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52598 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52599 !InitIds(cx, atomsCache)) ||
52600 !GetCallableProperty(cx, atomsCache->passOptionalSequence_id, &callable)) {
52601 aRv.Throw(NS_ERROR_UNEXPECTED);
52602 return;
52603 }
52604 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52605 if (!JS::Call(cx, thisValue, callable,
52606 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52607 aRv.NoteJSContextException(cx);
52608 return;
52609 }
52610}
52611
52612void
52613TestJSImplInterfaceJSImpl::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52614{
52615 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52616 if (aRv.Failed()) {
52617 return;
52618 }
52619 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52619); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52619; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52620 BindingCallContext& cx = s.GetCallContext();
52621
52622 JS::Rooted<JS::Value> rval(cx);
52623 JS::RootedVector<JS::Value> argv(cx);
52624 if (!argv.resize(1)) {
52625 // That threw an exception on the JSContext, and our CallSetup will do
52626 // the right thing with that.
52627 return;
52628 }
52629 unsigned argc = 1;
52630
52631 do {
52632
52633 uint32_t length = arg.Length();
52634 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52635 if (!returnArray) {
52636 aRv.Throw(NS_ERROR_UNEXPECTED);
52637 return;
52638 }
52639 // Scope for 'tmp'
52640 {
52641 JS::Rooted<JS::Value> tmp(cx);
52642 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52643 // Control block to let us common up the JS_DefineElement calls when there
52644 // are different ways to succeed at wrapping the object.
52645 do {
52646 tmp.setInt32(int32_t(arg[sequenceIdx0]));
52647 break;
52648 } while (false);
52649 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52650 JSPROP_ENUMERATE)) {
52651 aRv.Throw(NS_ERROR_UNEXPECTED);
52652 return;
52653 }
52654 }
52655 }
52656 argv[0].setObject(*returnArray);
52657 break;
52658 } while (false);
52659
52660 JS::Rooted<JS::Value> callable(cx);
52661 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52662 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52663 !InitIds(cx, atomsCache)) ||
52664 !GetCallableProperty(cx, atomsCache->passOptionalSequenceWithDefaultValue_id, &callable)) {
52665 aRv.Throw(NS_ERROR_UNEXPECTED);
52666 return;
52667 }
52668 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52669 if (!JS::Call(cx, thisValue, callable,
52670 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52671 aRv.NoteJSContextException(cx);
52672 return;
52673 }
52674}
52675
52676void
52677TestJSImplInterfaceJSImpl::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52678{
52679 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52680 if (aRv.Failed()) {
52681 return;
52682 }
52683 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52683); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52683; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52684 BindingCallContext& cx = s.GetCallContext();
52685
52686 JS::Rooted<JS::Value> rval(cx);
52687 JS::RootedVector<JS::Value> argv(cx);
52688 if (!argv.resize(1)) {
52689 // That threw an exception on the JSContext, and our CallSetup will do
52690 // the right thing with that.
52691 return;
52692 }
52693 unsigned argc = 1;
52694
52695 do {
52696 if (arg.WasPassed()) {
52697
52698 if (arg.Value().IsNull()) {
52699 argv[0].setNull();
52700 break;
52701 }
52702
52703 uint32_t length = arg.Value().Value().Length();
52704 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52705 if (!returnArray) {
52706 aRv.Throw(NS_ERROR_UNEXPECTED);
52707 return;
52708 }
52709 // Scope for 'tmp'
52710 {
52711 JS::Rooted<JS::Value> tmp(cx);
52712 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52713 // Control block to let us common up the JS_DefineElement calls when there
52714 // are different ways to succeed at wrapping the object.
52715 do {
52716 tmp.setInt32(int32_t(arg.Value().Value()[sequenceIdx0]));
52717 break;
52718 } while (false);
52719 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52720 JSPROP_ENUMERATE)) {
52721 aRv.Throw(NS_ERROR_UNEXPECTED);
52722 return;
52723 }
52724 }
52725 }
52726 argv[0].setObject(*returnArray);
52727 break;
52728 } else if (argc == 1) {
52729 // This is our current trailing argument; reduce argc
52730 --argc;
52731 } else {
52732 argv[0].setUndefined();
52733 }
52734 } while (false);
52735
52736 JS::Rooted<JS::Value> callable(cx);
52737 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52738 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52739 !InitIds(cx, atomsCache)) ||
52740 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequence_id, &callable)) {
52741 aRv.Throw(NS_ERROR_UNEXPECTED);
52742 return;
52743 }
52744 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52745 if (!JS::Call(cx, thisValue, callable,
52746 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52747 aRv.NoteJSContextException(cx);
52748 return;
52749 }
52750}
52751
52752void
52753TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52754{
52755 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52756 if (aRv.Failed()) {
52757 return;
52758 }
52759 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52759); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52759; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52760 BindingCallContext& cx = s.GetCallContext();
52761
52762 JS::Rooted<JS::Value> rval(cx);
52763 JS::RootedVector<JS::Value> argv(cx);
52764 if (!argv.resize(1)) {
52765 // That threw an exception on the JSContext, and our CallSetup will do
52766 // the right thing with that.
52767 return;
52768 }
52769 unsigned argc = 1;
52770
52771 do {
52772
52773 if (arg.IsNull()) {
52774 argv[0].setNull();
52775 break;
52776 }
52777
52778 uint32_t length = arg.Value().Length();
52779 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52780 if (!returnArray) {
52781 aRv.Throw(NS_ERROR_UNEXPECTED);
52782 return;
52783 }
52784 // Scope for 'tmp'
52785 {
52786 JS::Rooted<JS::Value> tmp(cx);
52787 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52788 // Control block to let us common up the JS_DefineElement calls when there
52789 // are different ways to succeed at wrapping the object.
52790 do {
52791 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52792 break;
52793 } while (false);
52794 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52795 JSPROP_ENUMERATE)) {
52796 aRv.Throw(NS_ERROR_UNEXPECTED);
52797 return;
52798 }
52799 }
52800 }
52801 argv[0].setObject(*returnArray);
52802 break;
52803 } while (false);
52804
52805 JS::Rooted<JS::Value> callable(cx);
52806 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52807 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52808 !InitIds(cx, atomsCache)) ||
52809 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue_id, &callable)) {
52810 aRv.Throw(NS_ERROR_UNEXPECTED);
52811 return;
52812 }
52813 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52814 if (!JS::Call(cx, thisValue, callable,
52815 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52816 aRv.NoteJSContextException(cx);
52817 return;
52818 }
52819}
52820
52821void
52822TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52823{
52824 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52825 if (aRv.Failed()) {
52826 return;
52827 }
52828 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52828); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52828; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52829 BindingCallContext& cx = s.GetCallContext();
52830
52831 JS::Rooted<JS::Value> rval(cx);
52832 JS::RootedVector<JS::Value> argv(cx);
52833 if (!argv.resize(1)) {
52834 // That threw an exception on the JSContext, and our CallSetup will do
52835 // the right thing with that.
52836 return;
52837 }
52838 unsigned argc = 1;
52839
52840 do {
52841
52842 if (arg.IsNull()) {
52843 argv[0].setNull();
52844 break;
52845 }
52846
52847 uint32_t length = arg.Value().Length();
52848 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52849 if (!returnArray) {
52850 aRv.Throw(NS_ERROR_UNEXPECTED);
52851 return;
52852 }
52853 // Scope for 'tmp'
52854 {
52855 JS::Rooted<JS::Value> tmp(cx);
52856 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52857 // Control block to let us common up the JS_DefineElement calls when there
52858 // are different ways to succeed at wrapping the object.
52859 do {
52860 tmp.setInt32(int32_t(arg.Value()[sequenceIdx0]));
52861 break;
52862 } while (false);
52863 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52864 JSPROP_ENUMERATE)) {
52865 aRv.Throw(NS_ERROR_UNEXPECTED);
52866 return;
52867 }
52868 }
52869 }
52870 argv[0].setObject(*returnArray);
52871 break;
52872 } while (false);
52873
52874 JS::Rooted<JS::Value> callable(cx);
52875 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52876 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52877 !InitIds(cx, atomsCache)) ||
52878 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceWithDefaultValue2_id, &callable)) {
52879 aRv.Throw(NS_ERROR_UNEXPECTED);
52880 return;
52881 }
52882 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52883 if (!JS::Call(cx, thisValue, callable,
52884 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52885 aRv.NoteJSContextException(cx);
52886 return;
52887 }
52888}
52889
52890void
52891TestJSImplInterfaceJSImpl::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52892{
52893 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52894 if (aRv.Failed()) {
52895 return;
52896 }
52897 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52897); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52897; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52898 BindingCallContext& cx = s.GetCallContext();
52899
52900 JS::Rooted<JS::Value> rval(cx);
52901 JS::RootedVector<JS::Value> argv(cx);
52902 if (!argv.resize(1)) {
52903 // That threw an exception on the JSContext, and our CallSetup will do
52904 // the right thing with that.
52905 return;
52906 }
52907 unsigned argc = 1;
52908
52909 do {
52910 if (arg.WasPassed()) {
52911
52912 uint32_t length = arg.Value().Length();
52913 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52914 if (!returnArray) {
52915 aRv.Throw(NS_ERROR_UNEXPECTED);
52916 return;
52917 }
52918 // Scope for 'tmp'
52919 {
52920 JS::Rooted<JS::Value> tmp(cx);
52921 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52922 // Control block to let us common up the JS_DefineElement calls when there
52923 // are different ways to succeed at wrapping the object.
52924 do {
52925 if (!GetOrCreateDOMReflector(cx, arg.Value()[sequenceIdx0], &tmp)) {
52926 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 52926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 52926; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52927 aRv.Throw(NS_ERROR_UNEXPECTED);
52928 return;
52929 }
52930 break;
52931 } while (false);
52932 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
52933 JSPROP_ENUMERATE)) {
52934 aRv.Throw(NS_ERROR_UNEXPECTED);
52935 return;
52936 }
52937 }
52938 }
52939 argv[0].setObject(*returnArray);
52940 break;
52941 } else if (argc == 1) {
52942 // This is our current trailing argument; reduce argc
52943 --argc;
52944 } else {
52945 argv[0].setUndefined();
52946 }
52947 } while (false);
52948
52949 JS::Rooted<JS::Value> callable(cx);
52950 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
52951 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
52952 !InitIds(cx, atomsCache)) ||
52953 !GetCallableProperty(cx, atomsCache->passOptionalObjectSequence_id, &callable)) {
52954 aRv.Throw(NS_ERROR_UNEXPECTED);
52955 return;
52956 }
52957 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
52958 if (!JS::Call(cx, thisValue, callable,
52959 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
52960 aRv.NoteJSContextException(cx);
52961 return;
52962 }
52963}
52964
52965void
52966TestJSImplInterfaceJSImpl::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
52967{
52968 CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
52969 if (aRv.Failed()) {
52970 return;
52971 }
52972 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 52972); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 52972; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
52973 BindingCallContext& cx = s.GetCallContext();
52974
52975 JS::Rooted<JS::Value> rval(cx);
52976 JS::RootedVector<JS::Value> argv(cx);
52977 if (!argv.resize(1)) {
52978 // That threw an exception on the JSContext, and our CallSetup will do
52979 // the right thing with that.
52980 return;
52981 }
52982 unsigned argc = 1;
52983
52984 do {
52985
52986 uint32_t length = arg.Length();
52987 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
52988 if (!returnArray) {
52989 aRv.Throw(NS_ERROR_UNEXPECTED);
52990 return;
52991 }
52992 // Scope for 'tmp'
52993 {
52994 JS::Rooted<JS::Value> tmp(cx);
52995 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
52996 // Control block to let us common up the JS_DefineElement calls when there
52997 // are different ways to succeed at wrapping the object.
52998 do {
52999 if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) {
53000 aRv.Throw(NS_ERROR_UNEXPECTED);
53001 return;
53002 }
53003 break;
53004 } while (false);
53005 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53006 JSPROP_ENUMERATE)) {
53007 aRv.Throw(NS_ERROR_UNEXPECTED);
53008 return;
53009 }
53010 }
53011 }
53012 argv[0].setObject(*returnArray);
53013 break;
53014 } while (false);
53015
53016 JS::Rooted<JS::Value> callable(cx);
53017 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53018 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53019 !InitIds(cx, atomsCache)) ||
53020 !GetCallableProperty(cx, atomsCache->passExternalInterfaceSequence_id, &callable)) {
53021 aRv.Throw(NS_ERROR_UNEXPECTED);
53022 return;
53023 }
53024 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53025 if (!JS::Call(cx, thisValue, callable,
53026 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53027 aRv.NoteJSContextException(cx);
53028 return;
53029 }
53030}
53031
53032void
53033TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53034{
53035 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53036 if (aRv.Failed()) {
53037 return;
53038 }
53039 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53039); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53039; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53040 BindingCallContext& cx = s.GetCallContext();
53041
53042 JS::Rooted<JS::Value> rval(cx);
53043 JS::RootedVector<JS::Value> argv(cx);
53044 if (!argv.resize(1)) {
53045 // That threw an exception on the JSContext, and our CallSetup will do
53046 // the right thing with that.
53047 return;
53048 }
53049 unsigned argc = 1;
53050
53051 do {
53052
53053 uint32_t length = arg.Length();
53054 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53055 if (!returnArray) {
53056 aRv.Throw(NS_ERROR_UNEXPECTED);
53057 return;
53058 }
53059 // Scope for 'tmp'
53060 {
53061 JS::Rooted<JS::Value> tmp(cx);
53062 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53063 // Control block to let us common up the JS_DefineElement calls when there
53064 // are different ways to succeed at wrapping the object.
53065 do {
53066 if (!arg[sequenceIdx0]) {
53067 tmp.setNull();
53068 break;
53069 }
53070 if (!WrapObject(cx, arg[sequenceIdx0], &tmp)) {
53071 aRv.Throw(NS_ERROR_UNEXPECTED);
53072 return;
53073 }
53074 break;
53075 } while (false);
53076 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53077 JSPROP_ENUMERATE)) {
53078 aRv.Throw(NS_ERROR_UNEXPECTED);
53079 return;
53080 }
53081 }
53082 }
53083 argv[0].setObject(*returnArray);
53084 break;
53085 } while (false);
53086
53087 JS::Rooted<JS::Value> callable(cx);
53088 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53089 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53090 !InitIds(cx, atomsCache)) ||
53091 !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceSequence_id, &callable)) {
53092 aRv.Throw(NS_ERROR_UNEXPECTED);
53093 return;
53094 }
53095 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53096 if (!JS::Call(cx, thisValue, callable,
53097 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53098 aRv.NoteJSContextException(cx);
53099 return;
53100 }
53101}
53102
53103void
53104TestJSImplInterfaceJSImpl::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53105{
53106 CallSetup s(this, aRv, "TestJSImplInterface.receiveStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53107 if (aRv.Failed()) {
53108 return;
53109 }
53110 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53111 BindingCallContext& cx = s.GetCallContext();
53112
53113 JS::Rooted<JS::Value> rval(cx);
53114
53115 JS::Rooted<JS::Value> callable(cx);
53116 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53117 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53118 !InitIds(cx, atomsCache)) ||
53119 !GetCallableProperty(cx, atomsCache->receiveStringSequence_id, &callable)) {
53120 aRv.Throw(NS_ERROR_UNEXPECTED);
53121 return;
53122 }
53123 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53124 if (!JS::Call(cx, thisValue, callable,
53125 JS::HandleValueArray::empty(), &rval)) {
53126 aRv.NoteJSContextException(cx);
53127 return;
53128 }
53129 Sequence<nsString> rvalDecl;
53130 if (rval.isObject()) {
53131 JS::ForOfIterator iter(cx);
53132 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53133 aRv.Throw(NS_ERROR_UNEXPECTED);
53134 return;
53135 }
53136 if (!iter.valueIsIterable()) {
53137 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence");
53138 aRv.Throw(NS_ERROR_UNEXPECTED);
53139 return;
53140 }
53141 Sequence<nsString> &arr = rvalDecl;
53142 JS::Rooted<JS::Value> temp(cx);
53143 while (true) {
53144 bool done;
53145 if (!iter.next(&temp, &done)) {
53146 aRv.Throw(NS_ERROR_UNEXPECTED);
53147 return;
53148 }
53149 if (done) {
53150 break;
53151 }
53152 nsString* slotPtr = arr.AppendElement(mozilla::fallible);
53153 if (!slotPtr) {
53154 JS_ReportOutOfMemory(cx);
53155 aRv.Throw(NS_ERROR_UNEXPECTED);
53156 return;
53157 }
53158 nsString& slot = *slotPtr;
53159 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
53160 aRv.Throw(NS_ERROR_UNEXPECTED);
53161 return;
53162 }
53163 }
53164 } else {
53165 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveStringSequence", "sequence");
53166 aRv.Throw(NS_ERROR_UNEXPECTED);
53167 return;
53168 }
53169 aRetVal = std::move(rvalDecl);
53170}
53171
53172void
53173TestJSImplInterfaceJSImpl::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53174{
53175 CallSetup s(this, aRv, "TestJSImplInterface.receiveByteStringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53176 if (aRv.Failed()) {
53177 return;
53178 }
53179 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53179); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53179; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53180 BindingCallContext& cx = s.GetCallContext();
53181
53182 JS::Rooted<JS::Value> rval(cx);
53183
53184 JS::Rooted<JS::Value> callable(cx);
53185 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53186 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53187 !InitIds(cx, atomsCache)) ||
53188 !GetCallableProperty(cx, atomsCache->receiveByteStringSequence_id, &callable)) {
53189 aRv.Throw(NS_ERROR_UNEXPECTED);
53190 return;
53191 }
53192 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53193 if (!JS::Call(cx, thisValue, callable,
53194 JS::HandleValueArray::empty(), &rval)) {
53195 aRv.NoteJSContextException(cx);
53196 return;
53197 }
53198 Sequence<nsCString> rvalDecl;
53199 if (rval.isObject()) {
53200 JS::ForOfIterator iter(cx);
53201 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53202 aRv.Throw(NS_ERROR_UNEXPECTED);
53203 return;
53204 }
53205 if (!iter.valueIsIterable()) {
53206 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence");
53207 aRv.Throw(NS_ERROR_UNEXPECTED);
53208 return;
53209 }
53210 Sequence<nsCString> &arr = rvalDecl;
53211 JS::Rooted<JS::Value> temp(cx);
53212 while (true) {
53213 bool done;
53214 if (!iter.next(&temp, &done)) {
53215 aRv.Throw(NS_ERROR_UNEXPECTED);
53216 return;
53217 }
53218 if (done) {
53219 break;
53220 }
53221 nsCString* slotPtr = arr.AppendElement(mozilla::fallible);
53222 if (!slotPtr) {
53223 JS_ReportOutOfMemory(cx);
53224 aRv.Throw(NS_ERROR_UNEXPECTED);
53225 return;
53226 }
53227 nsCString& slot = *slotPtr;
53228 if (!ConvertJSValueToByteString(cx, temp, false, "element of return value of TestJSImplInterface.receiveByteStringSequence", slot)) {
53229 aRv.Throw(NS_ERROR_UNEXPECTED);
53230 return;
53231 }
53232 }
53233 } else {
53234 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveByteStringSequence", "sequence");
53235 aRv.Throw(NS_ERROR_UNEXPECTED);
53236 return;
53237 }
53238 aRetVal = std::move(rvalDecl);
53239}
53240
53241void
53242TestJSImplInterfaceJSImpl::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53243{
53244 CallSetup s(this, aRv, "TestJSImplInterface.receiveUTF8StringSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53245 if (aRv.Failed()) {
53246 return;
53247 }
53248 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53248); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53248; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53249 BindingCallContext& cx = s.GetCallContext();
53250
53251 JS::Rooted<JS::Value> rval(cx);
53252
53253 JS::Rooted<JS::Value> callable(cx);
53254 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53255 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53256 !InitIds(cx, atomsCache)) ||
53257 !GetCallableProperty(cx, atomsCache->receiveUTF8StringSequence_id, &callable)) {
53258 aRv.Throw(NS_ERROR_UNEXPECTED);
53259 return;
53260 }
53261 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53262 if (!JS::Call(cx, thisValue, callable,
53263 JS::HandleValueArray::empty(), &rval)) {
53264 aRv.NoteJSContextException(cx);
53265 return;
53266 }
53267 Sequence<nsCString> rvalDecl;
53268 if (rval.isObject()) {
53269 JS::ForOfIterator iter(cx);
53270 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53271 aRv.Throw(NS_ERROR_UNEXPECTED);
53272 return;
53273 }
53274 if (!iter.valueIsIterable()) {
53275 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence");
53276 aRv.Throw(NS_ERROR_UNEXPECTED);
53277 return;
53278 }
53279 Sequence<nsCString> &arr = rvalDecl;
53280 JS::Rooted<JS::Value> temp(cx);
53281 while (true) {
53282 bool done;
53283 if (!iter.next(&temp, &done)) {
53284 aRv.Throw(NS_ERROR_UNEXPECTED);
53285 return;
53286 }
53287 if (done) {
53288 break;
53289 }
53290 nsCString* slotPtr = arr.AppendElement(mozilla::fallible);
53291 if (!slotPtr) {
53292 JS_ReportOutOfMemory(cx);
53293 aRv.Throw(NS_ERROR_UNEXPECTED);
53294 return;
53295 }
53296 nsCString& slot = *slotPtr;
53297 if (!ConvertJSValueToString(cx, temp, eStringify, eStringify, slot)) {
53298 aRv.Throw(NS_ERROR_UNEXPECTED);
53299 return;
53300 }
53301 }
53302 } else {
53303 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveUTF8StringSequence", "sequence");
53304 aRv.Throw(NS_ERROR_UNEXPECTED);
53305 return;
53306 }
53307 aRetVal = std::move(rvalDecl);
53308}
53309
53310void
53311TestJSImplInterfaceJSImpl::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53312{
53313 CallSetup s(this, aRv, "TestJSImplInterface.receiveAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53314 if (aRv.Failed()) {
53315 return;
53316 }
53317 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53317); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53317; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53318 BindingCallContext& cx = s.GetCallContext();
53319
53320 JS::Rooted<JS::Value> rval(cx);
53321
53322 JS::Rooted<JS::Value> callable(cx);
53323 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53324 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53325 !InitIds(cx, atomsCache)) ||
53326 !GetCallableProperty(cx, atomsCache->receiveAnySequence_id, &callable)) {
53327 aRv.Throw(NS_ERROR_UNEXPECTED);
53328 return;
53329 }
53330 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53331 if (!JS::Call(cx, thisValue, callable,
53332 JS::HandleValueArray::empty(), &rval)) {
53333 aRv.NoteJSContextException(cx);
53334 return;
53335 }
53336 Sequence<JS::Value> rvalDecl;
53337 SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl);
53338 if (rval.isObject()) {
53339 JS::ForOfIterator iter(cx);
53340 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53341 aRv.Throw(NS_ERROR_UNEXPECTED);
53342 return;
53343 }
53344 if (!iter.valueIsIterable()) {
53345 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence");
53346 aRv.Throw(NS_ERROR_UNEXPECTED);
53347 return;
53348 }
53349 Sequence<JS::Value> &arr = rvalDecl;
53350 JS::Rooted<JS::Value> temp(cx);
53351 while (true) {
53352 bool done;
53353 if (!iter.next(&temp, &done)) {
53354 aRv.Throw(NS_ERROR_UNEXPECTED);
53355 return;
53356 }
53357 if (done) {
53358 break;
53359 }
53360 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
53361 if (!slotPtr) {
53362 JS_ReportOutOfMemory(cx);
53363 aRv.Throw(NS_ERROR_UNEXPECTED);
53364 return;
53365 }
53366 JS::Value& slot = *slotPtr;
53367#ifdef __clang__1
53368#pragma clang diagnostic push
53369#pragma clang diagnostic ignored "-Wunreachable-code"
53370#pragma clang diagnostic ignored "-Wunreachable-code-return"
53371#endif // __clang__
53372 if ((false) && !CallerSubsumes(temp)) {
53373 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveAnySequence");
53374 aRv.Throw(NS_ERROR_UNEXPECTED);
53375 return;
53376 }
53377#ifdef __clang__1
53378#pragma clang diagnostic pop
53379#endif // __clang__
53380 slot = temp;
53381 }
53382 } else {
53383 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveAnySequence", "sequence");
53384 aRv.Throw(NS_ERROR_UNEXPECTED);
53385 return;
53386 }
53387 aRetVal = std::move(rvalDecl);
53388}
53389
53390void
53391TestJSImplInterfaceJSImpl::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53392{
53393 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableAnySequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53394 if (aRv.Failed()) {
53395 return;
53396 }
53397 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53397); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53397; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53398 BindingCallContext& cx = s.GetCallContext();
53399
53400 JS::Rooted<JS::Value> rval(cx);
53401
53402 JS::Rooted<JS::Value> callable(cx);
53403 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53404 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53405 !InitIds(cx, atomsCache)) ||
53406 !GetCallableProperty(cx, atomsCache->receiveNullableAnySequence_id, &callable)) {
53407 aRv.Throw(NS_ERROR_UNEXPECTED);
53408 return;
53409 }
53410 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53411 if (!JS::Call(cx, thisValue, callable,
53412 JS::HandleValueArray::empty(), &rval)) {
53413 aRv.NoteJSContextException(cx);
53414 return;
53415 }
53416 Nullable<Sequence<JS::Value>> rvalDecl;
53417 SequenceRooter<JS::Value> rvalHolder(cx, &rvalDecl.SetValue());
53418 if (rval.isObject()) {
53419 JS::ForOfIterator iter(cx);
53420 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53421 aRv.Throw(NS_ERROR_UNEXPECTED);
53422 return;
53423 }
53424 if (!iter.valueIsIterable()) {
53425 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence");
53426 aRv.Throw(NS_ERROR_UNEXPECTED);
53427 return;
53428 }
53429 Sequence<JS::Value> &arr = rvalDecl.SetValue();
53430 JS::Rooted<JS::Value> temp(cx);
53431 while (true) {
53432 bool done;
53433 if (!iter.next(&temp, &done)) {
53434 aRv.Throw(NS_ERROR_UNEXPECTED);
53435 return;
53436 }
53437 if (done) {
53438 break;
53439 }
53440 JS::Value* slotPtr = arr.AppendElement(mozilla::fallible);
53441 if (!slotPtr) {
53442 JS_ReportOutOfMemory(cx);
53443 aRv.Throw(NS_ERROR_UNEXPECTED);
53444 return;
53445 }
53446 JS::Value& slot = *slotPtr;
53447#ifdef __clang__1
53448#pragma clang diagnostic push
53449#pragma clang diagnostic ignored "-Wunreachable-code"
53450#pragma clang diagnostic ignored "-Wunreachable-code-return"
53451#endif // __clang__
53452 if ((false) && !CallerSubsumes(temp)) {
53453 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableAnySequence");
53454 aRv.Throw(NS_ERROR_UNEXPECTED);
53455 return;
53456 }
53457#ifdef __clang__1
53458#pragma clang diagnostic pop
53459#endif // __clang__
53460 slot = temp;
53461 }
53462 } else if (rval.isNullOrUndefined()) {
53463 rvalDecl.SetNull();
53464 } else {
53465 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableAnySequence", "sequence");
53466 aRv.Throw(NS_ERROR_UNEXPECTED);
53467 return;
53468 }
53469 if (rvalDecl.IsNull()) {
53470 aRetVal.SetNull();
53471 } else {
53472 aRetVal.SetValue() = std::move(rvalDecl.Value());
53473 }
53474}
53475
53476void
53477TestJSImplInterfaceJSImpl::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53478{
53479 CallSetup s(this, aRv, "TestJSImplInterface.receiveObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53480 if (aRv.Failed()) {
53481 return;
53482 }
53483 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53483); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53483; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53484 BindingCallContext& cx = s.GetCallContext();
53485
53486 JS::Rooted<JS::Value> rval(cx);
53487
53488 JS::Rooted<JS::Value> callable(cx);
53489 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53490 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53491 !InitIds(cx, atomsCache)) ||
53492 !GetCallableProperty(cx, atomsCache->receiveObjectSequence_id, &callable)) {
53493 aRv.Throw(NS_ERROR_UNEXPECTED);
53494 return;
53495 }
53496 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53497 if (!JS::Call(cx, thisValue, callable,
53498 JS::HandleValueArray::empty(), &rval)) {
53499 aRv.NoteJSContextException(cx);
53500 return;
53501 }
53502 Sequence<JSObject*> rvalDecl;
53503 SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl);
53504 if (rval.isObject()) {
53505 JS::ForOfIterator iter(cx);
53506 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53507 aRv.Throw(NS_ERROR_UNEXPECTED);
53508 return;
53509 }
53510 if (!iter.valueIsIterable()) {
53511 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence");
53512 aRv.Throw(NS_ERROR_UNEXPECTED);
53513 return;
53514 }
53515 Sequence<JSObject*> &arr = rvalDecl;
53516 JS::Rooted<JS::Value> temp(cx);
53517 while (true) {
53518 bool done;
53519 if (!iter.next(&temp, &done)) {
53520 aRv.Throw(NS_ERROR_UNEXPECTED);
53521 return;
53522 }
53523 if (done) {
53524 break;
53525 }
53526 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
53527 if (!slotPtr) {
53528 JS_ReportOutOfMemory(cx);
53529 aRv.Throw(NS_ERROR_UNEXPECTED);
53530 return;
53531 }
53532 JSObject*& slot = *slotPtr;
53533 if (temp.isObject()) {
53534#ifdef __clang__1
53535#pragma clang diagnostic push
53536#pragma clang diagnostic ignored "-Wunreachable-code"
53537#pragma clang diagnostic ignored "-Wunreachable-code-return"
53538#endif // __clang__
53539 if ((false) && !CallerSubsumes(temp)) {
53540 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveObjectSequence");
53541 aRv.Throw(NS_ERROR_UNEXPECTED);
53542 return;
53543 }
53544#ifdef __clang__1
53545#pragma clang diagnostic pop
53546#endif // __clang__
53547 slot = &temp.toObject();
53548 } else {
53549 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveObjectSequence");
53550 aRv.Throw(NS_ERROR_UNEXPECTED);
53551 return;
53552 }
53553 }
53554 } else {
53555 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveObjectSequence", "sequence");
53556 aRv.Throw(NS_ERROR_UNEXPECTED);
53557 return;
53558 }
53559 aRetVal = std::move(rvalDecl);
53560}
53561
53562void
53563TestJSImplInterfaceJSImpl::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
53564{
53565 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObjectSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53566 if (aRv.Failed()) {
53567 return;
53568 }
53569 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53569; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53570 BindingCallContext& cx = s.GetCallContext();
53571
53572 JS::Rooted<JS::Value> rval(cx);
53573
53574 JS::Rooted<JS::Value> callable(cx);
53575 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53576 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53577 !InitIds(cx, atomsCache)) ||
53578 !GetCallableProperty(cx, atomsCache->receiveNullableObjectSequence_id, &callable)) {
53579 aRv.Throw(NS_ERROR_UNEXPECTED);
53580 return;
53581 }
53582 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53583 if (!JS::Call(cx, thisValue, callable,
53584 JS::HandleValueArray::empty(), &rval)) {
53585 aRv.NoteJSContextException(cx);
53586 return;
53587 }
53588 Sequence<JSObject*> rvalDecl;
53589 SequenceRooter<JSObject*> rvalHolder(cx, &rvalDecl);
53590 if (rval.isObject()) {
53591 JS::ForOfIterator iter(cx);
53592 if (!iter.init(rval, JS::ForOfIterator::AllowNonIterable)) {
53593 aRv.Throw(NS_ERROR_UNEXPECTED);
53594 return;
53595 }
53596 if (!iter.valueIsIterable()) {
53597 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence");
53598 aRv.Throw(NS_ERROR_UNEXPECTED);
53599 return;
53600 }
53601 Sequence<JSObject*> &arr = rvalDecl;
53602 JS::Rooted<JS::Value> temp(cx);
53603 while (true) {
53604 bool done;
53605 if (!iter.next(&temp, &done)) {
53606 aRv.Throw(NS_ERROR_UNEXPECTED);
53607 return;
53608 }
53609 if (done) {
53610 break;
53611 }
53612 JSObject** slotPtr = arr.AppendElement(nullptr, mozilla::fallible);
53613 if (!slotPtr) {
53614 JS_ReportOutOfMemory(cx);
53615 aRv.Throw(NS_ERROR_UNEXPECTED);
53616 return;
53617 }
53618 JSObject*& slot = *slotPtr;
53619 if (temp.isObject()) {
53620#ifdef __clang__1
53621#pragma clang diagnostic push
53622#pragma clang diagnostic ignored "-Wunreachable-code"
53623#pragma clang diagnostic ignored "-Wunreachable-code-return"
53624#endif // __clang__
53625 if ((false) && !CallerSubsumes(temp)) {
53626 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("element of return value of TestJSImplInterface.receiveNullableObjectSequence");
53627 aRv.Throw(NS_ERROR_UNEXPECTED);
53628 return;
53629 }
53630#ifdef __clang__1
53631#pragma clang diagnostic pop
53632#endif // __clang__
53633 slot = &temp.toObject();
53634 } else if (temp.isNullOrUndefined()) {
53635 slot = nullptr;
53636 } else {
53637 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Element of return value of TestJSImplInterface.receiveNullableObjectSequence");
53638 aRv.Throw(NS_ERROR_UNEXPECTED);
53639 return;
53640 }
53641 }
53642 } else {
53643 cx.ThrowErrorMessage<MSG_CONVERSION_ERROR>("Return value of TestJSImplInterface.receiveNullableObjectSequence", "sequence");
53644 aRv.Throw(NS_ERROR_UNEXPECTED);
53645 return;
53646 }
53647 aRetVal = std::move(rvalDecl);
53648}
53649
53650void
53651TestJSImplInterfaceJSImpl::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53652{
53653 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53654 if (aRv.Failed()) {
53655 return;
53656 }
53657 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53657); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53657; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53658 BindingCallContext& cx = s.GetCallContext();
53659
53660 JS::Rooted<JS::Value> rval(cx);
53661 JS::RootedVector<JS::Value> argv(cx);
53662 if (!argv.resize(1)) {
53663 // That threw an exception on the JSContext, and our CallSetup will do
53664 // the right thing with that.
53665 return;
53666 }
53667 unsigned argc = 1;
53668
53669 do {
53670
53671 uint32_t length = arg.Length();
53672 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53673 if (!returnArray) {
53674 aRv.Throw(NS_ERROR_UNEXPECTED);
53675 return;
53676 }
53677 // Scope for 'tmp'
53678 {
53679 JS::Rooted<JS::Value> tmp(cx);
53680 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53681 // Control block to let us common up the JS_DefineElement calls when there
53682 // are different ways to succeed at wrapping the object.
53683 do {
53684
53685 uint32_t length = arg[sequenceIdx0].Length();
53686 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53687 if (!returnArray) {
53688 aRv.Throw(NS_ERROR_UNEXPECTED);
53689 return;
53690 }
53691 // Scope for 'tmp'
53692 {
53693 JS::Rooted<JS::Value> tmp(cx);
53694 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
53695 // Control block to let us common up the JS_DefineElement calls when there
53696 // are different ways to succeed at wrapping the object.
53697 do {
53698 tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1]));
53699 break;
53700 } while (false);
53701 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
53702 JSPROP_ENUMERATE)) {
53703 aRv.Throw(NS_ERROR_UNEXPECTED);
53704 return;
53705 }
53706 }
53707 }
53708 tmp.setObject(*returnArray);
53709 break;
53710 } while (false);
53711 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53712 JSPROP_ENUMERATE)) {
53713 aRv.Throw(NS_ERROR_UNEXPECTED);
53714 return;
53715 }
53716 }
53717 }
53718 argv[0].setObject(*returnArray);
53719 break;
53720 } while (false);
53721
53722 JS::Rooted<JS::Value> callable(cx);
53723 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53724 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53725 !InitIds(cx, atomsCache)) ||
53726 !GetCallableProperty(cx, atomsCache->passSequenceOfSequences_id, &callable)) {
53727 aRv.Throw(NS_ERROR_UNEXPECTED);
53728 return;
53729 }
53730 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53731 if (!JS::Call(cx, thisValue, callable,
53732 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53733 aRv.NoteJSContextException(cx);
53734 return;
53735 }
53736}
53737
53738void
53739TestJSImplInterfaceJSImpl::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53740{
53741 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequencesOfSequences", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53742 if (aRv.Failed()) {
53743 return;
53744 }
53745 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53745); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53745; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53746 BindingCallContext& cx = s.GetCallContext();
53747
53748 JS::Rooted<JS::Value> rval(cx);
53749 JS::RootedVector<JS::Value> argv(cx);
53750 if (!argv.resize(1)) {
53751 // That threw an exception on the JSContext, and our CallSetup will do
53752 // the right thing with that.
53753 return;
53754 }
53755 unsigned argc = 1;
53756
53757 do {
53758
53759 uint32_t length = arg.Length();
53760 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53761 if (!returnArray) {
53762 aRv.Throw(NS_ERROR_UNEXPECTED);
53763 return;
53764 }
53765 // Scope for 'tmp'
53766 {
53767 JS::Rooted<JS::Value> tmp(cx);
53768 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
53769 // Control block to let us common up the JS_DefineElement calls when there
53770 // are different ways to succeed at wrapping the object.
53771 do {
53772
53773 uint32_t length = arg[sequenceIdx0].Length();
53774 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53775 if (!returnArray) {
53776 aRv.Throw(NS_ERROR_UNEXPECTED);
53777 return;
53778 }
53779 // Scope for 'tmp'
53780 {
53781 JS::Rooted<JS::Value> tmp(cx);
53782 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
53783 // Control block to let us common up the JS_DefineElement calls when there
53784 // are different ways to succeed at wrapping the object.
53785 do {
53786
53787 uint32_t length = arg[sequenceIdx0][sequenceIdx1].Length();
53788 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
53789 if (!returnArray) {
53790 aRv.Throw(NS_ERROR_UNEXPECTED);
53791 return;
53792 }
53793 // Scope for 'tmp'
53794 {
53795 JS::Rooted<JS::Value> tmp(cx);
53796 for (uint32_t sequenceIdx2 = 0; sequenceIdx2 < length; ++sequenceIdx2) {
53797 // Control block to let us common up the JS_DefineElement calls when there
53798 // are different ways to succeed at wrapping the object.
53799 do {
53800 tmp.setInt32(int32_t(arg[sequenceIdx0][sequenceIdx1][sequenceIdx2]));
53801 break;
53802 } while (false);
53803 if (!JS_DefineElement(cx, returnArray, sequenceIdx2, tmp,
53804 JSPROP_ENUMERATE)) {
53805 aRv.Throw(NS_ERROR_UNEXPECTED);
53806 return;
53807 }
53808 }
53809 }
53810 tmp.setObject(*returnArray);
53811 break;
53812 } while (false);
53813 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
53814 JSPROP_ENUMERATE)) {
53815 aRv.Throw(NS_ERROR_UNEXPECTED);
53816 return;
53817 }
53818 }
53819 }
53820 tmp.setObject(*returnArray);
53821 break;
53822 } while (false);
53823 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
53824 JSPROP_ENUMERATE)) {
53825 aRv.Throw(NS_ERROR_UNEXPECTED);
53826 return;
53827 }
53828 }
53829 }
53830 argv[0].setObject(*returnArray);
53831 break;
53832 } while (false);
53833
53834 JS::Rooted<JS::Value> callable(cx);
53835 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53836 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53837 !InitIds(cx, atomsCache)) ||
53838 !GetCallableProperty(cx, atomsCache->passSequenceOfSequencesOfSequences_id, &callable)) {
53839 aRv.Throw(NS_ERROR_UNEXPECTED);
53840 return;
53841 }
53842 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53843 if (!JS::Call(cx, thisValue, callable,
53844 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53845 aRv.NoteJSContextException(cx);
53846 return;
53847 }
53848}
53849
53850void
53851TestJSImplInterfaceJSImpl::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53852{
53853 CallSetup s(this, aRv, "TestJSImplInterface.passRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53854 if (aRv.Failed()) {
53855 return;
53856 }
53857 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53857); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53857; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53858 BindingCallContext& cx = s.GetCallContext();
53859
53860 JS::Rooted<JS::Value> rval(cx);
53861 JS::RootedVector<JS::Value> argv(cx);
53862 if (!argv.resize(1)) {
53863 // That threw an exception on the JSContext, and our CallSetup will do
53864 // the right thing with that.
53865 return;
53866 }
53867 unsigned argc = 1;
53868
53869 do {
53870
53871 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
53872 if (!returnObj) {
53873 aRv.Throw(NS_ERROR_UNEXPECTED);
53874 return;
53875 }
53876 // Scope for 'tmp'
53877 {
53878 JS::Rooted<JS::Value> tmp(cx);
53879 for (auto& entry : arg.Entries()) {
53880 auto& recordValue0 = entry.mValue;
53881 // Control block to let us common up the JS_DefineUCProperty calls when there
53882 // are different ways to succeed at wrapping the value.
53883 do {
53884 tmp.setInt32(int32_t(recordValue0));
53885 break;
53886 } while (false);
53887 if (!JS_DefineUCProperty(cx, returnObj,
53888 entry.mKey.BeginReading(),
53889 entry.mKey.Length(), tmp,
53890 JSPROP_ENUMERATE)) {
53891 aRv.Throw(NS_ERROR_UNEXPECTED);
53892 return;
53893 }
53894 }
53895 }
53896 argv[0].setObject(*returnObj);
53897 break;
53898 } while (false);
53899
53900 JS::Rooted<JS::Value> callable(cx);
53901 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53902 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53903 !InitIds(cx, atomsCache)) ||
53904 !GetCallableProperty(cx, atomsCache->passRecord_id, &callable)) {
53905 aRv.Throw(NS_ERROR_UNEXPECTED);
53906 return;
53907 }
53908 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53909 if (!JS::Call(cx, thisValue, callable,
53910 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53911 aRv.NoteJSContextException(cx);
53912 return;
53913 }
53914}
53915
53916void
53917TestJSImplInterfaceJSImpl::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53918{
53919 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53920 if (aRv.Failed()) {
53921 return;
53922 }
53923 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53923); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53923; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53924 BindingCallContext& cx = s.GetCallContext();
53925
53926 JS::Rooted<JS::Value> rval(cx);
53927 JS::RootedVector<JS::Value> argv(cx);
53928 if (!argv.resize(1)) {
53929 // That threw an exception on the JSContext, and our CallSetup will do
53930 // the right thing with that.
53931 return;
53932 }
53933 unsigned argc = 1;
53934
53935 do {
53936
53937 if (arg.IsNull()) {
53938 argv[0].setNull();
53939 break;
53940 }
53941
53942 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
53943 if (!returnObj) {
53944 aRv.Throw(NS_ERROR_UNEXPECTED);
53945 return;
53946 }
53947 // Scope for 'tmp'
53948 {
53949 JS::Rooted<JS::Value> tmp(cx);
53950 for (auto& entry : arg.Value().Entries()) {
53951 auto& recordValue0 = entry.mValue;
53952 // Control block to let us common up the JS_DefineUCProperty calls when there
53953 // are different ways to succeed at wrapping the value.
53954 do {
53955 tmp.setInt32(int32_t(recordValue0));
53956 break;
53957 } while (false);
53958 if (!JS_DefineUCProperty(cx, returnObj,
53959 entry.mKey.BeginReading(),
53960 entry.mKey.Length(), tmp,
53961 JSPROP_ENUMERATE)) {
53962 aRv.Throw(NS_ERROR_UNEXPECTED);
53963 return;
53964 }
53965 }
53966 }
53967 argv[0].setObject(*returnObj);
53968 break;
53969 } while (false);
53970
53971 JS::Rooted<JS::Value> callable(cx);
53972 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
53973 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
53974 !InitIds(cx, atomsCache)) ||
53975 !GetCallableProperty(cx, atomsCache->passNullableRecord_id, &callable)) {
53976 aRv.Throw(NS_ERROR_UNEXPECTED);
53977 return;
53978 }
53979 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
53980 if (!JS::Call(cx, thisValue, callable,
53981 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
53982 aRv.NoteJSContextException(cx);
53983 return;
53984 }
53985}
53986
53987void
53988TestJSImplInterfaceJSImpl::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
53989{
53990 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
53991 if (aRv.Failed()) {
53992 return;
53993 }
53994 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 53994); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 53994; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
53995 BindingCallContext& cx = s.GetCallContext();
53996
53997 JS::Rooted<JS::Value> rval(cx);
53998 JS::RootedVector<JS::Value> argv(cx);
53999 if (!argv.resize(1)) {
54000 // That threw an exception on the JSContext, and our CallSetup will do
54001 // the right thing with that.
54002 return;
54003 }
54004 unsigned argc = 1;
54005
54006 do {
54007
54008 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54009 if (!returnObj) {
54010 aRv.Throw(NS_ERROR_UNEXPECTED);
54011 return;
54012 }
54013 // Scope for 'tmp'
54014 {
54015 JS::Rooted<JS::Value> tmp(cx);
54016 for (auto& entry : arg.Entries()) {
54017 auto& recordValue0 = entry.mValue;
54018 // Control block to let us common up the JS_DefineUCProperty calls when there
54019 // are different ways to succeed at wrapping the value.
54020 do {
54021 if (recordValue0.IsNull()) {
54022 tmp.setNull();
54023 break;
54024 }
54025 tmp.setInt32(int32_t(recordValue0.Value()));
54026 break;
54027 } while (false);
54028 if (!JS_DefineUCProperty(cx, returnObj,
54029 entry.mKey.BeginReading(),
54030 entry.mKey.Length(), tmp,
54031 JSPROP_ENUMERATE)) {
54032 aRv.Throw(NS_ERROR_UNEXPECTED);
54033 return;
54034 }
54035 }
54036 }
54037 argv[0].setObject(*returnObj);
54038 break;
54039 } while (false);
54040
54041 JS::Rooted<JS::Value> callable(cx);
54042 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54043 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54044 !InitIds(cx, atomsCache)) ||
54045 !GetCallableProperty(cx, atomsCache->passRecordOfNullableInts_id, &callable)) {
54046 aRv.Throw(NS_ERROR_UNEXPECTED);
54047 return;
54048 }
54049 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54050 if (!JS::Call(cx, thisValue, callable,
54051 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54052 aRv.NoteJSContextException(cx);
54053 return;
54054 }
54055}
54056
54057void
54058TestJSImplInterfaceJSImpl::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54059{
54060 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54061 if (aRv.Failed()) {
54062 return;
54063 }
54064 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54064; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54065 BindingCallContext& cx = s.GetCallContext();
54066
54067 JS::Rooted<JS::Value> rval(cx);
54068 JS::RootedVector<JS::Value> argv(cx);
54069 if (!argv.resize(1)) {
54070 // That threw an exception on the JSContext, and our CallSetup will do
54071 // the right thing with that.
54072 return;
54073 }
54074 unsigned argc = 1;
54075
54076 do {
54077 if (arg.WasPassed()) {
54078
54079 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54080 if (!returnObj) {
54081 aRv.Throw(NS_ERROR_UNEXPECTED);
54082 return;
54083 }
54084 // Scope for 'tmp'
54085 {
54086 JS::Rooted<JS::Value> tmp(cx);
54087 for (auto& entry : arg.Value().Entries()) {
54088 auto& recordValue0 = entry.mValue;
54089 // Control block to let us common up the JS_DefineUCProperty calls when there
54090 // are different ways to succeed at wrapping the value.
54091 do {
54092 if (recordValue0.IsNull()) {
54093 tmp.setNull();
54094 break;
54095 }
54096 tmp.setInt32(int32_t(recordValue0.Value()));
54097 break;
54098 } while (false);
54099 if (!JS_DefineUCProperty(cx, returnObj,
54100 entry.mKey.BeginReading(),
54101 entry.mKey.Length(), tmp,
54102 JSPROP_ENUMERATE)) {
54103 aRv.Throw(NS_ERROR_UNEXPECTED);
54104 return;
54105 }
54106 }
54107 }
54108 argv[0].setObject(*returnObj);
54109 break;
54110 } else if (argc == 1) {
54111 // This is our current trailing argument; reduce argc
54112 --argc;
54113 } else {
54114 argv[0].setUndefined();
54115 }
54116 } while (false);
54117
54118 JS::Rooted<JS::Value> callable(cx);
54119 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54120 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54121 !InitIds(cx, atomsCache)) ||
54122 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfNullableInts_id, &callable)) {
54123 aRv.Throw(NS_ERROR_UNEXPECTED);
54124 return;
54125 }
54126 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54127 if (!JS::Call(cx, thisValue, callable,
54128 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54129 aRv.NoteJSContextException(cx);
54130 return;
54131 }
54132}
54133
54134void
54135TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54136{
54137 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54138 if (aRv.Failed()) {
54139 return;
54140 }
54141 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54141; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54142 BindingCallContext& cx = s.GetCallContext();
54143
54144 JS::Rooted<JS::Value> rval(cx);
54145 JS::RootedVector<JS::Value> argv(cx);
54146 if (!argv.resize(1)) {
54147 // That threw an exception on the JSContext, and our CallSetup will do
54148 // the right thing with that.
54149 return;
54150 }
54151 unsigned argc = 1;
54152
54153 do {
54154 if (arg.WasPassed()) {
54155
54156 if (arg.Value().IsNull()) {
54157 argv[0].setNull();
54158 break;
54159 }
54160
54161 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54162 if (!returnObj) {
54163 aRv.Throw(NS_ERROR_UNEXPECTED);
54164 return;
54165 }
54166 // Scope for 'tmp'
54167 {
54168 JS::Rooted<JS::Value> tmp(cx);
54169 for (auto& entry : arg.Value().Value().Entries()) {
54170 auto& recordValue0 = entry.mValue;
54171 // Control block to let us common up the JS_DefineUCProperty calls when there
54172 // are different ways to succeed at wrapping the value.
54173 do {
54174 if (recordValue0.IsNull()) {
54175 tmp.setNull();
54176 break;
54177 }
54178 tmp.setInt32(int32_t(recordValue0.Value()));
54179 break;
54180 } while (false);
54181 if (!JS_DefineUCProperty(cx, returnObj,
54182 entry.mKey.BeginReading(),
54183 entry.mKey.Length(), tmp,
54184 JSPROP_ENUMERATE)) {
54185 aRv.Throw(NS_ERROR_UNEXPECTED);
54186 return;
54187 }
54188 }
54189 }
54190 argv[0].setObject(*returnObj);
54191 break;
54192 } else if (argc == 1) {
54193 // This is our current trailing argument; reduce argc
54194 --argc;
54195 } else {
54196 argv[0].setUndefined();
54197 }
54198 } while (false);
54199
54200 JS::Rooted<JS::Value> callable(cx);
54201 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54202 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54203 !InitIds(cx, atomsCache)) ||
54204 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableInts_id, &callable)) {
54205 aRv.Throw(NS_ERROR_UNEXPECTED);
54206 return;
54207 }
54208 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54209 if (!JS::Call(cx, thisValue, callable,
54210 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54211 aRv.NoteJSContextException(cx);
54212 return;
54213 }
54214}
54215
54216void
54217TestJSImplInterfaceJSImpl::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54218{
54219 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54220 if (aRv.Failed()) {
54221 return;
54222 }
54223 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54223); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54223; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54224 BindingCallContext& cx = s.GetCallContext();
54225
54226 JS::Rooted<JS::Value> rval(cx);
54227 JS::RootedVector<JS::Value> argv(cx);
54228 if (!argv.resize(1)) {
54229 // That threw an exception on the JSContext, and our CallSetup will do
54230 // the right thing with that.
54231 return;
54232 }
54233 unsigned argc = 1;
54234
54235 do {
54236
54237 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54238 if (!returnObj) {
54239 aRv.Throw(NS_ERROR_UNEXPECTED);
54240 return;
54241 }
54242 // Scope for 'tmp'
54243 {
54244 JS::Rooted<JS::Value> tmp(cx);
54245 for (auto& entry : arg.Entries()) {
54246 auto& recordValue0 = entry.mValue;
54247 // Control block to let us common up the JS_DefineUCProperty calls when there
54248 // are different ways to succeed at wrapping the value.
54249 do {
54250 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54251 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54251); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 54251; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54252 aRv.Throw(NS_ERROR_UNEXPECTED);
54253 return;
54254 }
54255 break;
54256 } while (false);
54257 if (!JS_DefineUCProperty(cx, returnObj,
54258 entry.mKey.BeginReading(),
54259 entry.mKey.Length(), tmp,
54260 JSPROP_ENUMERATE)) {
54261 aRv.Throw(NS_ERROR_UNEXPECTED);
54262 return;
54263 }
54264 }
54265 }
54266 argv[0].setObject(*returnObj);
54267 break;
54268 } while (false);
54269
54270 JS::Rooted<JS::Value> callable(cx);
54271 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54272 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54273 !InitIds(cx, atomsCache)) ||
54274 !GetCallableProperty(cx, atomsCache->passCastableObjectRecord_id, &callable)) {
54275 aRv.Throw(NS_ERROR_UNEXPECTED);
54276 return;
54277 }
54278 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54279 if (!JS::Call(cx, thisValue, callable,
54280 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54281 aRv.NoteJSContextException(cx);
54282 return;
54283 }
54284}
54285
54286void
54287TestJSImplInterfaceJSImpl::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54288{
54289 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54290 if (aRv.Failed()) {
54291 return;
54292 }
54293 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54293); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54293; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54294 BindingCallContext& cx = s.GetCallContext();
54295
54296 JS::Rooted<JS::Value> rval(cx);
54297 JS::RootedVector<JS::Value> argv(cx);
54298 if (!argv.resize(1)) {
54299 // That threw an exception on the JSContext, and our CallSetup will do
54300 // the right thing with that.
54301 return;
54302 }
54303 unsigned argc = 1;
54304
54305 do {
54306
54307 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54308 if (!returnObj) {
54309 aRv.Throw(NS_ERROR_UNEXPECTED);
54310 return;
54311 }
54312 // Scope for 'tmp'
54313 {
54314 JS::Rooted<JS::Value> tmp(cx);
54315 for (auto& entry : arg.Entries()) {
54316 auto& recordValue0 = entry.mValue;
54317 // Control block to let us common up the JS_DefineUCProperty calls when there
54318 // are different ways to succeed at wrapping the value.
54319 do {
54320 if (!recordValue0) {
54321 tmp.setNull();
54322 break;
54323 }
54324 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54325 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54325); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 54325; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54326 aRv.Throw(NS_ERROR_UNEXPECTED);
54327 return;
54328 }
54329 break;
54330 } while (false);
54331 if (!JS_DefineUCProperty(cx, returnObj,
54332 entry.mKey.BeginReading(),
54333 entry.mKey.Length(), tmp,
54334 JSPROP_ENUMERATE)) {
54335 aRv.Throw(NS_ERROR_UNEXPECTED);
54336 return;
54337 }
54338 }
54339 }
54340 argv[0].setObject(*returnObj);
54341 break;
54342 } while (false);
54343
54344 JS::Rooted<JS::Value> callable(cx);
54345 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54346 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54347 !InitIds(cx, atomsCache)) ||
54348 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectRecord_id, &callable)) {
54349 aRv.Throw(NS_ERROR_UNEXPECTED);
54350 return;
54351 }
54352 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54353 if (!JS::Call(cx, thisValue, callable,
54354 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54355 aRv.NoteJSContextException(cx);
54356 return;
54357 }
54358}
54359
54360void
54361TestJSImplInterfaceJSImpl::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54362{
54363 CallSetup s(this, aRv, "TestJSImplInterface.passCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54364 if (aRv.Failed()) {
54365 return;
54366 }
54367 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54367; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54368 BindingCallContext& cx = s.GetCallContext();
54369
54370 JS::Rooted<JS::Value> rval(cx);
54371 JS::RootedVector<JS::Value> argv(cx);
54372 if (!argv.resize(1)) {
54373 // That threw an exception on the JSContext, and our CallSetup will do
54374 // the right thing with that.
54375 return;
54376 }
54377 unsigned argc = 1;
54378
54379 do {
54380
54381 if (arg.IsNull()) {
54382 argv[0].setNull();
54383 break;
54384 }
54385
54386 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54387 if (!returnObj) {
54388 aRv.Throw(NS_ERROR_UNEXPECTED);
54389 return;
54390 }
54391 // Scope for 'tmp'
54392 {
54393 JS::Rooted<JS::Value> tmp(cx);
54394 for (auto& entry : arg.Value().Entries()) {
54395 auto& recordValue0 = entry.mValue;
54396 // Control block to let us common up the JS_DefineUCProperty calls when there
54397 // are different ways to succeed at wrapping the value.
54398 do {
54399 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54400 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54400); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 54400; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54401 aRv.Throw(NS_ERROR_UNEXPECTED);
54402 return;
54403 }
54404 break;
54405 } while (false);
54406 if (!JS_DefineUCProperty(cx, returnObj,
54407 entry.mKey.BeginReading(),
54408 entry.mKey.Length(), tmp,
54409 JSPROP_ENUMERATE)) {
54410 aRv.Throw(NS_ERROR_UNEXPECTED);
54411 return;
54412 }
54413 }
54414 }
54415 argv[0].setObject(*returnObj);
54416 break;
54417 } while (false);
54418
54419 JS::Rooted<JS::Value> callable(cx);
54420 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54421 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54422 !InitIds(cx, atomsCache)) ||
54423 !GetCallableProperty(cx, atomsCache->passCastableObjectNullableRecord_id, &callable)) {
54424 aRv.Throw(NS_ERROR_UNEXPECTED);
54425 return;
54426 }
54427 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54428 if (!JS::Call(cx, thisValue, callable,
54429 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54430 aRv.NoteJSContextException(cx);
54431 return;
54432 }
54433}
54434
54435void
54436TestJSImplInterfaceJSImpl::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54437{
54438 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCastableObjectNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54439 if (aRv.Failed()) {
54440 return;
54441 }
54442 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54442); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54442; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54443 BindingCallContext& cx = s.GetCallContext();
54444
54445 JS::Rooted<JS::Value> rval(cx);
54446 JS::RootedVector<JS::Value> argv(cx);
54447 if (!argv.resize(1)) {
54448 // That threw an exception on the JSContext, and our CallSetup will do
54449 // the right thing with that.
54450 return;
54451 }
54452 unsigned argc = 1;
54453
54454 do {
54455
54456 if (arg.IsNull()) {
54457 argv[0].setNull();
54458 break;
54459 }
54460
54461 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54462 if (!returnObj) {
54463 aRv.Throw(NS_ERROR_UNEXPECTED);
54464 return;
54465 }
54466 // Scope for 'tmp'
54467 {
54468 JS::Rooted<JS::Value> tmp(cx);
54469 for (auto& entry : arg.Value().Entries()) {
54470 auto& recordValue0 = entry.mValue;
54471 // Control block to let us common up the JS_DefineUCProperty calls when there
54472 // are different ways to succeed at wrapping the value.
54473 do {
54474 if (!recordValue0) {
54475 tmp.setNull();
54476 break;
54477 }
54478 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54479 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54479); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 54479; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54480 aRv.Throw(NS_ERROR_UNEXPECTED);
54481 return;
54482 }
54483 break;
54484 } while (false);
54485 if (!JS_DefineUCProperty(cx, returnObj,
54486 entry.mKey.BeginReading(),
54487 entry.mKey.Length(), tmp,
54488 JSPROP_ENUMERATE)) {
54489 aRv.Throw(NS_ERROR_UNEXPECTED);
54490 return;
54491 }
54492 }
54493 }
54494 argv[0].setObject(*returnObj);
54495 break;
54496 } while (false);
54497
54498 JS::Rooted<JS::Value> callable(cx);
54499 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54500 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54501 !InitIds(cx, atomsCache)) ||
54502 !GetCallableProperty(cx, atomsCache->passNullableCastableObjectNullableRecord_id, &callable)) {
54503 aRv.Throw(NS_ERROR_UNEXPECTED);
54504 return;
54505 }
54506 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54507 if (!JS::Call(cx, thisValue, callable,
54508 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54509 aRv.NoteJSContextException(cx);
54510 return;
54511 }
54512}
54513
54514void
54515TestJSImplInterfaceJSImpl::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54516{
54517 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54518 if (aRv.Failed()) {
54519 return;
54520 }
54521 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54521); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54521; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54522 BindingCallContext& cx = s.GetCallContext();
54523
54524 JS::Rooted<JS::Value> rval(cx);
54525 JS::RootedVector<JS::Value> argv(cx);
54526 if (!argv.resize(1)) {
54527 // That threw an exception on the JSContext, and our CallSetup will do
54528 // the right thing with that.
54529 return;
54530 }
54531 unsigned argc = 1;
54532
54533 do {
54534 if (arg.WasPassed()) {
54535
54536 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54537 if (!returnObj) {
54538 aRv.Throw(NS_ERROR_UNEXPECTED);
54539 return;
54540 }
54541 // Scope for 'tmp'
54542 {
54543 JS::Rooted<JS::Value> tmp(cx);
54544 for (auto& entry : arg.Value().Entries()) {
54545 auto& recordValue0 = entry.mValue;
54546 // Control block to let us common up the JS_DefineUCProperty calls when there
54547 // are different ways to succeed at wrapping the value.
54548 do {
54549 tmp.setInt32(int32_t(recordValue0));
54550 break;
54551 } while (false);
54552 if (!JS_DefineUCProperty(cx, returnObj,
54553 entry.mKey.BeginReading(),
54554 entry.mKey.Length(), tmp,
54555 JSPROP_ENUMERATE)) {
54556 aRv.Throw(NS_ERROR_UNEXPECTED);
54557 return;
54558 }
54559 }
54560 }
54561 argv[0].setObject(*returnObj);
54562 break;
54563 } else if (argc == 1) {
54564 // This is our current trailing argument; reduce argc
54565 --argc;
54566 } else {
54567 argv[0].setUndefined();
54568 }
54569 } while (false);
54570
54571 JS::Rooted<JS::Value> callable(cx);
54572 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54573 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54574 !InitIds(cx, atomsCache)) ||
54575 !GetCallableProperty(cx, atomsCache->passOptionalRecord_id, &callable)) {
54576 aRv.Throw(NS_ERROR_UNEXPECTED);
54577 return;
54578 }
54579 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54580 if (!JS::Call(cx, thisValue, callable,
54581 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54582 aRv.NoteJSContextException(cx);
54583 return;
54584 }
54585}
54586
54587void
54588TestJSImplInterfaceJSImpl::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54589{
54590 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54591 if (aRv.Failed()) {
54592 return;
54593 }
54594 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54594); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54594; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54595 BindingCallContext& cx = s.GetCallContext();
54596
54597 JS::Rooted<JS::Value> rval(cx);
54598 JS::RootedVector<JS::Value> argv(cx);
54599 if (!argv.resize(1)) {
54600 // That threw an exception on the JSContext, and our CallSetup will do
54601 // the right thing with that.
54602 return;
54603 }
54604 unsigned argc = 1;
54605
54606 do {
54607 if (arg.WasPassed()) {
54608
54609 if (arg.Value().IsNull()) {
54610 argv[0].setNull();
54611 break;
54612 }
54613
54614 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54615 if (!returnObj) {
54616 aRv.Throw(NS_ERROR_UNEXPECTED);
54617 return;
54618 }
54619 // Scope for 'tmp'
54620 {
54621 JS::Rooted<JS::Value> tmp(cx);
54622 for (auto& entry : arg.Value().Value().Entries()) {
54623 auto& recordValue0 = entry.mValue;
54624 // Control block to let us common up the JS_DefineUCProperty calls when there
54625 // are different ways to succeed at wrapping the value.
54626 do {
54627 tmp.setInt32(int32_t(recordValue0));
54628 break;
54629 } while (false);
54630 if (!JS_DefineUCProperty(cx, returnObj,
54631 entry.mKey.BeginReading(),
54632 entry.mKey.Length(), tmp,
54633 JSPROP_ENUMERATE)) {
54634 aRv.Throw(NS_ERROR_UNEXPECTED);
54635 return;
54636 }
54637 }
54638 }
54639 argv[0].setObject(*returnObj);
54640 break;
54641 } else if (argc == 1) {
54642 // This is our current trailing argument; reduce argc
54643 --argc;
54644 } else {
54645 argv[0].setUndefined();
54646 }
54647 } while (false);
54648
54649 JS::Rooted<JS::Value> callable(cx);
54650 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54651 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54652 !InitIds(cx, atomsCache)) ||
54653 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecord_id, &callable)) {
54654 aRv.Throw(NS_ERROR_UNEXPECTED);
54655 return;
54656 }
54657 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54658 if (!JS::Call(cx, thisValue, callable,
54659 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54660 aRv.NoteJSContextException(cx);
54661 return;
54662 }
54663}
54664
54665void
54666TestJSImplInterfaceJSImpl::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54667{
54668 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54669 if (aRv.Failed()) {
54670 return;
54671 }
54672 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54672; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54673 BindingCallContext& cx = s.GetCallContext();
54674
54675 JS::Rooted<JS::Value> rval(cx);
54676 JS::RootedVector<JS::Value> argv(cx);
54677 if (!argv.resize(1)) {
54678 // That threw an exception on the JSContext, and our CallSetup will do
54679 // the right thing with that.
54680 return;
54681 }
54682 unsigned argc = 1;
54683
54684 do {
54685
54686 if (arg.IsNull()) {
54687 argv[0].setNull();
54688 break;
54689 }
54690
54691 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54692 if (!returnObj) {
54693 aRv.Throw(NS_ERROR_UNEXPECTED);
54694 return;
54695 }
54696 // Scope for 'tmp'
54697 {
54698 JS::Rooted<JS::Value> tmp(cx);
54699 for (auto& entry : arg.Value().Entries()) {
54700 auto& recordValue0 = entry.mValue;
54701 // Control block to let us common up the JS_DefineUCProperty calls when there
54702 // are different ways to succeed at wrapping the value.
54703 do {
54704 tmp.setInt32(int32_t(recordValue0));
54705 break;
54706 } while (false);
54707 if (!JS_DefineUCProperty(cx, returnObj,
54708 entry.mKey.BeginReading(),
54709 entry.mKey.Length(), tmp,
54710 JSPROP_ENUMERATE)) {
54711 aRv.Throw(NS_ERROR_UNEXPECTED);
54712 return;
54713 }
54714 }
54715 }
54716 argv[0].setObject(*returnObj);
54717 break;
54718 } while (false);
54719
54720 JS::Rooted<JS::Value> callable(cx);
54721 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54722 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54723 !InitIds(cx, atomsCache)) ||
54724 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordWithDefaultValue_id, &callable)) {
54725 aRv.Throw(NS_ERROR_UNEXPECTED);
54726 return;
54727 }
54728 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54729 if (!JS::Call(cx, thisValue, callable,
54730 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54731 aRv.NoteJSContextException(cx);
54732 return;
54733 }
54734}
54735
54736void
54737TestJSImplInterfaceJSImpl::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54738{
54739 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObjectRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54740 if (aRv.Failed()) {
54741 return;
54742 }
54743 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54743); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54743; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54744 BindingCallContext& cx = s.GetCallContext();
54745
54746 JS::Rooted<JS::Value> rval(cx);
54747 JS::RootedVector<JS::Value> argv(cx);
54748 if (!argv.resize(1)) {
54749 // That threw an exception on the JSContext, and our CallSetup will do
54750 // the right thing with that.
54751 return;
54752 }
54753 unsigned argc = 1;
54754
54755 do {
54756 if (arg.WasPassed()) {
54757
54758 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54759 if (!returnObj) {
54760 aRv.Throw(NS_ERROR_UNEXPECTED);
54761 return;
54762 }
54763 // Scope for 'tmp'
54764 {
54765 JS::Rooted<JS::Value> tmp(cx);
54766 for (auto& entry : arg.Value().Entries()) {
54767 auto& recordValue0 = entry.mValue;
54768 // Control block to let us common up the JS_DefineUCProperty calls when there
54769 // are different ways to succeed at wrapping the value.
54770 do {
54771 if (!GetOrCreateDOMReflector(cx, recordValue0, &tmp)) {
54772 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 54772); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 54772; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54773 aRv.Throw(NS_ERROR_UNEXPECTED);
54774 return;
54775 }
54776 break;
54777 } while (false);
54778 if (!JS_DefineUCProperty(cx, returnObj,
54779 entry.mKey.BeginReading(),
54780 entry.mKey.Length(), tmp,
54781 JSPROP_ENUMERATE)) {
54782 aRv.Throw(NS_ERROR_UNEXPECTED);
54783 return;
54784 }
54785 }
54786 }
54787 argv[0].setObject(*returnObj);
54788 break;
54789 } else if (argc == 1) {
54790 // This is our current trailing argument; reduce argc
54791 --argc;
54792 } else {
54793 argv[0].setUndefined();
54794 }
54795 } while (false);
54796
54797 JS::Rooted<JS::Value> callable(cx);
54798 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54799 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54800 !InitIds(cx, atomsCache)) ||
54801 !GetCallableProperty(cx, atomsCache->passOptionalObjectRecord_id, &callable)) {
54802 aRv.Throw(NS_ERROR_UNEXPECTED);
54803 return;
54804 }
54805 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54806 if (!JS::Call(cx, thisValue, callable,
54807 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54808 aRv.NoteJSContextException(cx);
54809 return;
54810 }
54811}
54812
54813void
54814TestJSImplInterfaceJSImpl::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54815{
54816 CallSetup s(this, aRv, "TestJSImplInterface.passExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54817 if (aRv.Failed()) {
54818 return;
54819 }
54820 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54820); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54820; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54821 BindingCallContext& cx = s.GetCallContext();
54822
54823 JS::Rooted<JS::Value> rval(cx);
54824 JS::RootedVector<JS::Value> argv(cx);
54825 if (!argv.resize(1)) {
54826 // That threw an exception on the JSContext, and our CallSetup will do
54827 // the right thing with that.
54828 return;
54829 }
54830 unsigned argc = 1;
54831
54832 do {
54833
54834 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54835 if (!returnObj) {
54836 aRv.Throw(NS_ERROR_UNEXPECTED);
54837 return;
54838 }
54839 // Scope for 'tmp'
54840 {
54841 JS::Rooted<JS::Value> tmp(cx);
54842 for (auto& entry : arg.Entries()) {
54843 auto& recordValue0 = entry.mValue;
54844 // Control block to let us common up the JS_DefineUCProperty calls when there
54845 // are different ways to succeed at wrapping the value.
54846 do {
54847 if (!WrapObject(cx, recordValue0, &tmp)) {
54848 aRv.Throw(NS_ERROR_UNEXPECTED);
54849 return;
54850 }
54851 break;
54852 } while (false);
54853 if (!JS_DefineUCProperty(cx, returnObj,
54854 entry.mKey.BeginReading(),
54855 entry.mKey.Length(), tmp,
54856 JSPROP_ENUMERATE)) {
54857 aRv.Throw(NS_ERROR_UNEXPECTED);
54858 return;
54859 }
54860 }
54861 }
54862 argv[0].setObject(*returnObj);
54863 break;
54864 } while (false);
54865
54866 JS::Rooted<JS::Value> callable(cx);
54867 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54868 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54869 !InitIds(cx, atomsCache)) ||
54870 !GetCallableProperty(cx, atomsCache->passExternalInterfaceRecord_id, &callable)) {
54871 aRv.Throw(NS_ERROR_UNEXPECTED);
54872 return;
54873 }
54874 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54875 if (!JS::Call(cx, thisValue, callable,
54876 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54877 aRv.NoteJSContextException(cx);
54878 return;
54879 }
54880}
54881
54882void
54883TestJSImplInterfaceJSImpl::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54884{
54885 CallSetup s(this, aRv, "TestJSImplInterface.passNullableExternalInterfaceRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54886 if (aRv.Failed()) {
54887 return;
54888 }
54889 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54889); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54889; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54890 BindingCallContext& cx = s.GetCallContext();
54891
54892 JS::Rooted<JS::Value> rval(cx);
54893 JS::RootedVector<JS::Value> argv(cx);
54894 if (!argv.resize(1)) {
54895 // That threw an exception on the JSContext, and our CallSetup will do
54896 // the right thing with that.
54897 return;
54898 }
54899 unsigned argc = 1;
54900
54901 do {
54902
54903 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54904 if (!returnObj) {
54905 aRv.Throw(NS_ERROR_UNEXPECTED);
54906 return;
54907 }
54908 // Scope for 'tmp'
54909 {
54910 JS::Rooted<JS::Value> tmp(cx);
54911 for (auto& entry : arg.Entries()) {
54912 auto& recordValue0 = entry.mValue;
54913 // Control block to let us common up the JS_DefineUCProperty calls when there
54914 // are different ways to succeed at wrapping the value.
54915 do {
54916 if (!recordValue0) {
54917 tmp.setNull();
54918 break;
54919 }
54920 if (!WrapObject(cx, recordValue0, &tmp)) {
54921 aRv.Throw(NS_ERROR_UNEXPECTED);
54922 return;
54923 }
54924 break;
54925 } while (false);
54926 if (!JS_DefineUCProperty(cx, returnObj,
54927 entry.mKey.BeginReading(),
54928 entry.mKey.Length(), tmp,
54929 JSPROP_ENUMERATE)) {
54930 aRv.Throw(NS_ERROR_UNEXPECTED);
54931 return;
54932 }
54933 }
54934 }
54935 argv[0].setObject(*returnObj);
54936 break;
54937 } while (false);
54938
54939 JS::Rooted<JS::Value> callable(cx);
54940 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
54941 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
54942 !InitIds(cx, atomsCache)) ||
54943 !GetCallableProperty(cx, atomsCache->passNullableExternalInterfaceRecord_id, &callable)) {
54944 aRv.Throw(NS_ERROR_UNEXPECTED);
54945 return;
54946 }
54947 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
54948 if (!JS::Call(cx, thisValue, callable,
54949 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
54950 aRv.NoteJSContextException(cx);
54951 return;
54952 }
54953}
54954
54955void
54956TestJSImplInterfaceJSImpl::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
54957{
54958 CallSetup s(this, aRv, "TestJSImplInterface.passStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
54959 if (aRv.Failed()) {
54960 return;
54961 }
54962 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 54962); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 54962; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
54963 BindingCallContext& cx = s.GetCallContext();
54964
54965 JS::Rooted<JS::Value> rval(cx);
54966 JS::RootedVector<JS::Value> argv(cx);
54967 if (!argv.resize(1)) {
54968 // That threw an exception on the JSContext, and our CallSetup will do
54969 // the right thing with that.
54970 return;
54971 }
54972 unsigned argc = 1;
54973
54974 do {
54975
54976 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
54977 if (!returnObj) {
54978 aRv.Throw(NS_ERROR_UNEXPECTED);
54979 return;
54980 }
54981 // Scope for 'tmp'
54982 {
54983 JS::Rooted<JS::Value> tmp(cx);
54984 for (auto& entry : arg.Entries()) {
54985 auto& recordValue0 = entry.mValue;
54986 // Control block to let us common up the JS_DefineUCProperty calls when there
54987 // are different ways to succeed at wrapping the value.
54988 do {
54989 if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) {
54990 aRv.Throw(NS_ERROR_UNEXPECTED);
54991 return;
54992 }
54993 break;
54994 } while (false);
54995 if (!JS_DefineUCProperty(cx, returnObj,
54996 entry.mKey.BeginReading(),
54997 entry.mKey.Length(), tmp,
54998 JSPROP_ENUMERATE)) {
54999 aRv.Throw(NS_ERROR_UNEXPECTED);
55000 return;
55001 }
55002 }
55003 }
55004 argv[0].setObject(*returnObj);
55005 break;
55006 } while (false);
55007
55008 JS::Rooted<JS::Value> callable(cx);
55009 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55010 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55011 !InitIds(cx, atomsCache)) ||
55012 !GetCallableProperty(cx, atomsCache->passStringRecord_id, &callable)) {
55013 aRv.Throw(NS_ERROR_UNEXPECTED);
55014 return;
55015 }
55016 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55017 if (!JS::Call(cx, thisValue, callable,
55018 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55019 aRv.NoteJSContextException(cx);
55020 return;
55021 }
55022}
55023
55024void
55025TestJSImplInterfaceJSImpl::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55026{
55027 CallSetup s(this, aRv, "TestJSImplInterface.passByteStringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55028 if (aRv.Failed()) {
55029 return;
55030 }
55031 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55031; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55032 BindingCallContext& cx = s.GetCallContext();
55033
55034 JS::Rooted<JS::Value> rval(cx);
55035 JS::RootedVector<JS::Value> argv(cx);
55036 if (!argv.resize(1)) {
55037 // That threw an exception on the JSContext, and our CallSetup will do
55038 // the right thing with that.
55039 return;
55040 }
55041 unsigned argc = 1;
55042
55043 do {
55044
55045 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55046 if (!returnObj) {
55047 aRv.Throw(NS_ERROR_UNEXPECTED);
55048 return;
55049 }
55050 // Scope for 'tmp'
55051 {
55052 JS::Rooted<JS::Value> tmp(cx);
55053 for (auto& entry : arg.Entries()) {
55054 auto& recordValue0 = entry.mValue;
55055 // Control block to let us common up the JS_DefineUCProperty calls when there
55056 // are different ways to succeed at wrapping the value.
55057 do {
55058 if (!NonVoidByteStringToJsval(cx, recordValue0, &tmp)) {
55059 aRv.Throw(NS_ERROR_UNEXPECTED);
55060 return;
55061 }
55062 break;
55063 } while (false);
55064 if (!JS_DefineUCProperty(cx, returnObj,
55065 entry.mKey.BeginReading(),
55066 entry.mKey.Length(), tmp,
55067 JSPROP_ENUMERATE)) {
55068 aRv.Throw(NS_ERROR_UNEXPECTED);
55069 return;
55070 }
55071 }
55072 }
55073 argv[0].setObject(*returnObj);
55074 break;
55075 } while (false);
55076
55077 JS::Rooted<JS::Value> callable(cx);
55078 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55079 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55080 !InitIds(cx, atomsCache)) ||
55081 !GetCallableProperty(cx, atomsCache->passByteStringRecord_id, &callable)) {
55082 aRv.Throw(NS_ERROR_UNEXPECTED);
55083 return;
55084 }
55085 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55086 if (!JS::Call(cx, thisValue, callable,
55087 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55088 aRv.NoteJSContextException(cx);
55089 return;
55090 }
55091}
55092
55093void
55094TestJSImplInterfaceJSImpl::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55095{
55096 CallSetup s(this, aRv, "TestJSImplInterface.passUTF8StringRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55097 if (aRv.Failed()) {
55098 return;
55099 }
55100 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55100); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55100; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55101 BindingCallContext& cx = s.GetCallContext();
55102
55103 JS::Rooted<JS::Value> rval(cx);
55104 JS::RootedVector<JS::Value> argv(cx);
55105 if (!argv.resize(1)) {
55106 // That threw an exception on the JSContext, and our CallSetup will do
55107 // the right thing with that.
55108 return;
55109 }
55110 unsigned argc = 1;
55111
55112 do {
55113
55114 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55115 if (!returnObj) {
55116 aRv.Throw(NS_ERROR_UNEXPECTED);
55117 return;
55118 }
55119 // Scope for 'tmp'
55120 {
55121 JS::Rooted<JS::Value> tmp(cx);
55122 for (auto& entry : arg.Entries()) {
55123 auto& recordValue0 = entry.mValue;
55124 // Control block to let us common up the JS_DefineUCProperty calls when there
55125 // are different ways to succeed at wrapping the value.
55126 do {
55127 if (!NonVoidUTF8StringToJsval(cx, recordValue0, &tmp)) {
55128 aRv.Throw(NS_ERROR_UNEXPECTED);
55129 return;
55130 }
55131 break;
55132 } while (false);
55133 if (!JS_DefineUCProperty(cx, returnObj,
55134 entry.mKey.BeginReading(),
55135 entry.mKey.Length(), tmp,
55136 JSPROP_ENUMERATE)) {
55137 aRv.Throw(NS_ERROR_UNEXPECTED);
55138 return;
55139 }
55140 }
55141 }
55142 argv[0].setObject(*returnObj);
55143 break;
55144 } while (false);
55145
55146 JS::Rooted<JS::Value> callable(cx);
55147 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55148 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55149 !InitIds(cx, atomsCache)) ||
55150 !GetCallableProperty(cx, atomsCache->passUTF8StringRecord_id, &callable)) {
55151 aRv.Throw(NS_ERROR_UNEXPECTED);
55152 return;
55153 }
55154 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55155 if (!JS::Call(cx, thisValue, callable,
55156 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55157 aRv.NoteJSContextException(cx);
55158 return;
55159 }
55160}
55161
55162void
55163TestJSImplInterfaceJSImpl::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55164{
55165 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecords", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55166 if (aRv.Failed()) {
55167 return;
55168 }
55169 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55169); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55169; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55170 BindingCallContext& cx = s.GetCallContext();
55171
55172 JS::Rooted<JS::Value> rval(cx);
55173 JS::RootedVector<JS::Value> argv(cx);
55174 if (!argv.resize(1)) {
55175 // That threw an exception on the JSContext, and our CallSetup will do
55176 // the right thing with that.
55177 return;
55178 }
55179 unsigned argc = 1;
55180
55181 do {
55182
55183 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55184 if (!returnObj) {
55185 aRv.Throw(NS_ERROR_UNEXPECTED);
55186 return;
55187 }
55188 // Scope for 'tmp'
55189 {
55190 JS::Rooted<JS::Value> tmp(cx);
55191 for (auto& entry : arg.Entries()) {
55192 auto& recordValue0 = entry.mValue;
55193 // Control block to let us common up the JS_DefineUCProperty calls when there
55194 // are different ways to succeed at wrapping the value.
55195 do {
55196
55197 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
55198 if (!returnObj) {
55199 aRv.Throw(NS_ERROR_UNEXPECTED);
55200 return;
55201 }
55202 // Scope for 'tmp'
55203 {
55204 JS::Rooted<JS::Value> tmp(cx);
55205 for (auto& entry : recordValue0.Entries()) {
55206 auto& recordValue1 = entry.mValue;
55207 // Control block to let us common up the JS_DefineUCProperty calls when there
55208 // are different ways to succeed at wrapping the value.
55209 do {
55210 tmp.setInt32(int32_t(recordValue1));
55211 break;
55212 } while (false);
55213 if (!JS_DefineUCProperty(cx, returnObj,
55214 entry.mKey.BeginReading(),
55215 entry.mKey.Length(), tmp,
55216 JSPROP_ENUMERATE)) {
55217 aRv.Throw(NS_ERROR_UNEXPECTED);
55218 return;
55219 }
55220 }
55221 }
55222 tmp.setObject(*returnObj);
55223 break;
55224 } while (false);
55225 if (!JS_DefineUCProperty(cx, returnObj,
55226 entry.mKey.BeginReading(),
55227 entry.mKey.Length(), tmp,
55228 JSPROP_ENUMERATE)) {
55229 aRv.Throw(NS_ERROR_UNEXPECTED);
55230 return;
55231 }
55232 }
55233 }
55234 argv[0].setObject(*returnObj);
55235 break;
55236 } while (false);
55237
55238 JS::Rooted<JS::Value> callable(cx);
55239 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55240 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55241 !InitIds(cx, atomsCache)) ||
55242 !GetCallableProperty(cx, atomsCache->passRecordOfRecords_id, &callable)) {
55243 aRv.Throw(NS_ERROR_UNEXPECTED);
55244 return;
55245 }
55246 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55247 if (!JS::Call(cx, thisValue, callable,
55248 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55249 aRv.NoteJSContextException(cx);
55250 return;
55251 }
55252}
55253
55254void
55255TestJSImplInterfaceJSImpl::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55256{
55257 CallSetup s(this, aRv, "TestJSImplInterface.receiveRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55258 if (aRv.Failed()) {
55259 return;
55260 }
55261 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55261); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55261; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55262 BindingCallContext& cx = s.GetCallContext();
55263
55264 JS::Rooted<JS::Value> rval(cx);
55265
55266 JS::Rooted<JS::Value> callable(cx);
55267 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55268 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55269 !InitIds(cx, atomsCache)) ||
55270 !GetCallableProperty(cx, atomsCache->receiveRecord_id, &callable)) {
55271 aRv.Throw(NS_ERROR_UNEXPECTED);
55272 return;
55273 }
55274 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55275 if (!JS::Call(cx, thisValue, callable,
55276 JS::HandleValueArray::empty(), &rval)) {
55277 aRv.NoteJSContextException(cx);
55278 return;
55279 }
55280 Record<nsString, int32_t>& rvalDecl(aRetVal);
55281 if (rval.isObject()) {
55282 auto& recordEntries = rvalDecl.Entries();
55283
55284 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55285 JS::RootedVector<jsid> ids(cx);
55286 if (!js::GetPropertyKeys(cx, recordObj,
55287 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55288 aRv.Throw(NS_ERROR_UNEXPECTED);
55289 return;
55290 }
55291 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55292 JS_ReportOutOfMemory(cx);
55293 aRv.Throw(NS_ERROR_UNEXPECTED);
55294 return;
55295 }
55296 JS::Rooted<JS::Value> propNameValue(cx);
55297 JS::Rooted<JS::Value> temp(cx);
55298 JS::Rooted<jsid> curId(cx);
55299 JS::Rooted<JS::Value> idVal(cx);
55300 // Use a hashset to keep track of ids seen, to avoid
55301 // introducing nasty O(N^2) behavior scanning for them all the
55302 // time. Ideally we'd use a data structure with O(1) lookup
55303 // _and_ ordering for the MozMap, but we don't have one lying
55304 // around.
55305 nsTHashtable<nsStringHashKey> idsSeen;
55306 for (size_t i = 0; i < ids.length(); ++i) {
55307 curId = ids[i];
55308
55309 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55310 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55311 &desc)) {
55312 aRv.Throw(NS_ERROR_UNEXPECTED);
55313 return;
55314 }
55315
55316 if (desc.isNothing() || !desc->enumerable()) {
55317 continue;
55318 }
55319
55320 idVal = js::IdToValue(curId);
55321 nsString propName;
55322 // This will just throw if idVal is a Symbol, like the spec says
55323 // to do.
55324 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecord", propName)) {
55325 aRv.Throw(NS_ERROR_UNEXPECTED);
55326 return;
55327 }
55328
55329 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55330 aRv.Throw(NS_ERROR_UNEXPECTED);
55331 return;
55332 }
55333
55334 Record<nsString, int32_t>::EntryType* entry;
55335 if (!idsSeen.EnsureInserted(propName)) {
55336 // Find the existing entry.
55337 auto idx = recordEntries.IndexOf(propName);
55338 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55339); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55339; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55339 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55339); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55339; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55340 // Now blow it away to make it look like it was just added
55341 // to the array, because it's not obvious that it's
55342 // safe to write to its already-initialized mValue via our
55343 // normal codegen conversions. For example, the value
55344 // could be a union and this would change its type, but
55345 // codegen assumes we won't do that.
55346 entry = recordEntries.ReconstructElementAt(idx);
55347 } else {
55348 // Safe to do an infallible append here, because we did a
55349 // SetCapacity above to the right capacity.
55350 entry = recordEntries.AppendElement();
55351 }
55352 entry->mKey = propName;
55353 int32_t& slot = entry->mValue;
55354 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecord", &slot)) {
55355 aRv.Throw(NS_ERROR_UNEXPECTED);
55356 return;
55357 }
55358 }
55359 } else {
55360 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecord");
55361 aRv.Throw(NS_ERROR_UNEXPECTED);
55362 return;
55363 }
55364}
55365
55366void
55367TestJSImplInterfaceJSImpl::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55368{
55369 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55370 if (aRv.Failed()) {
55371 return;
55372 }
55373 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55373); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55373; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55374 BindingCallContext& cx = s.GetCallContext();
55375
55376 JS::Rooted<JS::Value> rval(cx);
55377
55378 JS::Rooted<JS::Value> callable(cx);
55379 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55380 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55381 !InitIds(cx, atomsCache)) ||
55382 !GetCallableProperty(cx, atomsCache->receiveNullableRecord_id, &callable)) {
55383 aRv.Throw(NS_ERROR_UNEXPECTED);
55384 return;
55385 }
55386 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55387 if (!JS::Call(cx, thisValue, callable,
55388 JS::HandleValueArray::empty(), &rval)) {
55389 aRv.NoteJSContextException(cx);
55390 return;
55391 }
55392 Nullable<Record<nsString, int32_t>>& rvalDecl(aRetVal);
55393 if (rval.isObject()) {
55394 auto& recordEntries = rvalDecl.SetValue().Entries();
55395
55396 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55397 JS::RootedVector<jsid> ids(cx);
55398 if (!js::GetPropertyKeys(cx, recordObj,
55399 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55400 aRv.Throw(NS_ERROR_UNEXPECTED);
55401 return;
55402 }
55403 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55404 JS_ReportOutOfMemory(cx);
55405 aRv.Throw(NS_ERROR_UNEXPECTED);
55406 return;
55407 }
55408 JS::Rooted<JS::Value> propNameValue(cx);
55409 JS::Rooted<JS::Value> temp(cx);
55410 JS::Rooted<jsid> curId(cx);
55411 JS::Rooted<JS::Value> idVal(cx);
55412 // Use a hashset to keep track of ids seen, to avoid
55413 // introducing nasty O(N^2) behavior scanning for them all the
55414 // time. Ideally we'd use a data structure with O(1) lookup
55415 // _and_ ordering for the MozMap, but we don't have one lying
55416 // around.
55417 nsTHashtable<nsStringHashKey> idsSeen;
55418 for (size_t i = 0; i < ids.length(); ++i) {
55419 curId = ids[i];
55420
55421 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55422 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55423 &desc)) {
55424 aRv.Throw(NS_ERROR_UNEXPECTED);
55425 return;
55426 }
55427
55428 if (desc.isNothing() || !desc->enumerable()) {
55429 continue;
55430 }
55431
55432 idVal = js::IdToValue(curId);
55433 nsString propName;
55434 // This will just throw if idVal is a Symbol, like the spec says
55435 // to do.
55436 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecord", propName)) {
55437 aRv.Throw(NS_ERROR_UNEXPECTED);
55438 return;
55439 }
55440
55441 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55442 aRv.Throw(NS_ERROR_UNEXPECTED);
55443 return;
55444 }
55445
55446 Record<nsString, int32_t>::EntryType* entry;
55447 if (!idsSeen.EnsureInserted(propName)) {
55448 // Find the existing entry.
55449 auto idx = recordEntries.IndexOf(propName);
55450 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55451); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55451; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55451 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55451); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55451; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55452 // Now blow it away to make it look like it was just added
55453 // to the array, because it's not obvious that it's
55454 // safe to write to its already-initialized mValue via our
55455 // normal codegen conversions. For example, the value
55456 // could be a union and this would change its type, but
55457 // codegen assumes we won't do that.
55458 entry = recordEntries.ReconstructElementAt(idx);
55459 } else {
55460 // Safe to do an infallible append here, because we did a
55461 // SetCapacity above to the right capacity.
55462 entry = recordEntries.AppendElement();
55463 }
55464 entry->mKey = propName;
55465 int32_t& slot = entry->mValue;
55466 if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecord", &slot)) {
55467 aRv.Throw(NS_ERROR_UNEXPECTED);
55468 return;
55469 }
55470 }
55471 } else if (rval.isNullOrUndefined()) {
55472 rvalDecl.SetNull();
55473 } else {
55474 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecord");
55475 aRv.Throw(NS_ERROR_UNEXPECTED);
55476 return;
55477 }
55478}
55479
55480void
55481TestJSImplInterfaceJSImpl::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55482{
55483 CallSetup s(this, aRv, "TestJSImplInterface.receiveRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55484 if (aRv.Failed()) {
55485 return;
55486 }
55487 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55487); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55487; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55488 BindingCallContext& cx = s.GetCallContext();
55489
55490 JS::Rooted<JS::Value> rval(cx);
55491
55492 JS::Rooted<JS::Value> callable(cx);
55493 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55494 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55495 !InitIds(cx, atomsCache)) ||
55496 !GetCallableProperty(cx, atomsCache->receiveRecordOfNullableInts_id, &callable)) {
55497 aRv.Throw(NS_ERROR_UNEXPECTED);
55498 return;
55499 }
55500 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55501 if (!JS::Call(cx, thisValue, callable,
55502 JS::HandleValueArray::empty(), &rval)) {
55503 aRv.NoteJSContextException(cx);
55504 return;
55505 }
55506 Record<nsString, Nullable<int32_t>>& rvalDecl(aRetVal);
55507 if (rval.isObject()) {
55508 auto& recordEntries = rvalDecl.Entries();
55509
55510 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55511 JS::RootedVector<jsid> ids(cx);
55512 if (!js::GetPropertyKeys(cx, recordObj,
55513 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55514 aRv.Throw(NS_ERROR_UNEXPECTED);
55515 return;
55516 }
55517 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55518 JS_ReportOutOfMemory(cx);
55519 aRv.Throw(NS_ERROR_UNEXPECTED);
55520 return;
55521 }
55522 JS::Rooted<JS::Value> propNameValue(cx);
55523 JS::Rooted<JS::Value> temp(cx);
55524 JS::Rooted<jsid> curId(cx);
55525 JS::Rooted<JS::Value> idVal(cx);
55526 // Use a hashset to keep track of ids seen, to avoid
55527 // introducing nasty O(N^2) behavior scanning for them all the
55528 // time. Ideally we'd use a data structure with O(1) lookup
55529 // _and_ ordering for the MozMap, but we don't have one lying
55530 // around.
55531 nsTHashtable<nsStringHashKey> idsSeen;
55532 for (size_t i = 0; i < ids.length(); ++i) {
55533 curId = ids[i];
55534
55535 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55536 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55537 &desc)) {
55538 aRv.Throw(NS_ERROR_UNEXPECTED);
55539 return;
55540 }
55541
55542 if (desc.isNothing() || !desc->enumerable()) {
55543 continue;
55544 }
55545
55546 idVal = js::IdToValue(curId);
55547 nsString propName;
55548 // This will just throw if idVal is a Symbol, like the spec says
55549 // to do.
55550 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveRecordOfNullableInts", propName)) {
55551 aRv.Throw(NS_ERROR_UNEXPECTED);
55552 return;
55553 }
55554
55555 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55556 aRv.Throw(NS_ERROR_UNEXPECTED);
55557 return;
55558 }
55559
55560 Record<nsString, Nullable<int32_t>>::EntryType* entry;
55561 if (!idsSeen.EnsureInserted(propName)) {
55562 // Find the existing entry.
55563 auto idx = recordEntries.IndexOf(propName);
55564 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55565); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55565; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55565 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55565); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55565; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55566 // Now blow it away to make it look like it was just added
55567 // to the array, because it's not obvious that it's
55568 // safe to write to its already-initialized mValue via our
55569 // normal codegen conversions. For example, the value
55570 // could be a union and this would change its type, but
55571 // codegen assumes we won't do that.
55572 entry = recordEntries.ReconstructElementAt(idx);
55573 } else {
55574 // Safe to do an infallible append here, because we did a
55575 // SetCapacity above to the right capacity.
55576 entry = recordEntries.AppendElement();
55577 }
55578 entry->mKey = propName;
55579 Nullable<int32_t>& slot = entry->mValue;
55580 if (temp.isNullOrUndefined()) {
55581 slot.SetNull();
55582 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveRecordOfNullableInts", &slot.SetValue())) {
55583 aRv.Throw(NS_ERROR_UNEXPECTED);
55584 return;
55585 }
55586 }
55587 } else {
55588 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveRecordOfNullableInts");
55589 aRv.Throw(NS_ERROR_UNEXPECTED);
55590 return;
55591 }
55592}
55593
55594void
55595TestJSImplInterfaceJSImpl::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55596{
55597 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableRecordOfNullableInts", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55598 if (aRv.Failed()) {
55599 return;
55600 }
55601 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55601); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55601; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55602 BindingCallContext& cx = s.GetCallContext();
55603
55604 JS::Rooted<JS::Value> rval(cx);
55605
55606 JS::Rooted<JS::Value> callable(cx);
55607 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55608 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55609 !InitIds(cx, atomsCache)) ||
55610 !GetCallableProperty(cx, atomsCache->receiveNullableRecordOfNullableInts_id, &callable)) {
55611 aRv.Throw(NS_ERROR_UNEXPECTED);
55612 return;
55613 }
55614 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55615 if (!JS::Call(cx, thisValue, callable,
55616 JS::HandleValueArray::empty(), &rval)) {
55617 aRv.NoteJSContextException(cx);
55618 return;
55619 }
55620 Nullable<Record<nsString, Nullable<int32_t>>>& rvalDecl(aRetVal);
55621 if (rval.isObject()) {
55622 auto& recordEntries = rvalDecl.SetValue().Entries();
55623
55624 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55625 JS::RootedVector<jsid> ids(cx);
55626 if (!js::GetPropertyKeys(cx, recordObj,
55627 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55628 aRv.Throw(NS_ERROR_UNEXPECTED);
55629 return;
55630 }
55631 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55632 JS_ReportOutOfMemory(cx);
55633 aRv.Throw(NS_ERROR_UNEXPECTED);
55634 return;
55635 }
55636 JS::Rooted<JS::Value> propNameValue(cx);
55637 JS::Rooted<JS::Value> temp(cx);
55638 JS::Rooted<jsid> curId(cx);
55639 JS::Rooted<JS::Value> idVal(cx);
55640 // Use a hashset to keep track of ids seen, to avoid
55641 // introducing nasty O(N^2) behavior scanning for them all the
55642 // time. Ideally we'd use a data structure with O(1) lookup
55643 // _and_ ordering for the MozMap, but we don't have one lying
55644 // around.
55645 nsTHashtable<nsStringHashKey> idsSeen;
55646 for (size_t i = 0; i < ids.length(); ++i) {
55647 curId = ids[i];
55648
55649 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55650 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55651 &desc)) {
55652 aRv.Throw(NS_ERROR_UNEXPECTED);
55653 return;
55654 }
55655
55656 if (desc.isNothing() || !desc->enumerable()) {
55657 continue;
55658 }
55659
55660 idVal = js::IdToValue(curId);
55661 nsString propName;
55662 // This will just throw if idVal is a Symbol, like the spec says
55663 // to do.
55664 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", propName)) {
55665 aRv.Throw(NS_ERROR_UNEXPECTED);
55666 return;
55667 }
55668
55669 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55670 aRv.Throw(NS_ERROR_UNEXPECTED);
55671 return;
55672 }
55673
55674 Record<nsString, Nullable<int32_t>>::EntryType* entry;
55675 if (!idsSeen.EnsureInserted(propName)) {
55676 // Find the existing entry.
55677 auto idx = recordEntries.IndexOf(propName);
55678 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55679); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55679; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55679 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55679); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55679; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55680 // Now blow it away to make it look like it was just added
55681 // to the array, because it's not obvious that it's
55682 // safe to write to its already-initialized mValue via our
55683 // normal codegen conversions. For example, the value
55684 // could be a union and this would change its type, but
55685 // codegen assumes we won't do that.
55686 entry = recordEntries.ReconstructElementAt(idx);
55687 } else {
55688 // Safe to do an infallible append here, because we did a
55689 // SetCapacity above to the right capacity.
55690 entry = recordEntries.AppendElement();
55691 }
55692 entry->mKey = propName;
55693 Nullable<int32_t>& slot = entry->mValue;
55694 if (temp.isNullOrUndefined()) {
55695 slot.SetNull();
55696 } else if (!ValueToPrimitive<int32_t, eDefault>(cx, temp, "Value in return value of TestJSImplInterface.receiveNullableRecordOfNullableInts", &slot.SetValue())) {
55697 aRv.Throw(NS_ERROR_UNEXPECTED);
55698 return;
55699 }
55700 }
55701 } else if (rval.isNullOrUndefined()) {
55702 rvalDecl.SetNull();
55703 } else {
55704 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableRecordOfNullableInts");
55705 aRv.Throw(NS_ERROR_UNEXPECTED);
55706 return;
55707 }
55708}
55709
55710void
55711TestJSImplInterfaceJSImpl::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
55712{
55713 CallSetup s(this, aRv, "TestJSImplInterface.receiveAnyRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55714 if (aRv.Failed()) {
55715 return;
55716 }
55717 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55717); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55717; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55718 BindingCallContext& cx = s.GetCallContext();
55719
55720 JS::Rooted<JS::Value> rval(cx);
55721
55722 JS::Rooted<JS::Value> callable(cx);
55723 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55724 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55725 !InitIds(cx, atomsCache)) ||
55726 !GetCallableProperty(cx, atomsCache->receiveAnyRecord_id, &callable)) {
55727 aRv.Throw(NS_ERROR_UNEXPECTED);
55728 return;
55729 }
55730 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55731 if (!JS::Call(cx, thisValue, callable,
55732 JS::HandleValueArray::empty(), &rval)) {
55733 aRv.NoteJSContextException(cx);
55734 return;
55735 }
55736 Record<nsString, JS::Value>& rvalDecl(aRetVal);
55737 if (rval.isObject()) {
55738 auto& recordEntries = rvalDecl.Entries();
55739
55740 JS::Rooted<JSObject*> recordObj(cx, &rval.toObject());
55741 JS::RootedVector<jsid> ids(cx);
55742 if (!js::GetPropertyKeys(cx, recordObj,
55743 JSITER_OWNONLY0x8 | JSITER_HIDDEN0x10 | JSITER_SYMBOLS0x20, &ids)) {
55744 aRv.Throw(NS_ERROR_UNEXPECTED);
55745 return;
55746 }
55747 if (!recordEntries.SetCapacity(ids.length(), mozilla::fallible)) {
55748 JS_ReportOutOfMemory(cx);
55749 aRv.Throw(NS_ERROR_UNEXPECTED);
55750 return;
55751 }
55752 JS::Rooted<JS::Value> propNameValue(cx);
55753 JS::Rooted<JS::Value> temp(cx);
55754 JS::Rooted<jsid> curId(cx);
55755 JS::Rooted<JS::Value> idVal(cx);
55756 // Use a hashset to keep track of ids seen, to avoid
55757 // introducing nasty O(N^2) behavior scanning for them all the
55758 // time. Ideally we'd use a data structure with O(1) lookup
55759 // _and_ ordering for the MozMap, but we don't have one lying
55760 // around.
55761 nsTHashtable<nsStringHashKey> idsSeen;
55762 for (size_t i = 0; i < ids.length(); ++i) {
55763 curId = ids[i];
55764
55765 JS::Rooted<mozilla::Maybe<JS::PropertyDescriptor>> desc(cx);
55766 if (!JS_GetOwnPropertyDescriptorById(cx, recordObj, curId,
55767 &desc)) {
55768 aRv.Throw(NS_ERROR_UNEXPECTED);
55769 return;
55770 }
55771
55772 if (desc.isNothing() || !desc->enumerable()) {
55773 continue;
55774 }
55775
55776 idVal = js::IdToValue(curId);
55777 nsString propName;
55778 // This will just throw if idVal is a Symbol, like the spec says
55779 // to do.
55780 if (!ConvertJSValueToString(cx, idVal, "key of return value of TestJSImplInterface.receiveAnyRecord", propName)) {
55781 aRv.Throw(NS_ERROR_UNEXPECTED);
55782 return;
55783 }
55784
55785 if (!JS_GetPropertyById(cx, recordObj, curId, &temp)) {
55786 aRv.Throw(NS_ERROR_UNEXPECTED);
55787 return;
55788 }
55789
55790 Record<nsString, JS::Value>::EntryType* entry;
55791 if (!idsSeen.EnsureInserted(propName)) {
55792 // Find the existing entry.
55793 auto idx = recordEntries.IndexOf(propName);
55794 MOZ_ASSERT(idx != recordEntries.NoIndex,do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55795); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55795; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
55795 "Why is it not found?")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(idx != recordEntries.NoIndex)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(idx != recordEntries.NoIndex
))), 0))) { do { } while (false); MOZ_ReportAssertionFailure(
"idx != recordEntries.NoIndex" " (" "Why is it not found?" ")"
, "../TestJSImplGenBinding.cpp", 55795); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "idx != recordEntries.NoIndex" ") (" "Why is it not found?"
")"); do { *((volatile int*)__null) = 55795; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
55796 // Now blow it away to make it look like it was just added
55797 // to the array, because it's not obvious that it's
55798 // safe to write to its already-initialized mValue via our
55799 // normal codegen conversions. For example, the value
55800 // could be a union and this would change its type, but
55801 // codegen assumes we won't do that.
55802 entry = recordEntries.ReconstructElementAt(idx);
55803 } else {
55804 // Safe to do an infallible append here, because we did a
55805 // SetCapacity above to the right capacity.
55806 entry = recordEntries.AppendElement();
55807 }
55808 entry->mKey = propName;
55809 JS::Value& slot = entry->mValue;
55810#ifdef __clang__1
55811#pragma clang diagnostic push
55812#pragma clang diagnostic ignored "-Wunreachable-code"
55813#pragma clang diagnostic ignored "-Wunreachable-code-return"
55814#endif // __clang__
55815 if ((false) && !CallerSubsumes(temp)) {
55816 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("value in return value of TestJSImplInterface.receiveAnyRecord");
55817 aRv.Throw(NS_ERROR_UNEXPECTED);
55818 return;
55819 }
55820#ifdef __clang__1
55821#pragma clang diagnostic pop
55822#endif // __clang__
55823 slot = temp;
55824 }
55825 } else {
55826 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveAnyRecord");
55827 aRv.Throw(NS_ERROR_UNEXPECTED);
55828 return;
55829 }
55830}
55831
55832void
55833TestJSImplInterfaceJSImpl::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
55834{
55835 CallSetup s(this, aRv, "TestJSImplInterface.passArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55836 if (aRv.Failed()) {
55837 return;
55838 }
55839 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55839); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55839; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55840 BindingCallContext& cx = s.GetCallContext();
55841
55842 JS::Rooted<JS::Value> rval(cx);
55843 JS::RootedVector<JS::Value> argv(cx);
55844 if (!argv.resize(1)) {
55845 // That threw an exception on the JSContext, and our CallSetup will do
55846 // the right thing with that.
55847 return;
55848 }
55849 unsigned argc = 1;
55850
55851 do {
55852 argv[0].setObject(*arg.Obj());
55853 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
55854 aRv.Throw(NS_ERROR_UNEXPECTED);
55855 return;
55856 }
55857 break;
55858 } while (false);
55859
55860 JS::Rooted<JS::Value> callable(cx);
55861 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55862 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55863 !InitIds(cx, atomsCache)) ||
55864 !GetCallableProperty(cx, atomsCache->passArrayBuffer_id, &callable)) {
55865 aRv.Throw(NS_ERROR_UNEXPECTED);
55866 return;
55867 }
55868 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55869 if (!JS::Call(cx, thisValue, callable,
55870 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55871 aRv.NoteJSContextException(cx);
55872 return;
55873 }
55874}
55875
55876void
55877TestJSImplInterfaceJSImpl::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55878{
55879 CallSetup s(this, aRv, "TestJSImplInterface.passNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55880 if (aRv.Failed()) {
55881 return;
55882 }
55883 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55883); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55883; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55884 BindingCallContext& cx = s.GetCallContext();
55885
55886 JS::Rooted<JS::Value> rval(cx);
55887 JS::RootedVector<JS::Value> argv(cx);
55888 if (!argv.resize(1)) {
55889 // That threw an exception on the JSContext, and our CallSetup will do
55890 // the right thing with that.
55891 return;
55892 }
55893 unsigned argc = 1;
55894
55895 do {
55896 if (arg.IsNull()) {
55897 argv[0].setNull();
55898 break;
55899 }
55900 argv[0].setObject(*arg.Value().Obj());
55901 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
55902 aRv.Throw(NS_ERROR_UNEXPECTED);
55903 return;
55904 }
55905 break;
55906 } while (false);
55907
55908 JS::Rooted<JS::Value> callable(cx);
55909 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55910 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55911 !InitIds(cx, atomsCache)) ||
55912 !GetCallableProperty(cx, atomsCache->passNullableArrayBuffer_id, &callable)) {
55913 aRv.Throw(NS_ERROR_UNEXPECTED);
55914 return;
55915 }
55916 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55917 if (!JS::Call(cx, thisValue, callable,
55918 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55919 aRv.NoteJSContextException(cx);
55920 return;
55921 }
55922}
55923
55924void
55925TestJSImplInterfaceJSImpl::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55926{
55927 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55928 if (aRv.Failed()) {
55929 return;
55930 }
55931 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55931); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55931; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55932 BindingCallContext& cx = s.GetCallContext();
55933
55934 JS::Rooted<JS::Value> rval(cx);
55935 JS::RootedVector<JS::Value> argv(cx);
55936 if (!argv.resize(1)) {
55937 // That threw an exception on the JSContext, and our CallSetup will do
55938 // the right thing with that.
55939 return;
55940 }
55941 unsigned argc = 1;
55942
55943 do {
55944 if (arg.WasPassed()) {
55945 argv[0].setObject(*arg.Value().Obj());
55946 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
55947 aRv.Throw(NS_ERROR_UNEXPECTED);
55948 return;
55949 }
55950 break;
55951 } else if (argc == 1) {
55952 // This is our current trailing argument; reduce argc
55953 --argc;
55954 } else {
55955 argv[0].setUndefined();
55956 }
55957 } while (false);
55958
55959 JS::Rooted<JS::Value> callable(cx);
55960 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
55961 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
55962 !InitIds(cx, atomsCache)) ||
55963 !GetCallableProperty(cx, atomsCache->passOptionalArrayBuffer_id, &callable)) {
55964 aRv.Throw(NS_ERROR_UNEXPECTED);
55965 return;
55966 }
55967 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
55968 if (!JS::Call(cx, thisValue, callable,
55969 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
55970 aRv.NoteJSContextException(cx);
55971 return;
55972 }
55973}
55974
55975void
55976TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
55977{
55978 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
55979 if (aRv.Failed()) {
55980 return;
55981 }
55982 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 55982); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 55982; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
55983 BindingCallContext& cx = s.GetCallContext();
55984
55985 JS::Rooted<JS::Value> rval(cx);
55986 JS::RootedVector<JS::Value> argv(cx);
55987 if (!argv.resize(1)) {
55988 // That threw an exception on the JSContext, and our CallSetup will do
55989 // the right thing with that.
55990 return;
55991 }
55992 unsigned argc = 1;
55993
55994 do {
55995 if (arg.WasPassed()) {
55996 if (arg.Value().IsNull()) {
55997 argv[0].setNull();
55998 break;
55999 }
56000 argv[0].setObject(*arg.Value().Value().Obj());
56001 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56002 aRv.Throw(NS_ERROR_UNEXPECTED);
56003 return;
56004 }
56005 break;
56006 } else if (argc == 1) {
56007 // This is our current trailing argument; reduce argc
56008 --argc;
56009 } else {
56010 argv[0].setUndefined();
56011 }
56012 } while (false);
56013
56014 JS::Rooted<JS::Value> callable(cx);
56015 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56016 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56017 !InitIds(cx, atomsCache)) ||
56018 !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBuffer_id, &callable)) {
56019 aRv.Throw(NS_ERROR_UNEXPECTED);
56020 return;
56021 }
56022 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56023 if (!JS::Call(cx, thisValue, callable,
56024 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56025 aRv.NoteJSContextException(cx);
56026 return;
56027 }
56028}
56029
56030void
56031TestJSImplInterfaceJSImpl::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56032{
56033 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableArrayBufferWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56034 if (aRv.Failed()) {
56035 return;
56036 }
56037 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56037); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56037; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56038 BindingCallContext& cx = s.GetCallContext();
56039
56040 JS::Rooted<JS::Value> rval(cx);
56041 JS::RootedVector<JS::Value> argv(cx);
56042 if (!argv.resize(1)) {
56043 // That threw an exception on the JSContext, and our CallSetup will do
56044 // the right thing with that.
56045 return;
56046 }
56047 unsigned argc = 1;
56048
56049 do {
56050 if (arg.IsNull()) {
56051 argv[0].setNull();
56052 break;
56053 }
56054 argv[0].setObject(*arg.Value().Obj());
56055 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56056 aRv.Throw(NS_ERROR_UNEXPECTED);
56057 return;
56058 }
56059 break;
56060 } while (false);
56061
56062 JS::Rooted<JS::Value> callable(cx);
56063 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56064 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56065 !InitIds(cx, atomsCache)) ||
56066 !GetCallableProperty(cx, atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id, &callable)) {
56067 aRv.Throw(NS_ERROR_UNEXPECTED);
56068 return;
56069 }
56070 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56071 if (!JS::Call(cx, thisValue, callable,
56072 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56073 aRv.NoteJSContextException(cx);
56074 return;
56075 }
56076}
56077
56078void
56079TestJSImplInterfaceJSImpl::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
56080{
56081 CallSetup s(this, aRv, "TestJSImplInterface.passArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56082 if (aRv.Failed()) {
56083 return;
56084 }
56085 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56085); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56085; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56086 BindingCallContext& cx = s.GetCallContext();
56087
56088 JS::Rooted<JS::Value> rval(cx);
56089 JS::RootedVector<JS::Value> argv(cx);
56090 if (!argv.resize(1)) {
56091 // That threw an exception on the JSContext, and our CallSetup will do
56092 // the right thing with that.
56093 return;
56094 }
56095 unsigned argc = 1;
56096
56097 do {
56098 argv[0].setObject(*arg.Obj());
56099 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56100 aRv.Throw(NS_ERROR_UNEXPECTED);
56101 return;
56102 }
56103 break;
56104 } while (false);
56105
56106 JS::Rooted<JS::Value> callable(cx);
56107 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56108 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56109 !InitIds(cx, atomsCache)) ||
56110 !GetCallableProperty(cx, atomsCache->passArrayBufferView_id, &callable)) {
56111 aRv.Throw(NS_ERROR_UNEXPECTED);
56112 return;
56113 }
56114 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56115 if (!JS::Call(cx, thisValue, callable,
56116 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56117 aRv.NoteJSContextException(cx);
56118 return;
56119 }
56120}
56121
56122void
56123TestJSImplInterfaceJSImpl::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56124{
56125 CallSetup s(this, aRv, "TestJSImplInterface.passInt8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56126 if (aRv.Failed()) {
56127 return;
56128 }
56129 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56129); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56129; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56130 BindingCallContext& cx = s.GetCallContext();
56131
56132 JS::Rooted<JS::Value> rval(cx);
56133 JS::RootedVector<JS::Value> argv(cx);
56134 if (!argv.resize(1)) {
56135 // That threw an exception on the JSContext, and our CallSetup will do
56136 // the right thing with that.
56137 return;
56138 }
56139 unsigned argc = 1;
56140
56141 do {
56142 argv[0].setObject(*arg.Obj());
56143 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56144 aRv.Throw(NS_ERROR_UNEXPECTED);
56145 return;
56146 }
56147 break;
56148 } while (false);
56149
56150 JS::Rooted<JS::Value> callable(cx);
56151 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56152 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56153 !InitIds(cx, atomsCache)) ||
56154 !GetCallableProperty(cx, atomsCache->passInt8Array_id, &callable)) {
56155 aRv.Throw(NS_ERROR_UNEXPECTED);
56156 return;
56157 }
56158 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56159 if (!JS::Call(cx, thisValue, callable,
56160 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56161 aRv.NoteJSContextException(cx);
56162 return;
56163 }
56164}
56165
56166void
56167TestJSImplInterfaceJSImpl::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56168{
56169 CallSetup s(this, aRv, "TestJSImplInterface.passInt16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56170 if (aRv.Failed()) {
56171 return;
56172 }
56173 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56173); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56173; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56174 BindingCallContext& cx = s.GetCallContext();
56175
56176 JS::Rooted<JS::Value> rval(cx);
56177 JS::RootedVector<JS::Value> argv(cx);
56178 if (!argv.resize(1)) {
56179 // That threw an exception on the JSContext, and our CallSetup will do
56180 // the right thing with that.
56181 return;
56182 }
56183 unsigned argc = 1;
56184
56185 do {
56186 argv[0].setObject(*arg.Obj());
56187 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56188 aRv.Throw(NS_ERROR_UNEXPECTED);
56189 return;
56190 }
56191 break;
56192 } while (false);
56193
56194 JS::Rooted<JS::Value> callable(cx);
56195 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56196 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56197 !InitIds(cx, atomsCache)) ||
56198 !GetCallableProperty(cx, atomsCache->passInt16Array_id, &callable)) {
56199 aRv.Throw(NS_ERROR_UNEXPECTED);
56200 return;
56201 }
56202 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56203 if (!JS::Call(cx, thisValue, callable,
56204 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56205 aRv.NoteJSContextException(cx);
56206 return;
56207 }
56208}
56209
56210void
56211TestJSImplInterfaceJSImpl::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56212{
56213 CallSetup s(this, aRv, "TestJSImplInterface.passInt32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56214 if (aRv.Failed()) {
56215 return;
56216 }
56217 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56217); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56217; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56218 BindingCallContext& cx = s.GetCallContext();
56219
56220 JS::Rooted<JS::Value> rval(cx);
56221 JS::RootedVector<JS::Value> argv(cx);
56222 if (!argv.resize(1)) {
56223 // That threw an exception on the JSContext, and our CallSetup will do
56224 // the right thing with that.
56225 return;
56226 }
56227 unsigned argc = 1;
56228
56229 do {
56230 argv[0].setObject(*arg.Obj());
56231 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56232 aRv.Throw(NS_ERROR_UNEXPECTED);
56233 return;
56234 }
56235 break;
56236 } while (false);
56237
56238 JS::Rooted<JS::Value> callable(cx);
56239 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56240 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56241 !InitIds(cx, atomsCache)) ||
56242 !GetCallableProperty(cx, atomsCache->passInt32Array_id, &callable)) {
56243 aRv.Throw(NS_ERROR_UNEXPECTED);
56244 return;
56245 }
56246 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56247 if (!JS::Call(cx, thisValue, callable,
56248 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56249 aRv.NoteJSContextException(cx);
56250 return;
56251 }
56252}
56253
56254void
56255TestJSImplInterfaceJSImpl::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56256{
56257 CallSetup s(this, aRv, "TestJSImplInterface.passUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56258 if (aRv.Failed()) {
56259 return;
56260 }
56261 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56261); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56261; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56262 BindingCallContext& cx = s.GetCallContext();
56263
56264 JS::Rooted<JS::Value> rval(cx);
56265 JS::RootedVector<JS::Value> argv(cx);
56266 if (!argv.resize(1)) {
56267 // That threw an exception on the JSContext, and our CallSetup will do
56268 // the right thing with that.
56269 return;
56270 }
56271 unsigned argc = 1;
56272
56273 do {
56274 argv[0].setObject(*arg.Obj());
56275 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56276 aRv.Throw(NS_ERROR_UNEXPECTED);
56277 return;
56278 }
56279 break;
56280 } while (false);
56281
56282 JS::Rooted<JS::Value> callable(cx);
56283 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56284 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56285 !InitIds(cx, atomsCache)) ||
56286 !GetCallableProperty(cx, atomsCache->passUint8Array_id, &callable)) {
56287 aRv.Throw(NS_ERROR_UNEXPECTED);
56288 return;
56289 }
56290 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56291 if (!JS::Call(cx, thisValue, callable,
56292 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56293 aRv.NoteJSContextException(cx);
56294 return;
56295 }
56296}
56297
56298void
56299TestJSImplInterfaceJSImpl::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56300{
56301 CallSetup s(this, aRv, "TestJSImplInterface.passUint16Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56302 if (aRv.Failed()) {
56303 return;
56304 }
56305 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56305); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56305; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56306 BindingCallContext& cx = s.GetCallContext();
56307
56308 JS::Rooted<JS::Value> rval(cx);
56309 JS::RootedVector<JS::Value> argv(cx);
56310 if (!argv.resize(1)) {
56311 // That threw an exception on the JSContext, and our CallSetup will do
56312 // the right thing with that.
56313 return;
56314 }
56315 unsigned argc = 1;
56316
56317 do {
56318 argv[0].setObject(*arg.Obj());
56319 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56320 aRv.Throw(NS_ERROR_UNEXPECTED);
56321 return;
56322 }
56323 break;
56324 } while (false);
56325
56326 JS::Rooted<JS::Value> callable(cx);
56327 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56328 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56329 !InitIds(cx, atomsCache)) ||
56330 !GetCallableProperty(cx, atomsCache->passUint16Array_id, &callable)) {
56331 aRv.Throw(NS_ERROR_UNEXPECTED);
56332 return;
56333 }
56334 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56335 if (!JS::Call(cx, thisValue, callable,
56336 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56337 aRv.NoteJSContextException(cx);
56338 return;
56339 }
56340}
56341
56342void
56343TestJSImplInterfaceJSImpl::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56344{
56345 CallSetup s(this, aRv, "TestJSImplInterface.passUint32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56346 if (aRv.Failed()) {
56347 return;
56348 }
56349 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56349); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56349; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56350 BindingCallContext& cx = s.GetCallContext();
56351
56352 JS::Rooted<JS::Value> rval(cx);
56353 JS::RootedVector<JS::Value> argv(cx);
56354 if (!argv.resize(1)) {
56355 // That threw an exception on the JSContext, and our CallSetup will do
56356 // the right thing with that.
56357 return;
56358 }
56359 unsigned argc = 1;
56360
56361 do {
56362 argv[0].setObject(*arg.Obj());
56363 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56364 aRv.Throw(NS_ERROR_UNEXPECTED);
56365 return;
56366 }
56367 break;
56368 } while (false);
56369
56370 JS::Rooted<JS::Value> callable(cx);
56371 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56372 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56373 !InitIds(cx, atomsCache)) ||
56374 !GetCallableProperty(cx, atomsCache->passUint32Array_id, &callable)) {
56375 aRv.Throw(NS_ERROR_UNEXPECTED);
56376 return;
56377 }
56378 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56379 if (!JS::Call(cx, thisValue, callable,
56380 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56381 aRv.NoteJSContextException(cx);
56382 return;
56383 }
56384}
56385
56386void
56387TestJSImplInterfaceJSImpl::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm)
56388{
56389 CallSetup s(this, aRv, "TestJSImplInterface.passUint8ClampedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56390 if (aRv.Failed()) {
56391 return;
56392 }
56393 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56393); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56393; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56394 BindingCallContext& cx = s.GetCallContext();
56395
56396 JS::Rooted<JS::Value> rval(cx);
56397 JS::RootedVector<JS::Value> argv(cx);
56398 if (!argv.resize(1)) {
56399 // That threw an exception on the JSContext, and our CallSetup will do
56400 // the right thing with that.
56401 return;
56402 }
56403 unsigned argc = 1;
56404
56405 do {
56406 argv[0].setObject(*arg.Obj());
56407 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56408 aRv.Throw(NS_ERROR_UNEXPECTED);
56409 return;
56410 }
56411 break;
56412 } while (false);
56413
56414 JS::Rooted<JS::Value> callable(cx);
56415 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56416 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56417 !InitIds(cx, atomsCache)) ||
56418 !GetCallableProperty(cx, atomsCache->passUint8ClampedArray_id, &callable)) {
56419 aRv.Throw(NS_ERROR_UNEXPECTED);
56420 return;
56421 }
56422 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56423 if (!JS::Call(cx, thisValue, callable,
56424 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56425 aRv.NoteJSContextException(cx);
56426 return;
56427 }
56428}
56429
56430void
56431TestJSImplInterfaceJSImpl::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56432{
56433 CallSetup s(this, aRv, "TestJSImplInterface.passFloat32Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56434 if (aRv.Failed()) {
56435 return;
56436 }
56437 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56437); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56437; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56438 BindingCallContext& cx = s.GetCallContext();
56439
56440 JS::Rooted<JS::Value> rval(cx);
56441 JS::RootedVector<JS::Value> argv(cx);
56442 if (!argv.resize(1)) {
56443 // That threw an exception on the JSContext, and our CallSetup will do
56444 // the right thing with that.
56445 return;
56446 }
56447 unsigned argc = 1;
56448
56449 do {
56450 argv[0].setObject(*arg.Obj());
56451 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56452 aRv.Throw(NS_ERROR_UNEXPECTED);
56453 return;
56454 }
56455 break;
56456 } while (false);
56457
56458 JS::Rooted<JS::Value> callable(cx);
56459 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56460 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56461 !InitIds(cx, atomsCache)) ||
56462 !GetCallableProperty(cx, atomsCache->passFloat32Array_id, &callable)) {
56463 aRv.Throw(NS_ERROR_UNEXPECTED);
56464 return;
56465 }
56466 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56467 if (!JS::Call(cx, thisValue, callable,
56468 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56469 aRv.NoteJSContextException(cx);
56470 return;
56471 }
56472}
56473
56474void
56475TestJSImplInterfaceJSImpl::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
56476{
56477 CallSetup s(this, aRv, "TestJSImplInterface.passFloat64Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56478 if (aRv.Failed()) {
56479 return;
56480 }
56481 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56481); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56481; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56482 BindingCallContext& cx = s.GetCallContext();
56483
56484 JS::Rooted<JS::Value> rval(cx);
56485 JS::RootedVector<JS::Value> argv(cx);
56486 if (!argv.resize(1)) {
56487 // That threw an exception on the JSContext, and our CallSetup will do
56488 // the right thing with that.
56489 return;
56490 }
56491 unsigned argc = 1;
56492
56493 do {
56494 argv[0].setObject(*arg.Obj());
56495 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
56496 aRv.Throw(NS_ERROR_UNEXPECTED);
56497 return;
56498 }
56499 break;
56500 } while (false);
56501
56502 JS::Rooted<JS::Value> callable(cx);
56503 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56504 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56505 !InitIds(cx, atomsCache)) ||
56506 !GetCallableProperty(cx, atomsCache->passFloat64Array_id, &callable)) {
56507 aRv.Throw(NS_ERROR_UNEXPECTED);
56508 return;
56509 }
56510 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56511 if (!JS::Call(cx, thisValue, callable,
56512 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56513 aRv.NoteJSContextException(cx);
56514 return;
56515 }
56516}
56517
56518void
56519TestJSImplInterfaceJSImpl::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56520{
56521 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56522 if (aRv.Failed()) {
56523 return;
56524 }
56525 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56525; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56526 BindingCallContext& cx = s.GetCallContext();
56527
56528 JS::Rooted<JS::Value> rval(cx);
56529 JS::RootedVector<JS::Value> argv(cx);
56530 if (!argv.resize(1)) {
56531 // That threw an exception on the JSContext, and our CallSetup will do
56532 // the right thing with that.
56533 return;
56534 }
56535 unsigned argc = 1;
56536
56537 do {
56538
56539 uint32_t length = arg.Length();
56540 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
56541 if (!returnArray) {
56542 aRv.Throw(NS_ERROR_UNEXPECTED);
56543 return;
56544 }
56545 // Scope for 'tmp'
56546 {
56547 JS::Rooted<JS::Value> tmp(cx);
56548 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
56549 // Control block to let us common up the JS_DefineElement calls when there
56550 // are different ways to succeed at wrapping the object.
56551 do {
56552 tmp.setObject(*arg[sequenceIdx0].Obj());
56553 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56554 aRv.Throw(NS_ERROR_UNEXPECTED);
56555 return;
56556 }
56557 break;
56558 } while (false);
56559 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
56560 JSPROP_ENUMERATE)) {
56561 aRv.Throw(NS_ERROR_UNEXPECTED);
56562 return;
56563 }
56564 }
56565 }
56566 argv[0].setObject(*returnArray);
56567 break;
56568 } while (false);
56569
56570 JS::Rooted<JS::Value> callable(cx);
56571 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56572 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56573 !InitIds(cx, atomsCache)) ||
56574 !GetCallableProperty(cx, atomsCache->passSequenceOfArrayBuffers_id, &callable)) {
56575 aRv.Throw(NS_ERROR_UNEXPECTED);
56576 return;
56577 }
56578 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56579 if (!JS::Call(cx, thisValue, callable,
56580 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56581 aRv.NoteJSContextException(cx);
56582 return;
56583 }
56584}
56585
56586void
56587TestJSImplInterfaceJSImpl::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56588{
56589 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56590 if (aRv.Failed()) {
56591 return;
56592 }
56593 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56593); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56593; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56594 BindingCallContext& cx = s.GetCallContext();
56595
56596 JS::Rooted<JS::Value> rval(cx);
56597 JS::RootedVector<JS::Value> argv(cx);
56598 if (!argv.resize(1)) {
56599 // That threw an exception on the JSContext, and our CallSetup will do
56600 // the right thing with that.
56601 return;
56602 }
56603 unsigned argc = 1;
56604
56605 do {
56606
56607 uint32_t length = arg.Length();
56608 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
56609 if (!returnArray) {
56610 aRv.Throw(NS_ERROR_UNEXPECTED);
56611 return;
56612 }
56613 // Scope for 'tmp'
56614 {
56615 JS::Rooted<JS::Value> tmp(cx);
56616 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
56617 // Control block to let us common up the JS_DefineElement calls when there
56618 // are different ways to succeed at wrapping the object.
56619 do {
56620 if (arg[sequenceIdx0].IsNull()) {
56621 tmp.setNull();
56622 break;
56623 }
56624 tmp.setObject(*arg[sequenceIdx0].Value().Obj());
56625 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56626 aRv.Throw(NS_ERROR_UNEXPECTED);
56627 return;
56628 }
56629 break;
56630 } while (false);
56631 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
56632 JSPROP_ENUMERATE)) {
56633 aRv.Throw(NS_ERROR_UNEXPECTED);
56634 return;
56635 }
56636 }
56637 }
56638 argv[0].setObject(*returnArray);
56639 break;
56640 } while (false);
56641
56642 JS::Rooted<JS::Value> callable(cx);
56643 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56644 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56645 !InitIds(cx, atomsCache)) ||
56646 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableArrayBuffers_id, &callable)) {
56647 aRv.Throw(NS_ERROR_UNEXPECTED);
56648 return;
56649 }
56650 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56651 if (!JS::Call(cx, thisValue, callable,
56652 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56653 aRv.NoteJSContextException(cx);
56654 return;
56655 }
56656}
56657
56658void
56659TestJSImplInterfaceJSImpl::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56660{
56661 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56662 if (aRv.Failed()) {
56663 return;
56664 }
56665 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56665); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56665; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56666 BindingCallContext& cx = s.GetCallContext();
56667
56668 JS::Rooted<JS::Value> rval(cx);
56669 JS::RootedVector<JS::Value> argv(cx);
56670 if (!argv.resize(1)) {
56671 // That threw an exception on the JSContext, and our CallSetup will do
56672 // the right thing with that.
56673 return;
56674 }
56675 unsigned argc = 1;
56676
56677 do {
56678
56679 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
56680 if (!returnObj) {
56681 aRv.Throw(NS_ERROR_UNEXPECTED);
56682 return;
56683 }
56684 // Scope for 'tmp'
56685 {
56686 JS::Rooted<JS::Value> tmp(cx);
56687 for (auto& entry : arg.Entries()) {
56688 auto& recordValue0 = entry.mValue;
56689 // Control block to let us common up the JS_DefineUCProperty calls when there
56690 // are different ways to succeed at wrapping the value.
56691 do {
56692 tmp.setObject(*recordValue0.Obj());
56693 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56694 aRv.Throw(NS_ERROR_UNEXPECTED);
56695 return;
56696 }
56697 break;
56698 } while (false);
56699 if (!JS_DefineUCProperty(cx, returnObj,
56700 entry.mKey.BeginReading(),
56701 entry.mKey.Length(), tmp,
56702 JSPROP_ENUMERATE)) {
56703 aRv.Throw(NS_ERROR_UNEXPECTED);
56704 return;
56705 }
56706 }
56707 }
56708 argv[0].setObject(*returnObj);
56709 break;
56710 } while (false);
56711
56712 JS::Rooted<JS::Value> callable(cx);
56713 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56714 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56715 !InitIds(cx, atomsCache)) ||
56716 !GetCallableProperty(cx, atomsCache->passRecordOfArrayBuffers_id, &callable)) {
56717 aRv.Throw(NS_ERROR_UNEXPECTED);
56718 return;
56719 }
56720 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56721 if (!JS::Call(cx, thisValue, callable,
56722 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56723 aRv.NoteJSContextException(cx);
56724 return;
56725 }
56726}
56727
56728void
56729TestJSImplInterfaceJSImpl::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56730{
56731 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableArrayBuffers", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56732 if (aRv.Failed()) {
56733 return;
56734 }
56735 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56735); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56735; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56736 BindingCallContext& cx = s.GetCallContext();
56737
56738 JS::Rooted<JS::Value> rval(cx);
56739 JS::RootedVector<JS::Value> argv(cx);
56740 if (!argv.resize(1)) {
56741 // That threw an exception on the JSContext, and our CallSetup will do
56742 // the right thing with that.
56743 return;
56744 }
56745 unsigned argc = 1;
56746
56747 do {
56748
56749 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
56750 if (!returnObj) {
56751 aRv.Throw(NS_ERROR_UNEXPECTED);
56752 return;
56753 }
56754 // Scope for 'tmp'
56755 {
56756 JS::Rooted<JS::Value> tmp(cx);
56757 for (auto& entry : arg.Entries()) {
56758 auto& recordValue0 = entry.mValue;
56759 // Control block to let us common up the JS_DefineUCProperty calls when there
56760 // are different ways to succeed at wrapping the value.
56761 do {
56762 if (recordValue0.IsNull()) {
56763 tmp.setNull();
56764 break;
56765 }
56766 tmp.setObject(*recordValue0.Value().Obj());
56767 if (!MaybeWrapNonDOMObjectValue(cx, &tmp)) {
56768 aRv.Throw(NS_ERROR_UNEXPECTED);
56769 return;
56770 }
56771 break;
56772 } while (false);
56773 if (!JS_DefineUCProperty(cx, returnObj,
56774 entry.mKey.BeginReading(),
56775 entry.mKey.Length(), tmp,
56776 JSPROP_ENUMERATE)) {
56777 aRv.Throw(NS_ERROR_UNEXPECTED);
56778 return;
56779 }
56780 }
56781 }
56782 argv[0].setObject(*returnObj);
56783 break;
56784 } while (false);
56785
56786 JS::Rooted<JS::Value> callable(cx);
56787 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56788 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56789 !InitIds(cx, atomsCache)) ||
56790 !GetCallableProperty(cx, atomsCache->passRecordOfNullableArrayBuffers_id, &callable)) {
56791 aRv.Throw(NS_ERROR_UNEXPECTED);
56792 return;
56793 }
56794 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56795 if (!JS::Call(cx, thisValue, callable,
56796 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56797 aRv.NoteJSContextException(cx);
56798 return;
56799 }
56800}
56801
56802void
56803TestJSImplInterfaceJSImpl::PassVariadicTypedArray(const nsTArray<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56804{
56805 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56806 if (aRv.Failed()) {
56807 return;
56808 }
56809 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56809); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56809; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56810 BindingCallContext& cx = s.GetCallContext();
56811
56812 JS::Rooted<JS::Value> rval(cx);
56813 JS::RootedVector<JS::Value> argv(cx);
56814 if (!argv.resize((1 - 1) + arg.Length())) {
56815 // That threw an exception on the JSContext, and our CallSetup will do
56816 // the right thing with that.
56817 return;
56818 }
56819 unsigned argc = (1 - 1) + arg.Length();
56820
56821 do {
56822 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
56823 argv[0 + idx].setObject(*arg[idx].Obj());
56824 if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) {
56825 aRv.Throw(NS_ERROR_UNEXPECTED);
56826 return;
56827 }
56828 continue;
56829 }
56830 break;
56831 } while (false);
56832
56833 JS::Rooted<JS::Value> callable(cx);
56834 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56835 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56836 !InitIds(cx, atomsCache)) ||
56837 !GetCallableProperty(cx, atomsCache->passVariadicTypedArray_id, &callable)) {
56838 aRv.Throw(NS_ERROR_UNEXPECTED);
56839 return;
56840 }
56841 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56842 if (!JS::Call(cx, thisValue, callable,
56843 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56844 aRv.NoteJSContextException(cx);
56845 return;
56846 }
56847}
56848
56849void
56850TestJSImplInterfaceJSImpl::PassVariadicNullableTypedArray(const nsTArray<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
56851{
56852 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableTypedArray", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56853 if (aRv.Failed()) {
56854 return;
56855 }
56856 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56856); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56856; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56857 BindingCallContext& cx = s.GetCallContext();
56858
56859 JS::Rooted<JS::Value> rval(cx);
56860 JS::RootedVector<JS::Value> argv(cx);
56861 if (!argv.resize((1 - 1) + arg.Length())) {
56862 // That threw an exception on the JSContext, and our CallSetup will do
56863 // the right thing with that.
56864 return;
56865 }
56866 unsigned argc = (1 - 1) + arg.Length();
56867
56868 do {
56869 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
56870 if (arg[idx].IsNull()) {
56871 argv[0 + idx].setNull();
56872 continue;
56873 }
56874 argv[0 + idx].setObject(*arg[idx].Value().Obj());
56875 if (!MaybeWrapNonDOMObjectValue(cx, argv[0 + idx])) {
56876 aRv.Throw(NS_ERROR_UNEXPECTED);
56877 return;
56878 }
56879 continue;
56880 }
56881 break;
56882 } while (false);
56883
56884 JS::Rooted<JS::Value> callable(cx);
56885 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56886 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56887 !InitIds(cx, atomsCache)) ||
56888 !GetCallableProperty(cx, atomsCache->passVariadicNullableTypedArray_id, &callable)) {
56889 aRv.Throw(NS_ERROR_UNEXPECTED);
56890 return;
56891 }
56892 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56893 if (!JS::Call(cx, thisValue, callable,
56894 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56895 aRv.NoteJSContextException(cx);
56896 return;
56897 }
56898}
56899
56900void
56901TestJSImplInterfaceJSImpl::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
56902{
56903 CallSetup s(this, aRv, "TestJSImplInterface.receiveUint8Array", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56904 if (aRv.Failed()) {
56905 return;
56906 }
56907 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56907); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56907; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56908 BindingCallContext& cx = s.GetCallContext();
56909
56910 JS::Rooted<JS::Value> rval(cx);
56911
56912 JS::Rooted<JS::Value> callable(cx);
56913 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56914 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56915 !InitIds(cx, atomsCache)) ||
56916 !GetCallableProperty(cx, atomsCache->receiveUint8Array_id, &callable)) {
56917 aRv.Throw(NS_ERROR_UNEXPECTED);
56918 return;
56919 }
56920 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56921 if (!JS::Call(cx, thisValue, callable,
56922 JS::HandleValueArray::empty(), &rval)) {
56923 aRv.NoteJSContextException(cx);
56924 return;
56925 }
56926 RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx);
56927 if (rval.isObject()) {
56928 if (!rvalDecl.Init(&rval.toObject())) {
56929 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.receiveUint8Array", "Uint8Array");
56930 aRv.Throw(NS_ERROR_UNEXPECTED);
56931 return;
56932 }
56933 if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) {
56934 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.receiveUint8Array");
56935 aRv.Throw(NS_ERROR_UNEXPECTED);
56936 return;
56937 }
56938 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
56939 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.receiveUint8Array");
56940 aRv.Throw(NS_ERROR_UNEXPECTED);
56941 return;
56942 }
56943 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
56944 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.receiveUint8Array");
56945 aRv.Throw(NS_ERROR_UNEXPECTED);
56946 return;
56947 }
56948 } else {
56949 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveUint8Array");
56950 aRv.Throw(NS_ERROR_UNEXPECTED);
56951 return;
56952 }
56953 aRetVal.set(rvalDecl.Obj());
56954}
56955
56956void
56957TestJSImplInterfaceJSImpl::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
56958{
56959 CallSetup s(this, aRv, "TestJSImplInterface.passString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
56960 if (aRv.Failed()) {
56961 return;
56962 }
56963 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 56963); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 56963; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
56964 BindingCallContext& cx = s.GetCallContext();
56965
56966 JS::Rooted<JS::Value> rval(cx);
56967 JS::RootedVector<JS::Value> argv(cx);
56968 if (!argv.resize(1)) {
56969 // That threw an exception on the JSContext, and our CallSetup will do
56970 // the right thing with that.
56971 return;
56972 }
56973 unsigned argc = 1;
56974
56975 do {
56976 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
56977 aRv.Throw(NS_ERROR_UNEXPECTED);
56978 return;
56979 }
56980 break;
56981 } while (false);
56982
56983 JS::Rooted<JS::Value> callable(cx);
56984 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
56985 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
56986 !InitIds(cx, atomsCache)) ||
56987 !GetCallableProperty(cx, atomsCache->passString_id, &callable)) {
56988 aRv.Throw(NS_ERROR_UNEXPECTED);
56989 return;
56990 }
56991 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
56992 if (!JS::Call(cx, thisValue, callable,
56993 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
56994 aRv.NoteJSContextException(cx);
56995 return;
56996 }
56997}
56998
56999void
57000TestJSImplInterfaceJSImpl::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57001{
57002 CallSetup s(this, aRv, "TestJSImplInterface.passNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57003 if (aRv.Failed()) {
57004 return;
57005 }
57006 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57006); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57006; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57007 BindingCallContext& cx = s.GetCallContext();
57008
57009 JS::Rooted<JS::Value> rval(cx);
57010 JS::RootedVector<JS::Value> argv(cx);
57011 if (!argv.resize(1)) {
57012 // That threw an exception on the JSContext, and our CallSetup will do
57013 // the right thing with that.
57014 return;
57015 }
57016 unsigned argc = 1;
57017
57018 do {
57019 if (!xpc::StringToJsval(cx, arg, argv[0])) {
57020 aRv.Throw(NS_ERROR_UNEXPECTED);
57021 return;
57022 }
57023 break;
57024 } while (false);
57025
57026 JS::Rooted<JS::Value> callable(cx);
57027 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57028 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57029 !InitIds(cx, atomsCache)) ||
57030 !GetCallableProperty(cx, atomsCache->passNullableString_id, &callable)) {
57031 aRv.Throw(NS_ERROR_UNEXPECTED);
57032 return;
57033 }
57034 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57035 if (!JS::Call(cx, thisValue, callable,
57036 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57037 aRv.NoteJSContextException(cx);
57038 return;
57039 }
57040}
57041
57042void
57043TestJSImplInterfaceJSImpl::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57044{
57045 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57046 if (aRv.Failed()) {
57047 return;
57048 }
57049 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57049); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57049; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57050 BindingCallContext& cx = s.GetCallContext();
57051
57052 JS::Rooted<JS::Value> rval(cx);
57053 JS::RootedVector<JS::Value> argv(cx);
57054 if (!argv.resize(1)) {
57055 // That threw an exception on the JSContext, and our CallSetup will do
57056 // the right thing with that.
57057 return;
57058 }
57059 unsigned argc = 1;
57060
57061 do {
57062 if (arg.WasPassed()) {
57063 if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) {
57064 aRv.Throw(NS_ERROR_UNEXPECTED);
57065 return;
57066 }
57067 break;
57068 } else if (argc == 1) {
57069 // This is our current trailing argument; reduce argc
57070 --argc;
57071 } else {
57072 argv[0].setUndefined();
57073 }
57074 } while (false);
57075
57076 JS::Rooted<JS::Value> callable(cx);
57077 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57078 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57079 !InitIds(cx, atomsCache)) ||
57080 !GetCallableProperty(cx, atomsCache->passOptionalString_id, &callable)) {
57081 aRv.Throw(NS_ERROR_UNEXPECTED);
57082 return;
57083 }
57084 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57085 if (!JS::Call(cx, thisValue, callable,
57086 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57087 aRv.NoteJSContextException(cx);
57088 return;
57089 }
57090}
57091
57092void
57093TestJSImplInterfaceJSImpl::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57094{
57095 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57096 if (aRv.Failed()) {
57097 return;
57098 }
57099 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57099); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57099; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57100 BindingCallContext& cx = s.GetCallContext();
57101
57102 JS::Rooted<JS::Value> rval(cx);
57103 JS::RootedVector<JS::Value> argv(cx);
57104 if (!argv.resize(1)) {
57105 // That threw an exception on the JSContext, and our CallSetup will do
57106 // the right thing with that.
57107 return;
57108 }
57109 unsigned argc = 1;
57110
57111 do {
57112 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
57113 aRv.Throw(NS_ERROR_UNEXPECTED);
57114 return;
57115 }
57116 break;
57117 } while (false);
57118
57119 JS::Rooted<JS::Value> callable(cx);
57120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57122 !InitIds(cx, atomsCache)) ||
57123 !GetCallableProperty(cx, atomsCache->passOptionalStringWithDefaultValue_id, &callable)) {
57124 aRv.Throw(NS_ERROR_UNEXPECTED);
57125 return;
57126 }
57127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57128 if (!JS::Call(cx, thisValue, callable,
57129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57130 aRv.NoteJSContextException(cx);
57131 return;
57132 }
57133}
57134
57135void
57136TestJSImplInterfaceJSImpl::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57137{
57138 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57139 if (aRv.Failed()) {
57140 return;
57141 }
57142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57142; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57143 BindingCallContext& cx = s.GetCallContext();
57144
57145 JS::Rooted<JS::Value> rval(cx);
57146 JS::RootedVector<JS::Value> argv(cx);
57147 if (!argv.resize(1)) {
57148 // That threw an exception on the JSContext, and our CallSetup will do
57149 // the right thing with that.
57150 return;
57151 }
57152 unsigned argc = 1;
57153
57154 do {
57155 if (arg.WasPassed()) {
57156 if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) {
57157 aRv.Throw(NS_ERROR_UNEXPECTED);
57158 return;
57159 }
57160 break;
57161 } else if (argc == 1) {
57162 // This is our current trailing argument; reduce argc
57163 --argc;
57164 } else {
57165 argv[0].setUndefined();
57166 }
57167 } while (false);
57168
57169 JS::Rooted<JS::Value> callable(cx);
57170 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57171 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57172 !InitIds(cx, atomsCache)) ||
57173 !GetCallableProperty(cx, atomsCache->passOptionalNullableString_id, &callable)) {
57174 aRv.Throw(NS_ERROR_UNEXPECTED);
57175 return;
57176 }
57177 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57178 if (!JS::Call(cx, thisValue, callable,
57179 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57180 aRv.NoteJSContextException(cx);
57181 return;
57182 }
57183}
57184
57185void
57186TestJSImplInterfaceJSImpl::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57187{
57188 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57189 if (aRv.Failed()) {
57190 return;
57191 }
57192 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57192); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57192; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57193 BindingCallContext& cx = s.GetCallContext();
57194
57195 JS::Rooted<JS::Value> rval(cx);
57196 JS::RootedVector<JS::Value> argv(cx);
57197 if (!argv.resize(1)) {
57198 // That threw an exception on the JSContext, and our CallSetup will do
57199 // the right thing with that.
57200 return;
57201 }
57202 unsigned argc = 1;
57203
57204 do {
57205 if (!xpc::StringToJsval(cx, arg, argv[0])) {
57206 aRv.Throw(NS_ERROR_UNEXPECTED);
57207 return;
57208 }
57209 break;
57210 } while (false);
57211
57212 JS::Rooted<JS::Value> callable(cx);
57213 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57214 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57215 !InitIds(cx, atomsCache)) ||
57216 !GetCallableProperty(cx, atomsCache->passOptionalNullableStringWithDefaultValue_id, &callable)) {
57217 aRv.Throw(NS_ERROR_UNEXPECTED);
57218 return;
57219 }
57220 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57221 if (!JS::Call(cx, thisValue, callable,
57222 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57223 aRv.NoteJSContextException(cx);
57224 return;
57225 }
57226}
57227
57228void
57229TestJSImplInterfaceJSImpl::PassVariadicString(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57230{
57231 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57232 if (aRv.Failed()) {
57233 return;
57234 }
57235 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57235); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57235; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57236 BindingCallContext& cx = s.GetCallContext();
57237
57238 JS::Rooted<JS::Value> rval(cx);
57239 JS::RootedVector<JS::Value> argv(cx);
57240 if (!argv.resize((1 - 1) + arg.Length())) {
57241 // That threw an exception on the JSContext, and our CallSetup will do
57242 // the right thing with that.
57243 return;
57244 }
57245 unsigned argc = (1 - 1) + arg.Length();
57246
57247 do {
57248 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
57249 if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) {
57250 aRv.Throw(NS_ERROR_UNEXPECTED);
57251 return;
57252 }
57253 continue;
57254 }
57255 break;
57256 } while (false);
57257
57258 JS::Rooted<JS::Value> callable(cx);
57259 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57260 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57261 !InitIds(cx, atomsCache)) ||
57262 !GetCallableProperty(cx, atomsCache->passVariadicString_id, &callable)) {
57263 aRv.Throw(NS_ERROR_UNEXPECTED);
57264 return;
57265 }
57266 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57267 if (!JS::Call(cx, thisValue, callable,
57268 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57269 aRv.NoteJSContextException(cx);
57270 return;
57271 }
57272}
57273
57274void
57275TestJSImplInterfaceJSImpl::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57276{
57277 CallSetup s(this, aRv, "TestJSImplInterface.passByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57278 if (aRv.Failed()) {
57279 return;
57280 }
57281 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57281); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57281; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57282 BindingCallContext& cx = s.GetCallContext();
57283
57284 JS::Rooted<JS::Value> rval(cx);
57285 JS::RootedVector<JS::Value> argv(cx);
57286 if (!argv.resize(1)) {
57287 // That threw an exception on the JSContext, and our CallSetup will do
57288 // the right thing with that.
57289 return;
57290 }
57291 unsigned argc = 1;
57292
57293 do {
57294 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
57295 aRv.Throw(NS_ERROR_UNEXPECTED);
57296 return;
57297 }
57298 break;
57299 } while (false);
57300
57301 JS::Rooted<JS::Value> callable(cx);
57302 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57303 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57304 !InitIds(cx, atomsCache)) ||
57305 !GetCallableProperty(cx, atomsCache->passByteString_id, &callable)) {
57306 aRv.Throw(NS_ERROR_UNEXPECTED);
57307 return;
57308 }
57309 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57310 if (!JS::Call(cx, thisValue, callable,
57311 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57312 aRv.NoteJSContextException(cx);
57313 return;
57314 }
57315}
57316
57317void
57318TestJSImplInterfaceJSImpl::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57319{
57320 CallSetup s(this, aRv, "TestJSImplInterface.passNullableByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57321 if (aRv.Failed()) {
57322 return;
57323 }
57324 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57324); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57324; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57325 BindingCallContext& cx = s.GetCallContext();
57326
57327 JS::Rooted<JS::Value> rval(cx);
57328 JS::RootedVector<JS::Value> argv(cx);
57329 if (!argv.resize(1)) {
57330 // That threw an exception on the JSContext, and our CallSetup will do
57331 // the right thing with that.
57332 return;
57333 }
57334 unsigned argc = 1;
57335
57336 do {
57337 if (!ByteStringToJsval(cx, arg, argv[0])) {
57338 aRv.Throw(NS_ERROR_UNEXPECTED);
57339 return;
57340 }
57341 break;
57342 } while (false);
57343
57344 JS::Rooted<JS::Value> callable(cx);
57345 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57346 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57347 !InitIds(cx, atomsCache)) ||
57348 !GetCallableProperty(cx, atomsCache->passNullableByteString_id, &callable)) {
57349 aRv.Throw(NS_ERROR_UNEXPECTED);
57350 return;
57351 }
57352 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57353 if (!JS::Call(cx, thisValue, callable,
57354 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57355 aRv.NoteJSContextException(cx);
57356 return;
57357 }
57358}
57359
57360void
57361TestJSImplInterfaceJSImpl::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57362{
57363 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57364 if (aRv.Failed()) {
57365 return;
57366 }
57367 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57367); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57367; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57368 BindingCallContext& cx = s.GetCallContext();
57369
57370 JS::Rooted<JS::Value> rval(cx);
57371 JS::RootedVector<JS::Value> argv(cx);
57372 if (!argv.resize(1)) {
57373 // That threw an exception on the JSContext, and our CallSetup will do
57374 // the right thing with that.
57375 return;
57376 }
57377 unsigned argc = 1;
57378
57379 do {
57380 if (arg.WasPassed()) {
57381 if (!NonVoidByteStringToJsval(cx, arg.Value(), argv[0])) {
57382 aRv.Throw(NS_ERROR_UNEXPECTED);
57383 return;
57384 }
57385 break;
57386 } else if (argc == 1) {
57387 // This is our current trailing argument; reduce argc
57388 --argc;
57389 } else {
57390 argv[0].setUndefined();
57391 }
57392 } while (false);
57393
57394 JS::Rooted<JS::Value> callable(cx);
57395 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57396 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57397 !InitIds(cx, atomsCache)) ||
57398 !GetCallableProperty(cx, atomsCache->passOptionalByteString_id, &callable)) {
57399 aRv.Throw(NS_ERROR_UNEXPECTED);
57400 return;
57401 }
57402 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57403 if (!JS::Call(cx, thisValue, callable,
57404 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57405 aRv.NoteJSContextException(cx);
57406 return;
57407 }
57408}
57409
57410void
57411TestJSImplInterfaceJSImpl::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57412{
57413 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57414 if (aRv.Failed()) {
57415 return;
57416 }
57417 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57417); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57417; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57418 BindingCallContext& cx = s.GetCallContext();
57419
57420 JS::Rooted<JS::Value> rval(cx);
57421 JS::RootedVector<JS::Value> argv(cx);
57422 if (!argv.resize(1)) {
57423 // That threw an exception on the JSContext, and our CallSetup will do
57424 // the right thing with that.
57425 return;
57426 }
57427 unsigned argc = 1;
57428
57429 do {
57430 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
57431 aRv.Throw(NS_ERROR_UNEXPECTED);
57432 return;
57433 }
57434 break;
57435 } while (false);
57436
57437 JS::Rooted<JS::Value> callable(cx);
57438 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57439 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57440 !InitIds(cx, atomsCache)) ||
57441 !GetCallableProperty(cx, atomsCache->passOptionalByteStringWithDefaultValue_id, &callable)) {
57442 aRv.Throw(NS_ERROR_UNEXPECTED);
57443 return;
57444 }
57445 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57446 if (!JS::Call(cx, thisValue, callable,
57447 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57448 aRv.NoteJSContextException(cx);
57449 return;
57450 }
57451}
57452
57453void
57454TestJSImplInterfaceJSImpl::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57455{
57456 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57457 if (aRv.Failed()) {
57458 return;
57459 }
57460 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57460); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57460; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57461 BindingCallContext& cx = s.GetCallContext();
57462
57463 JS::Rooted<JS::Value> rval(cx);
57464 JS::RootedVector<JS::Value> argv(cx);
57465 if (!argv.resize(1)) {
57466 // That threw an exception on the JSContext, and our CallSetup will do
57467 // the right thing with that.
57468 return;
57469 }
57470 unsigned argc = 1;
57471
57472 do {
57473 if (arg.WasPassed()) {
57474 if (!ByteStringToJsval(cx, arg.Value(), argv[0])) {
57475 aRv.Throw(NS_ERROR_UNEXPECTED);
57476 return;
57477 }
57478 break;
57479 } else if (argc == 1) {
57480 // This is our current trailing argument; reduce argc
57481 --argc;
57482 } else {
57483 argv[0].setUndefined();
57484 }
57485 } while (false);
57486
57487 JS::Rooted<JS::Value> callable(cx);
57488 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57489 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57490 !InitIds(cx, atomsCache)) ||
57491 !GetCallableProperty(cx, atomsCache->passOptionalNullableByteString_id, &callable)) {
57492 aRv.Throw(NS_ERROR_UNEXPECTED);
57493 return;
57494 }
57495 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57496 if (!JS::Call(cx, thisValue, callable,
57497 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57498 aRv.NoteJSContextException(cx);
57499 return;
57500 }
57501}
57502
57503void
57504TestJSImplInterfaceJSImpl::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57505{
57506 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57507 if (aRv.Failed()) {
57508 return;
57509 }
57510 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57510); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57510; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57511 BindingCallContext& cx = s.GetCallContext();
57512
57513 JS::Rooted<JS::Value> rval(cx);
57514 JS::RootedVector<JS::Value> argv(cx);
57515 if (!argv.resize(1)) {
57516 // That threw an exception on the JSContext, and our CallSetup will do
57517 // the right thing with that.
57518 return;
57519 }
57520 unsigned argc = 1;
57521
57522 do {
57523 if (!ByteStringToJsval(cx, arg, argv[0])) {
57524 aRv.Throw(NS_ERROR_UNEXPECTED);
57525 return;
57526 }
57527 break;
57528 } while (false);
57529
57530 JS::Rooted<JS::Value> callable(cx);
57531 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57532 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57533 !InitIds(cx, atomsCache)) ||
57534 !GetCallableProperty(cx, atomsCache->passOptionalNullableByteStringWithDefaultValue_id, &callable)) {
57535 aRv.Throw(NS_ERROR_UNEXPECTED);
57536 return;
57537 }
57538 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57539 if (!JS::Call(cx, thisValue, callable,
57540 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57541 aRv.NoteJSContextException(cx);
57542 return;
57543 }
57544}
57545
57546void
57547TestJSImplInterfaceJSImpl::PassVariadicByteString(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57548{
57549 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57550 if (aRv.Failed()) {
57551 return;
57552 }
57553 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57553); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57553; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57554 BindingCallContext& cx = s.GetCallContext();
57555
57556 JS::Rooted<JS::Value> rval(cx);
57557 JS::RootedVector<JS::Value> argv(cx);
57558 if (!argv.resize((1 - 1) + arg.Length())) {
57559 // That threw an exception on the JSContext, and our CallSetup will do
57560 // the right thing with that.
57561 return;
57562 }
57563 unsigned argc = (1 - 1) + arg.Length();
57564
57565 do {
57566 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
57567 if (!NonVoidByteStringToJsval(cx, arg[idx], argv[0 + idx])) {
57568 aRv.Throw(NS_ERROR_UNEXPECTED);
57569 return;
57570 }
57571 continue;
57572 }
57573 break;
57574 } while (false);
57575
57576 JS::Rooted<JS::Value> callable(cx);
57577 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57578 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57579 !InitIds(cx, atomsCache)) ||
57580 !GetCallableProperty(cx, atomsCache->passVariadicByteString_id, &callable)) {
57581 aRv.Throw(NS_ERROR_UNEXPECTED);
57582 return;
57583 }
57584 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57585 if (!JS::Call(cx, thisValue, callable,
57586 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57587 aRv.NoteJSContextException(cx);
57588 return;
57589 }
57590}
57591
57592void
57593TestJSImplInterfaceJSImpl::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
57594{
57595 CallSetup s(this, aRv, "TestJSImplInterface.passUnionByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57596 if (aRv.Failed()) {
57597 return;
57598 }
57599 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57599); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57599; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57600 BindingCallContext& cx = s.GetCallContext();
57601
57602 JS::Rooted<JS::Value> rval(cx);
57603 JS::RootedVector<JS::Value> argv(cx);
57604 if (!argv.resize(1)) {
57605 // That threw an exception on the JSContext, and our CallSetup will do
57606 // the right thing with that.
57607 return;
57608 }
57609 unsigned argc = 1;
57610
57611 do {
57612 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57613 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
57614 aRv.Throw(NS_ERROR_UNEXPECTED);
57615 return;
57616 }
57617 break;
57618 } while (false);
57619
57620 JS::Rooted<JS::Value> callable(cx);
57621 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57622 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57623 !InitIds(cx, atomsCache)) ||
57624 !GetCallableProperty(cx, atomsCache->passUnionByteString_id, &callable)) {
57625 aRv.Throw(NS_ERROR_UNEXPECTED);
57626 return;
57627 }
57628 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57629 if (!JS::Call(cx, thisValue, callable,
57630 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57631 aRv.NoteJSContextException(cx);
57632 return;
57633 }
57634}
57635
57636void
57637TestJSImplInterfaceJSImpl::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57638{
57639 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57640 if (aRv.Failed()) {
57641 return;
57642 }
57643 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57643); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57643; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57644 BindingCallContext& cx = s.GetCallContext();
57645
57646 JS::Rooted<JS::Value> rval(cx);
57647 JS::RootedVector<JS::Value> argv(cx);
57648 if (!argv.resize(1)) {
57649 // That threw an exception on the JSContext, and our CallSetup will do
57650 // the right thing with that.
57651 return;
57652 }
57653 unsigned argc = 1;
57654
57655 do {
57656 if (arg.WasPassed()) {
57657 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57658 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
57659 aRv.Throw(NS_ERROR_UNEXPECTED);
57660 return;
57661 }
57662 break;
57663 } else if (argc == 1) {
57664 // This is our current trailing argument; reduce argc
57665 --argc;
57666 } else {
57667 argv[0].setUndefined();
57668 }
57669 } while (false);
57670
57671 JS::Rooted<JS::Value> callable(cx);
57672 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57673 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57674 !InitIds(cx, atomsCache)) ||
57675 !GetCallableProperty(cx, atomsCache->passOptionalUnionByteString_id, &callable)) {
57676 aRv.Throw(NS_ERROR_UNEXPECTED);
57677 return;
57678 }
57679 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57680 if (!JS::Call(cx, thisValue, callable,
57681 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57682 aRv.NoteJSContextException(cx);
57683 return;
57684 }
57685}
57686
57687void
57688TestJSImplInterfaceJSImpl::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
57689{
57690 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionByteStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57691 if (aRv.Failed()) {
57692 return;
57693 }
57694 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57694; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57695 BindingCallContext& cx = s.GetCallContext();
57696
57697 JS::Rooted<JS::Value> rval(cx);
57698 JS::RootedVector<JS::Value> argv(cx);
57699 if (!argv.resize(1)) {
57700 // That threw an exception on the JSContext, and our CallSetup will do
57701 // the right thing with that.
57702 return;
57703 }
57704 unsigned argc = 1;
57705
57706 do {
57707 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
57708 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
57709 aRv.Throw(NS_ERROR_UNEXPECTED);
57710 return;
57711 }
57712 break;
57713 } while (false);
57714
57715 JS::Rooted<JS::Value> callable(cx);
57716 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57717 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57718 !InitIds(cx, atomsCache)) ||
57719 !GetCallableProperty(cx, atomsCache->passOptionalUnionByteStringWithDefaultValue_id, &callable)) {
57720 aRv.Throw(NS_ERROR_UNEXPECTED);
57721 return;
57722 }
57723 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57724 if (!JS::Call(cx, thisValue, callable,
57725 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57726 aRv.NoteJSContextException(cx);
57727 return;
57728 }
57729}
57730
57731void
57732TestJSImplInterfaceJSImpl::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57733{
57734 CallSetup s(this, aRv, "TestJSImplInterface.passUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57735 if (aRv.Failed()) {
57736 return;
57737 }
57738 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57738); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57738; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57739 BindingCallContext& cx = s.GetCallContext();
57740
57741 JS::Rooted<JS::Value> rval(cx);
57742 JS::RootedVector<JS::Value> argv(cx);
57743 if (!argv.resize(1)) {
57744 // That threw an exception on the JSContext, and our CallSetup will do
57745 // the right thing with that.
57746 return;
57747 }
57748 unsigned argc = 1;
57749
57750 do {
57751 if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) {
57752 aRv.Throw(NS_ERROR_UNEXPECTED);
57753 return;
57754 }
57755 break;
57756 } while (false);
57757
57758 JS::Rooted<JS::Value> callable(cx);
57759 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57760 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57761 !InitIds(cx, atomsCache)) ||
57762 !GetCallableProperty(cx, atomsCache->passUTF8String_id, &callable)) {
57763 aRv.Throw(NS_ERROR_UNEXPECTED);
57764 return;
57765 }
57766 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57767 if (!JS::Call(cx, thisValue, callable,
57768 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57769 aRv.NoteJSContextException(cx);
57770 return;
57771 }
57772}
57773
57774void
57775TestJSImplInterfaceJSImpl::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57776{
57777 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57778 if (aRv.Failed()) {
57779 return;
57780 }
57781 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57781); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57781; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57782 BindingCallContext& cx = s.GetCallContext();
57783
57784 JS::Rooted<JS::Value> rval(cx);
57785 JS::RootedVector<JS::Value> argv(cx);
57786 if (!argv.resize(1)) {
57787 // That threw an exception on the JSContext, and our CallSetup will do
57788 // the right thing with that.
57789 return;
57790 }
57791 unsigned argc = 1;
57792
57793 do {
57794 if (!UTF8StringToJsval(cx, arg, argv[0])) {
57795 aRv.Throw(NS_ERROR_UNEXPECTED);
57796 return;
57797 }
57798 break;
57799 } while (false);
57800
57801 JS::Rooted<JS::Value> callable(cx);
57802 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57803 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57804 !InitIds(cx, atomsCache)) ||
57805 !GetCallableProperty(cx, atomsCache->passNullableUTF8String_id, &callable)) {
57806 aRv.Throw(NS_ERROR_UNEXPECTED);
57807 return;
57808 }
57809 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57810 if (!JS::Call(cx, thisValue, callable,
57811 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57812 aRv.NoteJSContextException(cx);
57813 return;
57814 }
57815}
57816
57817void
57818TestJSImplInterfaceJSImpl::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57819{
57820 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57821 if (aRv.Failed()) {
57822 return;
57823 }
57824 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57824); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57824; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57825 BindingCallContext& cx = s.GetCallContext();
57826
57827 JS::Rooted<JS::Value> rval(cx);
57828 JS::RootedVector<JS::Value> argv(cx);
57829 if (!argv.resize(1)) {
57830 // That threw an exception on the JSContext, and our CallSetup will do
57831 // the right thing with that.
57832 return;
57833 }
57834 unsigned argc = 1;
57835
57836 do {
57837 if (arg.WasPassed()) {
57838 if (!NonVoidUTF8StringToJsval(cx, arg.Value(), argv[0])) {
57839 aRv.Throw(NS_ERROR_UNEXPECTED);
57840 return;
57841 }
57842 break;
57843 } else if (argc == 1) {
57844 // This is our current trailing argument; reduce argc
57845 --argc;
57846 } else {
57847 argv[0].setUndefined();
57848 }
57849 } while (false);
57850
57851 JS::Rooted<JS::Value> callable(cx);
57852 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57853 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57854 !InitIds(cx, atomsCache)) ||
57855 !GetCallableProperty(cx, atomsCache->passOptionalUTF8String_id, &callable)) {
57856 aRv.Throw(NS_ERROR_UNEXPECTED);
57857 return;
57858 }
57859 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57860 if (!JS::Call(cx, thisValue, callable,
57861 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57862 aRv.NoteJSContextException(cx);
57863 return;
57864 }
57865}
57866
57867void
57868TestJSImplInterfaceJSImpl::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57869{
57870 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57871 if (aRv.Failed()) {
57872 return;
57873 }
57874 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57874; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57875 BindingCallContext& cx = s.GetCallContext();
57876
57877 JS::Rooted<JS::Value> rval(cx);
57878 JS::RootedVector<JS::Value> argv(cx);
57879 if (!argv.resize(1)) {
57880 // That threw an exception on the JSContext, and our CallSetup will do
57881 // the right thing with that.
57882 return;
57883 }
57884 unsigned argc = 1;
57885
57886 do {
57887 if (!NonVoidUTF8StringToJsval(cx, arg, argv[0])) {
57888 aRv.Throw(NS_ERROR_UNEXPECTED);
57889 return;
57890 }
57891 break;
57892 } while (false);
57893
57894 JS::Rooted<JS::Value> callable(cx);
57895 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57896 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57897 !InitIds(cx, atomsCache)) ||
57898 !GetCallableProperty(cx, atomsCache->passOptionalUTF8StringWithDefaultValue_id, &callable)) {
57899 aRv.Throw(NS_ERROR_UNEXPECTED);
57900 return;
57901 }
57902 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57903 if (!JS::Call(cx, thisValue, callable,
57904 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57905 aRv.NoteJSContextException(cx);
57906 return;
57907 }
57908}
57909
57910void
57911TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
57912{
57913 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57914 if (aRv.Failed()) {
57915 return;
57916 }
57917 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57917); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57917; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57918 BindingCallContext& cx = s.GetCallContext();
57919
57920 JS::Rooted<JS::Value> rval(cx);
57921 JS::RootedVector<JS::Value> argv(cx);
57922 if (!argv.resize(1)) {
57923 // That threw an exception on the JSContext, and our CallSetup will do
57924 // the right thing with that.
57925 return;
57926 }
57927 unsigned argc = 1;
57928
57929 do {
57930 if (arg.WasPassed()) {
57931 if (!UTF8StringToJsval(cx, arg.Value(), argv[0])) {
57932 aRv.Throw(NS_ERROR_UNEXPECTED);
57933 return;
57934 }
57935 break;
57936 } else if (argc == 1) {
57937 // This is our current trailing argument; reduce argc
57938 --argc;
57939 } else {
57940 argv[0].setUndefined();
57941 }
57942 } while (false);
57943
57944 JS::Rooted<JS::Value> callable(cx);
57945 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57946 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57947 !InitIds(cx, atomsCache)) ||
57948 !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8String_id, &callable)) {
57949 aRv.Throw(NS_ERROR_UNEXPECTED);
57950 return;
57951 }
57952 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57953 if (!JS::Call(cx, thisValue, callable,
57954 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57955 aRv.NoteJSContextException(cx);
57956 return;
57957 }
57958}
57959
57960void
57961TestJSImplInterfaceJSImpl::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
57962{
57963 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
57964 if (aRv.Failed()) {
57965 return;
57966 }
57967 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 57967); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 57967; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
57968 BindingCallContext& cx = s.GetCallContext();
57969
57970 JS::Rooted<JS::Value> rval(cx);
57971 JS::RootedVector<JS::Value> argv(cx);
57972 if (!argv.resize(1)) {
57973 // That threw an exception on the JSContext, and our CallSetup will do
57974 // the right thing with that.
57975 return;
57976 }
57977 unsigned argc = 1;
57978
57979 do {
57980 if (!UTF8StringToJsval(cx, arg, argv[0])) {
57981 aRv.Throw(NS_ERROR_UNEXPECTED);
57982 return;
57983 }
57984 break;
57985 } while (false);
57986
57987 JS::Rooted<JS::Value> callable(cx);
57988 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
57989 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
57990 !InitIds(cx, atomsCache)) ||
57991 !GetCallableProperty(cx, atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id, &callable)) {
57992 aRv.Throw(NS_ERROR_UNEXPECTED);
57993 return;
57994 }
57995 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
57996 if (!JS::Call(cx, thisValue, callable,
57997 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
57998 aRv.NoteJSContextException(cx);
57999 return;
58000 }
58001}
58002
58003void
58004TestJSImplInterfaceJSImpl::PassVariadicUTF8String(const nsTArray<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58005{
58006 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58007 if (aRv.Failed()) {
58008 return;
58009 }
58010 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58010); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58010; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58011 BindingCallContext& cx = s.GetCallContext();
58012
58013 JS::Rooted<JS::Value> rval(cx);
58014 JS::RootedVector<JS::Value> argv(cx);
58015 if (!argv.resize((1 - 1) + arg.Length())) {
58016 // That threw an exception on the JSContext, and our CallSetup will do
58017 // the right thing with that.
58018 return;
58019 }
58020 unsigned argc = (1 - 1) + arg.Length();
58021
58022 do {
58023 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
58024 if (!NonVoidUTF8StringToJsval(cx, arg[idx], argv[0 + idx])) {
58025 aRv.Throw(NS_ERROR_UNEXPECTED);
58026 return;
58027 }
58028 continue;
58029 }
58030 break;
58031 } while (false);
58032
58033 JS::Rooted<JS::Value> callable(cx);
58034 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58035 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58036 !InitIds(cx, atomsCache)) ||
58037 !GetCallableProperty(cx, atomsCache->passVariadicUTF8String_id, &callable)) {
58038 aRv.Throw(NS_ERROR_UNEXPECTED);
58039 return;
58040 }
58041 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58042 if (!JS::Call(cx, thisValue, callable,
58043 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58044 aRv.NoteJSContextException(cx);
58045 return;
58046 }
58047}
58048
58049void
58050TestJSImplInterfaceJSImpl::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
58051{
58052 CallSetup s(this, aRv, "TestJSImplInterface.passUnionUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58053 if (aRv.Failed()) {
58054 return;
58055 }
58056 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58056); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58056; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58057 BindingCallContext& cx = s.GetCallContext();
58058
58059 JS::Rooted<JS::Value> rval(cx);
58060 JS::RootedVector<JS::Value> argv(cx);
58061 if (!argv.resize(1)) {
58062 // That threw an exception on the JSContext, and our CallSetup will do
58063 // the right thing with that.
58064 return;
58065 }
58066 unsigned argc = 1;
58067
58068 do {
58069 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58070 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
58071 aRv.Throw(NS_ERROR_UNEXPECTED);
58072 return;
58073 }
58074 break;
58075 } while (false);
58076
58077 JS::Rooted<JS::Value> callable(cx);
58078 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58079 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58080 !InitIds(cx, atomsCache)) ||
58081 !GetCallableProperty(cx, atomsCache->passUnionUTF8String_id, &callable)) {
58082 aRv.Throw(NS_ERROR_UNEXPECTED);
58083 return;
58084 }
58085 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58086 if (!JS::Call(cx, thisValue, callable,
58087 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58088 aRv.NoteJSContextException(cx);
58089 return;
58090 }
58091}
58092
58093void
58094TestJSImplInterfaceJSImpl::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58095{
58096 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58097 if (aRv.Failed()) {
58098 return;
58099 }
58100 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58100); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58100; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58101 BindingCallContext& cx = s.GetCallContext();
58102
58103 JS::Rooted<JS::Value> rval(cx);
58104 JS::RootedVector<JS::Value> argv(cx);
58105 if (!argv.resize(1)) {
58106 // That threw an exception on the JSContext, and our CallSetup will do
58107 // the right thing with that.
58108 return;
58109 }
58110 unsigned argc = 1;
58111
58112 do {
58113 if (arg.WasPassed()) {
58114 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58115 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
58116 aRv.Throw(NS_ERROR_UNEXPECTED);
58117 return;
58118 }
58119 break;
58120 } else if (argc == 1) {
58121 // This is our current trailing argument; reduce argc
58122 --argc;
58123 } else {
58124 argv[0].setUndefined();
58125 }
58126 } while (false);
58127
58128 JS::Rooted<JS::Value> callable(cx);
58129 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58130 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58131 !InitIds(cx, atomsCache)) ||
58132 !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8String_id, &callable)) {
58133 aRv.Throw(NS_ERROR_UNEXPECTED);
58134 return;
58135 }
58136 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58137 if (!JS::Call(cx, thisValue, callable,
58138 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58139 aRv.NoteJSContextException(cx);
58140 return;
58141 }
58142}
58143
58144void
58145TestJSImplInterfaceJSImpl::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
58146{
58147 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnionUTF8StringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58148 if (aRv.Failed()) {
58149 return;
58150 }
58151 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58151); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58151; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58152 BindingCallContext& cx = s.GetCallContext();
58153
58154 JS::Rooted<JS::Value> rval(cx);
58155 JS::RootedVector<JS::Value> argv(cx);
58156 if (!argv.resize(1)) {
58157 // That threw an exception on the JSContext, and our CallSetup will do
58158 // the right thing with that.
58159 return;
58160 }
58161 unsigned argc = 1;
58162
58163 do {
58164 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
58165 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
58166 aRv.Throw(NS_ERROR_UNEXPECTED);
58167 return;
58168 }
58169 break;
58170 } while (false);
58171
58172 JS::Rooted<JS::Value> callable(cx);
58173 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58174 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58175 !InitIds(cx, atomsCache)) ||
58176 !GetCallableProperty(cx, atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id, &callable)) {
58177 aRv.Throw(NS_ERROR_UNEXPECTED);
58178 return;
58179 }
58180 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58181 if (!JS::Call(cx, thisValue, callable,
58182 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58183 aRv.NoteJSContextException(cx);
58184 return;
58185 }
58186}
58187
58188void
58189TestJSImplInterfaceJSImpl::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58190{
58191 CallSetup s(this, aRv, "TestJSImplInterface.passSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58192 if (aRv.Failed()) {
58193 return;
58194 }
58195 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58195); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58195; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58196 BindingCallContext& cx = s.GetCallContext();
58197
58198 JS::Rooted<JS::Value> rval(cx);
58199 JS::RootedVector<JS::Value> argv(cx);
58200 if (!argv.resize(1)) {
58201 // That threw an exception on the JSContext, and our CallSetup will do
58202 // the right thing with that.
58203 return;
58204 }
58205 unsigned argc = 1;
58206
58207 do {
58208 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
58209 aRv.Throw(NS_ERROR_UNEXPECTED);
58210 return;
58211 }
58212 break;
58213 } while (false);
58214
58215 JS::Rooted<JS::Value> callable(cx);
58216 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58217 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58218 !InitIds(cx, atomsCache)) ||
58219 !GetCallableProperty(cx, atomsCache->passSVS_id, &callable)) {
58220 aRv.Throw(NS_ERROR_UNEXPECTED);
58221 return;
58222 }
58223 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58224 if (!JS::Call(cx, thisValue, callable,
58225 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58226 aRv.NoteJSContextException(cx);
58227 return;
58228 }
58229}
58230
58231void
58232TestJSImplInterfaceJSImpl::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58233{
58234 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58235 if (aRv.Failed()) {
58236 return;
58237 }
58238 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58238); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58238; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58239 BindingCallContext& cx = s.GetCallContext();
58240
58241 JS::Rooted<JS::Value> rval(cx);
58242 JS::RootedVector<JS::Value> argv(cx);
58243 if (!argv.resize(1)) {
58244 // That threw an exception on the JSContext, and our CallSetup will do
58245 // the right thing with that.
58246 return;
58247 }
58248 unsigned argc = 1;
58249
58250 do {
58251 if (!xpc::StringToJsval(cx, arg, argv[0])) {
58252 aRv.Throw(NS_ERROR_UNEXPECTED);
58253 return;
58254 }
58255 break;
58256 } while (false);
58257
58258 JS::Rooted<JS::Value> callable(cx);
58259 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58260 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58261 !InitIds(cx, atomsCache)) ||
58262 !GetCallableProperty(cx, atomsCache->passNullableSVS_id, &callable)) {
58263 aRv.Throw(NS_ERROR_UNEXPECTED);
58264 return;
58265 }
58266 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58267 if (!JS::Call(cx, thisValue, callable,
58268 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58269 aRv.NoteJSContextException(cx);
58270 return;
58271 }
58272}
58273
58274void
58275TestJSImplInterfaceJSImpl::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58276{
58277 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58278 if (aRv.Failed()) {
58279 return;
58280 }
58281 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58281); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58281; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58282 BindingCallContext& cx = s.GetCallContext();
58283
58284 JS::Rooted<JS::Value> rval(cx);
58285 JS::RootedVector<JS::Value> argv(cx);
58286 if (!argv.resize(1)) {
58287 // That threw an exception on the JSContext, and our CallSetup will do
58288 // the right thing with that.
58289 return;
58290 }
58291 unsigned argc = 1;
58292
58293 do {
58294 if (arg.WasPassed()) {
58295 if (!xpc::NonVoidStringToJsval(cx, arg.Value(), argv[0])) {
58296 aRv.Throw(NS_ERROR_UNEXPECTED);
58297 return;
58298 }
58299 break;
58300 } else if (argc == 1) {
58301 // This is our current trailing argument; reduce argc
58302 --argc;
58303 } else {
58304 argv[0].setUndefined();
58305 }
58306 } while (false);
58307
58308 JS::Rooted<JS::Value> callable(cx);
58309 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58310 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58311 !InitIds(cx, atomsCache)) ||
58312 !GetCallableProperty(cx, atomsCache->passOptionalSVS_id, &callable)) {
58313 aRv.Throw(NS_ERROR_UNEXPECTED);
58314 return;
58315 }
58316 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58317 if (!JS::Call(cx, thisValue, callable,
58318 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58319 aRv.NoteJSContextException(cx);
58320 return;
58321 }
58322}
58323
58324void
58325TestJSImplInterfaceJSImpl::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58326{
58327 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58328 if (aRv.Failed()) {
58329 return;
58330 }
58331 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58331); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58331; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58332 BindingCallContext& cx = s.GetCallContext();
58333
58334 JS::Rooted<JS::Value> rval(cx);
58335 JS::RootedVector<JS::Value> argv(cx);
58336 if (!argv.resize(1)) {
58337 // That threw an exception on the JSContext, and our CallSetup will do
58338 // the right thing with that.
58339 return;
58340 }
58341 unsigned argc = 1;
58342
58343 do {
58344 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
58345 aRv.Throw(NS_ERROR_UNEXPECTED);
58346 return;
58347 }
58348 break;
58349 } while (false);
58350
58351 JS::Rooted<JS::Value> callable(cx);
58352 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58353 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58354 !InitIds(cx, atomsCache)) ||
58355 !GetCallableProperty(cx, atomsCache->passOptionalSVSWithDefaultValue_id, &callable)) {
58356 aRv.Throw(NS_ERROR_UNEXPECTED);
58357 return;
58358 }
58359 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58360 if (!JS::Call(cx, thisValue, callable,
58361 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58362 aRv.NoteJSContextException(cx);
58363 return;
58364 }
58365}
58366
58367void
58368TestJSImplInterfaceJSImpl::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58369{
58370 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58371 if (aRv.Failed()) {
58372 return;
58373 }
58374 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58374); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58374; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58375 BindingCallContext& cx = s.GetCallContext();
58376
58377 JS::Rooted<JS::Value> rval(cx);
58378 JS::RootedVector<JS::Value> argv(cx);
58379 if (!argv.resize(1)) {
58380 // That threw an exception on the JSContext, and our CallSetup will do
58381 // the right thing with that.
58382 return;
58383 }
58384 unsigned argc = 1;
58385
58386 do {
58387 if (arg.WasPassed()) {
58388 if (!xpc::StringToJsval(cx, arg.Value(), argv[0])) {
58389 aRv.Throw(NS_ERROR_UNEXPECTED);
58390 return;
58391 }
58392 break;
58393 } else if (argc == 1) {
58394 // This is our current trailing argument; reduce argc
58395 --argc;
58396 } else {
58397 argv[0].setUndefined();
58398 }
58399 } while (false);
58400
58401 JS::Rooted<JS::Value> callable(cx);
58402 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58403 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58404 !InitIds(cx, atomsCache)) ||
58405 !GetCallableProperty(cx, atomsCache->passOptionalNullableSVS_id, &callable)) {
58406 aRv.Throw(NS_ERROR_UNEXPECTED);
58407 return;
58408 }
58409 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58410 if (!JS::Call(cx, thisValue, callable,
58411 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58412 aRv.NoteJSContextException(cx);
58413 return;
58414 }
58415}
58416
58417void
58418TestJSImplInterfaceJSImpl::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
58419{
58420 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSVSWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58421 if (aRv.Failed()) {
58422 return;
58423 }
58424 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58424); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58424; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58425 BindingCallContext& cx = s.GetCallContext();
58426
58427 JS::Rooted<JS::Value> rval(cx);
58428 JS::RootedVector<JS::Value> argv(cx);
58429 if (!argv.resize(1)) {
58430 // That threw an exception on the JSContext, and our CallSetup will do
58431 // the right thing with that.
58432 return;
58433 }
58434 unsigned argc = 1;
58435
58436 do {
58437 if (!xpc::StringToJsval(cx, arg, argv[0])) {
58438 aRv.Throw(NS_ERROR_UNEXPECTED);
58439 return;
58440 }
58441 break;
58442 } while (false);
58443
58444 JS::Rooted<JS::Value> callable(cx);
58445 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58446 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58447 !InitIds(cx, atomsCache)) ||
58448 !GetCallableProperty(cx, atomsCache->passOptionalNullableSVSWithDefaultValue_id, &callable)) {
58449 aRv.Throw(NS_ERROR_UNEXPECTED);
58450 return;
58451 }
58452 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58453 if (!JS::Call(cx, thisValue, callable,
58454 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58455 aRv.NoteJSContextException(cx);
58456 return;
58457 }
58458}
58459
58460void
58461TestJSImplInterfaceJSImpl::PassVariadicSVS(const nsTArray<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58462{
58463 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58464 if (aRv.Failed()) {
58465 return;
58466 }
58467 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58467); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58467; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58468 BindingCallContext& cx = s.GetCallContext();
58469
58470 JS::Rooted<JS::Value> rval(cx);
58471 JS::RootedVector<JS::Value> argv(cx);
58472 if (!argv.resize((1 - 1) + arg.Length())) {
58473 // That threw an exception on the JSContext, and our CallSetup will do
58474 // the right thing with that.
58475 return;
58476 }
58477 unsigned argc = (1 - 1) + arg.Length();
58478
58479 do {
58480 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
58481 if (!xpc::NonVoidStringToJsval(cx, arg[idx], argv[0 + idx])) {
58482 aRv.Throw(NS_ERROR_UNEXPECTED);
58483 return;
58484 }
58485 continue;
58486 }
58487 break;
58488 } while (false);
58489
58490 JS::Rooted<JS::Value> callable(cx);
58491 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58492 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58493 !InitIds(cx, atomsCache)) ||
58494 !GetCallableProperty(cx, atomsCache->passVariadicSVS_id, &callable)) {
58495 aRv.Throw(NS_ERROR_UNEXPECTED);
58496 return;
58497 }
58498 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58499 if (!JS::Call(cx, thisValue, callable,
58500 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58501 aRv.NoteJSContextException(cx);
58502 return;
58503 }
58504}
58505
58506void
58507TestJSImplInterfaceJSImpl::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
58508{
58509 CallSetup s(this, aRv, "TestJSImplInterface.receiveSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58510 if (aRv.Failed()) {
58511 return;
58512 }
58513 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58513; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58514 BindingCallContext& cx = s.GetCallContext();
58515
58516 JS::Rooted<JS::Value> rval(cx);
58517
58518 JS::Rooted<JS::Value> callable(cx);
58519 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58520 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58521 !InitIds(cx, atomsCache)) ||
58522 !GetCallableProperty(cx, atomsCache->receiveSVS_id, &callable)) {
58523 aRv.Throw(NS_ERROR_UNEXPECTED);
58524 return;
58525 }
58526 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58527 if (!JS::Call(cx, thisValue, callable,
58528 JS::HandleValueArray::empty(), &rval)) {
58529 aRv.NoteJSContextException(cx);
58530 return;
58531 }
58532 binding_detail::FakeString<char16_t> rvalDecl;
58533 if (!ConvertJSValueToString(cx, rval, eStringify, eStringify, rvalDecl)) {
58534 aRv.Throw(NS_ERROR_UNEXPECTED);
58535 return;
58536 }
58537 if (!NormalizeUSVString(rvalDecl)) {
58538 JS_ReportOutOfMemory(cx);
58539 aRv.Throw(NS_ERROR_UNEXPECTED);
58540 return;
58541 }
58542 aRetVal = rvalDecl;
58543}
58544
58545void
58546TestJSImplInterfaceJSImpl::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
58547{
58548 CallSetup s(this, aRv, "TestJSImplInterface.passJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58549 if (aRv.Failed()) {
58550 return;
58551 }
58552 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58552); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58552; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58553 BindingCallContext& cx = s.GetCallContext();
58554
58555 JS::Rooted<JS::Value> rval(cx);
58556 JS::RootedVector<JS::Value> argv(cx);
58557 if (!argv.resize(1)) {
58558 // That threw an exception on the JSContext, and our CallSetup will do
58559 // the right thing with that.
58560 return;
58561 }
58562 unsigned argc = 1;
58563
58564 do {
58565 argv[0].setString(arg);
58566 if (!MaybeWrapStringValue(cx, argv[0])) {
58567 aRv.Throw(NS_ERROR_UNEXPECTED);
58568 return;
58569 }
58570 break;
58571 } while (false);
58572
58573 JS::Rooted<JS::Value> callable(cx);
58574 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58575 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58576 !InitIds(cx, atomsCache)) ||
58577 !GetCallableProperty(cx, atomsCache->passJSString_id, &callable)) {
58578 aRv.Throw(NS_ERROR_UNEXPECTED);
58579 return;
58580 }
58581 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58582 if (!JS::Call(cx, thisValue, callable,
58583 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58584 aRv.NoteJSContextException(cx);
58585 return;
58586 }
58587}
58588
58589void
58590TestJSImplInterfaceJSImpl::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
58591{
58592 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalJSStringWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58593 if (aRv.Failed()) {
58594 return;
58595 }
58596 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58596); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58596; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58597 BindingCallContext& cx = s.GetCallContext();
58598
58599 JS::Rooted<JS::Value> rval(cx);
58600 JS::RootedVector<JS::Value> argv(cx);
58601 if (!argv.resize(1)) {
58602 // That threw an exception on the JSContext, and our CallSetup will do
58603 // the right thing with that.
58604 return;
58605 }
58606 unsigned argc = 1;
58607
58608 do {
58609 argv[0].setString(arg);
58610 if (!MaybeWrapStringValue(cx, argv[0])) {
58611 aRv.Throw(NS_ERROR_UNEXPECTED);
58612 return;
58613 }
58614 break;
58615 } while (false);
58616
58617 JS::Rooted<JS::Value> callable(cx);
58618 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58619 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58620 !InitIds(cx, atomsCache)) ||
58621 !GetCallableProperty(cx, atomsCache->passOptionalJSStringWithDefaultValue_id, &callable)) {
58622 aRv.Throw(NS_ERROR_UNEXPECTED);
58623 return;
58624 }
58625 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58626 if (!JS::Call(cx, thisValue, callable,
58627 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58628 aRv.NoteJSContextException(cx);
58629 return;
58630 }
58631}
58632
58633void
58634TestJSImplInterfaceJSImpl::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
58635{
58636 CallSetup s(this, aRv, "TestJSImplInterface.receiveJSString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58637 if (aRv.Failed()) {
58638 return;
58639 }
58640 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58640); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58640; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58641 BindingCallContext& cx = s.GetCallContext();
58642
58643 JS::Rooted<JS::Value> rval(cx);
58644
58645 JS::Rooted<JS::Value> callable(cx);
58646 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58647 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58648 !InitIds(cx, atomsCache)) ||
58649 !GetCallableProperty(cx, atomsCache->receiveJSString_id, &callable)) {
58650 aRv.Throw(NS_ERROR_UNEXPECTED);
58651 return;
58652 }
58653 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58654 if (!JS::Call(cx, thisValue, callable,
58655 JS::HandleValueArray::empty(), &rval)) {
58656 aRv.NoteJSContextException(cx);
58657 return;
58658 }
58659 JS::Rooted<JSString*> rvalDecl(cx);
58660 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
58661 aRv.Throw(NS_ERROR_UNEXPECTED);
58662 return;
58663 }
58664 aRetVal.set(rvalDecl);
58665}
58666
58667void
58668TestJSImplInterfaceJSImpl::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
58669{
58670 CallSetup s(this, aRv, "TestJSImplInterface.passEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58671 if (aRv.Failed()) {
58672 return;
58673 }
58674 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58674); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58674; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58675 BindingCallContext& cx = s.GetCallContext();
58676
58677 JS::Rooted<JS::Value> rval(cx);
58678 JS::RootedVector<JS::Value> argv(cx);
58679 if (!argv.resize(1)) {
58680 // That threw an exception on the JSContext, and our CallSetup will do
58681 // the right thing with that.
58682 return;
58683 }
58684 unsigned argc = 1;
58685
58686 do {
58687 if (!ToJSValue(cx, arg, argv[0])) {
58688 aRv.Throw(NS_ERROR_UNEXPECTED);
58689 return;
58690 }
58691 break;
58692 } while (false);
58693
58694 JS::Rooted<JS::Value> callable(cx);
58695 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58696 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58697 !InitIds(cx, atomsCache)) ||
58698 !GetCallableProperty(cx, atomsCache->passEnum_id, &callable)) {
58699 aRv.Throw(NS_ERROR_UNEXPECTED);
58700 return;
58701 }
58702 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58703 if (!JS::Call(cx, thisValue, callable,
58704 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58705 aRv.NoteJSContextException(cx);
58706 return;
58707 }
58708}
58709
58710void
58711TestJSImplInterfaceJSImpl::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58712{
58713 CallSetup s(this, aRv, "TestJSImplInterface.passNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58714 if (aRv.Failed()) {
58715 return;
58716 }
58717 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58717); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58717; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58718 BindingCallContext& cx = s.GetCallContext();
58719
58720 JS::Rooted<JS::Value> rval(cx);
58721 JS::RootedVector<JS::Value> argv(cx);
58722 if (!argv.resize(1)) {
58723 // That threw an exception on the JSContext, and our CallSetup will do
58724 // the right thing with that.
58725 return;
58726 }
58727 unsigned argc = 1;
58728
58729 do {
58730 if (arg.IsNull()) {
58731 argv[0].setNull();
58732 break;
58733 } else {
58734 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58735 aRv.Throw(NS_ERROR_UNEXPECTED);
58736 return;
58737 }
58738 break;
58739 }
58740 } while (false);
58741
58742 JS::Rooted<JS::Value> callable(cx);
58743 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58744 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58745 !InitIds(cx, atomsCache)) ||
58746 !GetCallableProperty(cx, atomsCache->passNullableEnum_id, &callable)) {
58747 aRv.Throw(NS_ERROR_UNEXPECTED);
58748 return;
58749 }
58750 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58751 if (!JS::Call(cx, thisValue, callable,
58752 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58753 aRv.NoteJSContextException(cx);
58754 return;
58755 }
58756}
58757
58758void
58759TestJSImplInterfaceJSImpl::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58760{
58761 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58762 if (aRv.Failed()) {
58763 return;
58764 }
58765 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58765); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58765; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58766 BindingCallContext& cx = s.GetCallContext();
58767
58768 JS::Rooted<JS::Value> rval(cx);
58769 JS::RootedVector<JS::Value> argv(cx);
58770 if (!argv.resize(1)) {
58771 // That threw an exception on the JSContext, and our CallSetup will do
58772 // the right thing with that.
58773 return;
58774 }
58775 unsigned argc = 1;
58776
58777 do {
58778 if (arg.WasPassed()) {
58779 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58780 aRv.Throw(NS_ERROR_UNEXPECTED);
58781 return;
58782 }
58783 break;
58784 } else if (argc == 1) {
58785 // This is our current trailing argument; reduce argc
58786 --argc;
58787 } else {
58788 argv[0].setUndefined();
58789 }
58790 } while (false);
58791
58792 JS::Rooted<JS::Value> callable(cx);
58793 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58794 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58795 !InitIds(cx, atomsCache)) ||
58796 !GetCallableProperty(cx, atomsCache->passOptionalEnum_id, &callable)) {
58797 aRv.Throw(NS_ERROR_UNEXPECTED);
58798 return;
58799 }
58800 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58801 if (!JS::Call(cx, thisValue, callable,
58802 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58803 aRv.NoteJSContextException(cx);
58804 return;
58805 }
58806}
58807
58808void
58809TestJSImplInterfaceJSImpl::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
58810{
58811 CallSetup s(this, aRv, "TestJSImplInterface.passEnumWithDefault", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58812 if (aRv.Failed()) {
58813 return;
58814 }
58815 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58815; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58816 BindingCallContext& cx = s.GetCallContext();
58817
58818 JS::Rooted<JS::Value> rval(cx);
58819 JS::RootedVector<JS::Value> argv(cx);
58820 if (!argv.resize(1)) {
58821 // That threw an exception on the JSContext, and our CallSetup will do
58822 // the right thing with that.
58823 return;
58824 }
58825 unsigned argc = 1;
58826
58827 do {
58828 if (!ToJSValue(cx, arg, argv[0])) {
58829 aRv.Throw(NS_ERROR_UNEXPECTED);
58830 return;
58831 }
58832 break;
58833 } while (false);
58834
58835 JS::Rooted<JS::Value> callable(cx);
58836 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58837 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58838 !InitIds(cx, atomsCache)) ||
58839 !GetCallableProperty(cx, atomsCache->passEnumWithDefault_id, &callable)) {
58840 aRv.Throw(NS_ERROR_UNEXPECTED);
58841 return;
58842 }
58843 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58844 if (!JS::Call(cx, thisValue, callable,
58845 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58846 aRv.NoteJSContextException(cx);
58847 return;
58848 }
58849}
58850
58851void
58852TestJSImplInterfaceJSImpl::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58853{
58854 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58855 if (aRv.Failed()) {
58856 return;
58857 }
58858 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58858); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58858; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58859 BindingCallContext& cx = s.GetCallContext();
58860
58861 JS::Rooted<JS::Value> rval(cx);
58862 JS::RootedVector<JS::Value> argv(cx);
58863 if (!argv.resize(1)) {
58864 // That threw an exception on the JSContext, and our CallSetup will do
58865 // the right thing with that.
58866 return;
58867 }
58868 unsigned argc = 1;
58869
58870 do {
58871 if (arg.WasPassed()) {
58872 if (arg.Value().IsNull()) {
58873 argv[0].setNull();
58874 break;
58875 } else {
58876 if (!ToJSValue(cx, arg.Value().Value(), argv[0])) {
58877 aRv.Throw(NS_ERROR_UNEXPECTED);
58878 return;
58879 }
58880 break;
58881 }
58882 } else if (argc == 1) {
58883 // This is our current trailing argument; reduce argc
58884 --argc;
58885 } else {
58886 argv[0].setUndefined();
58887 }
58888 } while (false);
58889
58890 JS::Rooted<JS::Value> callable(cx);
58891 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58892 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58893 !InitIds(cx, atomsCache)) ||
58894 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnum_id, &callable)) {
58895 aRv.Throw(NS_ERROR_UNEXPECTED);
58896 return;
58897 }
58898 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58899 if (!JS::Call(cx, thisValue, callable,
58900 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58901 aRv.NoteJSContextException(cx);
58902 return;
58903 }
58904}
58905
58906void
58907TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58908{
58909 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58910 if (aRv.Failed()) {
58911 return;
58912 }
58913 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58913); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58913; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58914 BindingCallContext& cx = s.GetCallContext();
58915
58916 JS::Rooted<JS::Value> rval(cx);
58917 JS::RootedVector<JS::Value> argv(cx);
58918 if (!argv.resize(1)) {
58919 // That threw an exception on the JSContext, and our CallSetup will do
58920 // the right thing with that.
58921 return;
58922 }
58923 unsigned argc = 1;
58924
58925 do {
58926 if (arg.IsNull()) {
58927 argv[0].setNull();
58928 break;
58929 } else {
58930 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58931 aRv.Throw(NS_ERROR_UNEXPECTED);
58932 return;
58933 }
58934 break;
58935 }
58936 } while (false);
58937
58938 JS::Rooted<JS::Value> callable(cx);
58939 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58940 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58941 !InitIds(cx, atomsCache)) ||
58942 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue_id, &callable)) {
58943 aRv.Throw(NS_ERROR_UNEXPECTED);
58944 return;
58945 }
58946 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58947 if (!JS::Call(cx, thisValue, callable,
58948 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58949 aRv.NoteJSContextException(cx);
58950 return;
58951 }
58952}
58953
58954void
58955TestJSImplInterfaceJSImpl::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
58956{
58957 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableEnumWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
58958 if (aRv.Failed()) {
58959 return;
58960 }
58961 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 58961); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 58961; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
58962 BindingCallContext& cx = s.GetCallContext();
58963
58964 JS::Rooted<JS::Value> rval(cx);
58965 JS::RootedVector<JS::Value> argv(cx);
58966 if (!argv.resize(1)) {
58967 // That threw an exception on the JSContext, and our CallSetup will do
58968 // the right thing with that.
58969 return;
58970 }
58971 unsigned argc = 1;
58972
58973 do {
58974 if (arg.IsNull()) {
58975 argv[0].setNull();
58976 break;
58977 } else {
58978 if (!ToJSValue(cx, arg.Value(), argv[0])) {
58979 aRv.Throw(NS_ERROR_UNEXPECTED);
58980 return;
58981 }
58982 break;
58983 }
58984 } while (false);
58985
58986 JS::Rooted<JS::Value> callable(cx);
58987 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
58988 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
58989 !InitIds(cx, atomsCache)) ||
58990 !GetCallableProperty(cx, atomsCache->passOptionalNullableEnumWithDefaultValue2_id, &callable)) {
58991 aRv.Throw(NS_ERROR_UNEXPECTED);
58992 return;
58993 }
58994 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
58995 if (!JS::Call(cx, thisValue, callable,
58996 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
58997 aRv.NoteJSContextException(cx);
58998 return;
58999 }
59000}
59001
59002MyTestEnum
59003TestJSImplInterfaceJSImpl::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm)
59004{
59005 CallSetup s(this, aRv, "TestJSImplInterface.receiveEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59006 if (aRv.Failed()) {
59007 return MyTestEnum(0);
59008 }
59009 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59009); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59009; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59010 BindingCallContext& cx = s.GetCallContext();
59011
59012 JS::Rooted<JS::Value> rval(cx);
59013
59014 JS::Rooted<JS::Value> callable(cx);
59015 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59016 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59017 !InitIds(cx, atomsCache)) ||
59018 !GetCallableProperty(cx, atomsCache->receiveEnum_id, &callable)) {
59019 aRv.Throw(NS_ERROR_UNEXPECTED);
59020 return MyTestEnum(0);
59021 }
59022 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59023 if (!JS::Call(cx, thisValue, callable,
59024 JS::HandleValueArray::empty(), &rval)) {
59025 aRv.NoteJSContextException(cx);
59026 return MyTestEnum(0);
59027 }
59028 MyTestEnum rvalDecl;
59029 {
59030 int index;
59031 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
59032 binding_detail::EnumStrings<MyTestEnum>::Values,
59033 "MyTestEnum", "return value of TestJSImplInterface.receiveEnum",
59034 &index)) {
59035 aRv.Throw(NS_ERROR_UNEXPECTED);
59036 return MyTestEnum(0);
59037 }
59038 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 59038); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 59038; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59039 rvalDecl = static_cast<MyTestEnum>(index);
59040 }
59041 return rvalDecl;
59042}
59043
59044Nullable<MyTestEnum>
59045TestJSImplInterfaceJSImpl::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm)
59046{
59047 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59048 if (aRv.Failed()) {
59049 return Nullable<MyTestEnum>();
59050 }
59051 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59051); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59051; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59052 BindingCallContext& cx = s.GetCallContext();
59053
59054 JS::Rooted<JS::Value> rval(cx);
59055
59056 JS::Rooted<JS::Value> callable(cx);
59057 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59058 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59059 !InitIds(cx, atomsCache)) ||
59060 !GetCallableProperty(cx, atomsCache->receiveNullableEnum_id, &callable)) {
59061 aRv.Throw(NS_ERROR_UNEXPECTED);
59062 return Nullable<MyTestEnum>();
59063 }
59064 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59065 if (!JS::Call(cx, thisValue, callable,
59066 JS::HandleValueArray::empty(), &rval)) {
59067 aRv.NoteJSContextException(cx);
59068 return Nullable<MyTestEnum>();
59069 }
59070 Nullable<MyTestEnum> rvalDecl;
59071 if (rval.isNullOrUndefined()) {
59072 rvalDecl.SetNull();
59073 } else {
59074 {
59075 int index;
59076 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
59077 binding_detail::EnumStrings<MyTestEnum>::Values,
59078 "MyTestEnum", "return value of TestJSImplInterface.receiveNullableEnum",
59079 &index)) {
59080 aRv.Throw(NS_ERROR_UNEXPECTED);
59081 return Nullable<MyTestEnum>();
59082 }
59083 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 59083); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 59083; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59084 rvalDecl.SetValue() = static_cast<MyTestEnum>(index);
59085 }
59086 }
59087 return rvalDecl;
59088}
59089
59090void
59091TestJSImplInterfaceJSImpl::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
59092{
59093 CallSetup s(this, aRv, "TestJSImplInterface.passCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59094 if (aRv.Failed()) {
59095 return;
59096 }
59097 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59097); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59097; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59098 BindingCallContext& cx = s.GetCallContext();
59099
59100 JS::Rooted<JS::Value> rval(cx);
59101 JS::RootedVector<JS::Value> argv(cx);
59102 if (!argv.resize(1)) {
59103 // That threw an exception on the JSContext, and our CallSetup will do
59104 // the right thing with that.
59105 return;
59106 }
59107 unsigned argc = 1;
59108
59109 do {
59110 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59111 if (!MaybeWrapObjectValue(cx, argv[0])) {
59112 aRv.Throw(NS_ERROR_UNEXPECTED);
59113 return;
59114 }
59115 break;
59116 } while (false);
59117
59118 JS::Rooted<JS::Value> callable(cx);
59119 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59120 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59121 !InitIds(cx, atomsCache)) ||
59122 !GetCallableProperty(cx, atomsCache->passCallback_id, &callable)) {
59123 aRv.Throw(NS_ERROR_UNEXPECTED);
59124 return;
59125 }
59126 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59127 if (!JS::Call(cx, thisValue, callable,
59128 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59129 aRv.NoteJSContextException(cx);
59130 return;
59131 }
59132}
59133
59134void
59135TestJSImplInterfaceJSImpl::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59136{
59137 CallSetup s(this, aRv, "TestJSImplInterface.passNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59138 if (aRv.Failed()) {
59139 return;
59140 }
59141 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59141; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59142 BindingCallContext& cx = s.GetCallContext();
59143
59144 JS::Rooted<JS::Value> rval(cx);
59145 JS::RootedVector<JS::Value> argv(cx);
59146 if (!argv.resize(1)) {
59147 // That threw an exception on the JSContext, and our CallSetup will do
59148 // the right thing with that.
59149 return;
59150 }
59151 unsigned argc = 1;
59152
59153 do {
59154 if (arg) {
59155 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59156 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59157 aRv.Throw(NS_ERROR_UNEXPECTED);
59158 return;
59159 }
59160 break;
59161 } else {
59162 argv[0].setNull();
59163 break;
59164 }
59165 } while (false);
59166
59167 JS::Rooted<JS::Value> callable(cx);
59168 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59169 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59170 !InitIds(cx, atomsCache)) ||
59171 !GetCallableProperty(cx, atomsCache->passNullableCallback_id, &callable)) {
59172 aRv.Throw(NS_ERROR_UNEXPECTED);
59173 return;
59174 }
59175 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59176 if (!JS::Call(cx, thisValue, callable,
59177 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59178 aRv.NoteJSContextException(cx);
59179 return;
59180 }
59181}
59182
59183void
59184TestJSImplInterfaceJSImpl::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59185{
59186 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59187 if (aRv.Failed()) {
59188 return;
59189 }
59190 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59190); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59190; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59191 BindingCallContext& cx = s.GetCallContext();
59192
59193 JS::Rooted<JS::Value> rval(cx);
59194 JS::RootedVector<JS::Value> argv(cx);
59195 if (!argv.resize(1)) {
59196 // That threw an exception on the JSContext, and our CallSetup will do
59197 // the right thing with that.
59198 return;
59199 }
59200 unsigned argc = 1;
59201
59202 do {
59203 if (arg.WasPassed()) {
59204 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
59205 if (!MaybeWrapObjectValue(cx, argv[0])) {
59206 aRv.Throw(NS_ERROR_UNEXPECTED);
59207 return;
59208 }
59209 break;
59210 } else if (argc == 1) {
59211 // This is our current trailing argument; reduce argc
59212 --argc;
59213 } else {
59214 argv[0].setUndefined();
59215 }
59216 } while (false);
59217
59218 JS::Rooted<JS::Value> callable(cx);
59219 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59220 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59221 !InitIds(cx, atomsCache)) ||
59222 !GetCallableProperty(cx, atomsCache->passOptionalCallback_id, &callable)) {
59223 aRv.Throw(NS_ERROR_UNEXPECTED);
59224 return;
59225 }
59226 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59227 if (!JS::Call(cx, thisValue, callable,
59228 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59229 aRv.NoteJSContextException(cx);
59230 return;
59231 }
59232}
59233
59234void
59235TestJSImplInterfaceJSImpl::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59236{
59237 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59238 if (aRv.Failed()) {
59239 return;
59240 }
59241 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59241); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59241; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59242 BindingCallContext& cx = s.GetCallContext();
59243
59244 JS::Rooted<JS::Value> rval(cx);
59245 JS::RootedVector<JS::Value> argv(cx);
59246 if (!argv.resize(1)) {
59247 // That threw an exception on the JSContext, and our CallSetup will do
59248 // the right thing with that.
59249 return;
59250 }
59251 unsigned argc = 1;
59252
59253 do {
59254 if (arg.WasPassed()) {
59255 if (arg.Value()) {
59256 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg.Value()));
59257 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59258 aRv.Throw(NS_ERROR_UNEXPECTED);
59259 return;
59260 }
59261 break;
59262 } else {
59263 argv[0].setNull();
59264 break;
59265 }
59266 } else if (argc == 1) {
59267 // This is our current trailing argument; reduce argc
59268 --argc;
59269 } else {
59270 argv[0].setUndefined();
59271 }
59272 } while (false);
59273
59274 JS::Rooted<JS::Value> callable(cx);
59275 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59276 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59277 !InitIds(cx, atomsCache)) ||
59278 !GetCallableProperty(cx, atomsCache->passOptionalNullableCallback_id, &callable)) {
59279 aRv.Throw(NS_ERROR_UNEXPECTED);
59280 return;
59281 }
59282 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59283 if (!JS::Call(cx, thisValue, callable,
59284 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59285 aRv.NoteJSContextException(cx);
59286 return;
59287 }
59288}
59289
59290void
59291TestJSImplInterfaceJSImpl::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59292{
59293 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59294 if (aRv.Failed()) {
59295 return;
59296 }
59297 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59297); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59297; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59298 BindingCallContext& cx = s.GetCallContext();
59299
59300 JS::Rooted<JS::Value> rval(cx);
59301 JS::RootedVector<JS::Value> argv(cx);
59302 if (!argv.resize(1)) {
59303 // That threw an exception on the JSContext, and our CallSetup will do
59304 // the right thing with that.
59305 return;
59306 }
59307 unsigned argc = 1;
59308
59309 do {
59310 if (arg) {
59311 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59312 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59313 aRv.Throw(NS_ERROR_UNEXPECTED);
59314 return;
59315 }
59316 break;
59317 } else {
59318 argv[0].setNull();
59319 break;
59320 }
59321 } while (false);
59322
59323 JS::Rooted<JS::Value> callable(cx);
59324 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59325 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59326 !InitIds(cx, atomsCache)) ||
59327 !GetCallableProperty(cx, atomsCache->passOptionalNullableCallbackWithDefaultValue_id, &callable)) {
59328 aRv.Throw(NS_ERROR_UNEXPECTED);
59329 return;
59330 }
59331 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59332 if (!JS::Call(cx, thisValue, callable,
59333 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59334 aRv.NoteJSContextException(cx);
59335 return;
59336 }
59337}
59338
59339already_AddRefed<MyTestCallback>
59340TestJSImplInterfaceJSImpl::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm)
59341{
59342 CallSetup s(this, aRv, "TestJSImplInterface.receiveCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59343 if (aRv.Failed()) {
59344 return nullptr;
59345 }
59346 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59346); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59346; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59347 BindingCallContext& cx = s.GetCallContext();
59348
59349 JS::Rooted<JS::Value> rval(cx);
59350
59351 JS::Rooted<JS::Value> callable(cx);
59352 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59353 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59354 !InitIds(cx, atomsCache)) ||
59355 !GetCallableProperty(cx, atomsCache->receiveCallback_id, &callable)) {
59356 aRv.Throw(NS_ERROR_UNEXPECTED);
59357 return nullptr;
59358 }
59359 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59360 if (!JS::Call(cx, thisValue, callable,
59361 JS::HandleValueArray::empty(), &rval)) {
59362 aRv.NoteJSContextException(cx);
59363 return nullptr;
59364 }
59365 RefPtr<MyTestCallback> rvalDecl;
59366 if (rval.isObject()) {
59367 if (JS::IsCallable(&rval.toObject())) {
59368 { // scope for tempRoot and tempGlobalRoot if needed
59369 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
59370 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
59371 rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
59372 }
59373 } else {
59374 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveCallback");
59375 aRv.Throw(NS_ERROR_UNEXPECTED);
59376 return nullptr;
59377 }
59378 } else {
59379 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveCallback");
59380 aRv.Throw(NS_ERROR_UNEXPECTED);
59381 return nullptr;
59382 }
59383 return rvalDecl.forget();
59384}
59385
59386already_AddRefed<MyTestCallback>
59387TestJSImplInterfaceJSImpl::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm)
59388{
59389 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59390 if (aRv.Failed()) {
59391 return nullptr;
59392 }
59393 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59393); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59393; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59394 BindingCallContext& cx = s.GetCallContext();
59395
59396 JS::Rooted<JS::Value> rval(cx);
59397
59398 JS::Rooted<JS::Value> callable(cx);
59399 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59400 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59401 !InitIds(cx, atomsCache)) ||
59402 !GetCallableProperty(cx, atomsCache->receiveNullableCallback_id, &callable)) {
59403 aRv.Throw(NS_ERROR_UNEXPECTED);
59404 return nullptr;
59405 }
59406 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59407 if (!JS::Call(cx, thisValue, callable,
59408 JS::HandleValueArray::empty(), &rval)) {
59409 aRv.NoteJSContextException(cx);
59410 return nullptr;
59411 }
59412 RefPtr<MyTestCallback> rvalDecl;
59413 if (rval.isObject()) {
59414 if (JS::IsCallable(&rval.toObject())) {
59415 { // scope for tempRoot and tempGlobalRoot if needed
59416 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
59417 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
59418 rvalDecl = new MyTestCallback(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
59419 }
59420 } else {
59421 cx.ThrowErrorMessage<MSG_NOT_CALLABLE>("Return value of TestJSImplInterface.receiveNullableCallback");
59422 aRv.Throw(NS_ERROR_UNEXPECTED);
59423 return nullptr;
59424 }
59425 } else if (rval.isNullOrUndefined()) {
59426 rvalDecl = nullptr;
59427 } else {
59428 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableCallback");
59429 aRv.Throw(NS_ERROR_UNEXPECTED);
59430 return nullptr;
59431 }
59432 return rvalDecl.forget();
59433}
59434
59435void
59436TestJSImplInterfaceJSImpl::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
59437{
59438 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableTreatAsNullCallbackWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59439 if (aRv.Failed()) {
59440 return;
59441 }
59442 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59442); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59442; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59443 BindingCallContext& cx = s.GetCallContext();
59444
59445 JS::Rooted<JS::Value> rval(cx);
59446 JS::RootedVector<JS::Value> argv(cx);
59447 if (!argv.resize(1)) {
59448 // That threw an exception on the JSContext, and our CallSetup will do
59449 // the right thing with that.
59450 return;
59451 }
59452 unsigned argc = 1;
59453
59454 do {
59455 if (arg) {
59456 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
59457 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
59458 aRv.Throw(NS_ERROR_UNEXPECTED);
59459 return;
59460 }
59461 break;
59462 } else {
59463 argv[0].setNull();
59464 break;
59465 }
59466 } while (false);
59467
59468 JS::Rooted<JS::Value> callable(cx);
59469 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59470 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59471 !InitIds(cx, atomsCache)) ||
59472 !GetCallableProperty(cx, atomsCache->passOptionalNullableTreatAsNullCallbackWithDefaultValue_id, &callable)) {
59473 aRv.Throw(NS_ERROR_UNEXPECTED);
59474 return;
59475 }
59476 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59477 if (!JS::Call(cx, thisValue, callable,
59478 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59479 aRv.NoteJSContextException(cx);
59480 return;
59481 }
59482}
59483
59484void
59485TestJSImplInterfaceJSImpl::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59486{
59487 CallSetup s(this, aRv, "TestJSImplInterface.passAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59488 if (aRv.Failed()) {
59489 return;
59490 }
59491 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59491); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59491; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59492 BindingCallContext& cx = s.GetCallContext();
59493
59494 JS::Rooted<JS::Value> rval(cx);
59495 JS::RootedVector<JS::Value> argv(cx);
59496 if (!argv.resize(1)) {
59497 // That threw an exception on the JSContext, and our CallSetup will do
59498 // the right thing with that.
59499 return;
59500 }
59501 unsigned argc = 1;
59502
59503 do {
59504 JS::ExposeValueToActiveJS(arg);
59505 argv[0].set(arg);
59506 if (!MaybeWrapValue(cx, argv[0])) {
59507 aRv.Throw(NS_ERROR_UNEXPECTED);
59508 return;
59509 }
59510 break;
59511 } while (false);
59512
59513 JS::Rooted<JS::Value> callable(cx);
59514 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59515 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59516 !InitIds(cx, atomsCache)) ||
59517 !GetCallableProperty(cx, atomsCache->passAny_id, &callable)) {
59518 aRv.Throw(NS_ERROR_UNEXPECTED);
59519 return;
59520 }
59521 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59522 if (!JS::Call(cx, thisValue, callable,
59523 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59524 aRv.NoteJSContextException(cx);
59525 return;
59526 }
59527}
59528
59529void
59530TestJSImplInterfaceJSImpl::PassVariadicAny(const nsTArray<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59531{
59532 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59533 if (aRv.Failed()) {
59534 return;
59535 }
59536 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59536); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59536; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59537 BindingCallContext& cx = s.GetCallContext();
59538
59539 JS::Rooted<JS::Value> rval(cx);
59540 JS::RootedVector<JS::Value> argv(cx);
59541 if (!argv.resize((1 - 1) + arg.Length())) {
59542 // That threw an exception on the JSContext, and our CallSetup will do
59543 // the right thing with that.
59544 return;
59545 }
59546 unsigned argc = (1 - 1) + arg.Length();
59547
59548 do {
59549 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
59550 JS::ExposeValueToActiveJS(arg[idx]);
59551 argv[0 + idx].set(arg[idx]);
59552 if (!MaybeWrapValue(cx, argv[0 + idx])) {
59553 aRv.Throw(NS_ERROR_UNEXPECTED);
59554 return;
59555 }
59556 continue;
59557 }
59558 break;
59559 } while (false);
59560
59561 JS::Rooted<JS::Value> callable(cx);
59562 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59563 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59564 !InitIds(cx, atomsCache)) ||
59565 !GetCallableProperty(cx, atomsCache->passVariadicAny_id, &callable)) {
59566 aRv.Throw(NS_ERROR_UNEXPECTED);
59567 return;
59568 }
59569 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59570 if (!JS::Call(cx, thisValue, callable,
59571 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59572 aRv.NoteJSContextException(cx);
59573 return;
59574 }
59575}
59576
59577void
59578TestJSImplInterfaceJSImpl::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59579{
59580 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59581 if (aRv.Failed()) {
59582 return;
59583 }
59584 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59584); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59584; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59585 BindingCallContext& cx = s.GetCallContext();
59586
59587 JS::Rooted<JS::Value> rval(cx);
59588 JS::RootedVector<JS::Value> argv(cx);
59589 if (!argv.resize(1)) {
59590 // That threw an exception on the JSContext, and our CallSetup will do
59591 // the right thing with that.
59592 return;
59593 }
59594 unsigned argc = 1;
59595
59596 do {
59597 JS::ExposeValueToActiveJS(arg);
59598 argv[0].set(arg);
59599 if (!MaybeWrapValue(cx, argv[0])) {
59600 aRv.Throw(NS_ERROR_UNEXPECTED);
59601 return;
59602 }
59603 break;
59604 } while (false);
59605
59606 JS::Rooted<JS::Value> callable(cx);
59607 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59608 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59609 !InitIds(cx, atomsCache)) ||
59610 !GetCallableProperty(cx, atomsCache->passOptionalAny_id, &callable)) {
59611 aRv.Throw(NS_ERROR_UNEXPECTED);
59612 return;
59613 }
59614 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59615 if (!JS::Call(cx, thisValue, callable,
59616 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59617 aRv.NoteJSContextException(cx);
59618 return;
59619 }
59620}
59621
59622void
59623TestJSImplInterfaceJSImpl::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
59624{
59625 CallSetup s(this, aRv, "TestJSImplInterface.passAnyDefaultNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59626 if (aRv.Failed()) {
59627 return;
59628 }
59629 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59629); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59629; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59630 BindingCallContext& cx = s.GetCallContext();
59631
59632 JS::Rooted<JS::Value> rval(cx);
59633 JS::RootedVector<JS::Value> argv(cx);
59634 if (!argv.resize(1)) {
59635 // That threw an exception on the JSContext, and our CallSetup will do
59636 // the right thing with that.
59637 return;
59638 }
59639 unsigned argc = 1;
59640
59641 do {
59642 JS::ExposeValueToActiveJS(arg);
59643 argv[0].set(arg);
59644 if (!MaybeWrapValue(cx, argv[0])) {
59645 aRv.Throw(NS_ERROR_UNEXPECTED);
59646 return;
59647 }
59648 break;
59649 } while (false);
59650
59651 JS::Rooted<JS::Value> callable(cx);
59652 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59653 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59654 !InitIds(cx, atomsCache)) ||
59655 !GetCallableProperty(cx, atomsCache->passAnyDefaultNull_id, &callable)) {
59656 aRv.Throw(NS_ERROR_UNEXPECTED);
59657 return;
59658 }
59659 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59660 if (!JS::Call(cx, thisValue, callable,
59661 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59662 aRv.NoteJSContextException(cx);
59663 return;
59664 }
59665}
59666
59667void
59668TestJSImplInterfaceJSImpl::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59669{
59670 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59671 if (aRv.Failed()) {
59672 return;
59673 }
59674 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59674); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59674; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59675 BindingCallContext& cx = s.GetCallContext();
59676
59677 JS::Rooted<JS::Value> rval(cx);
59678 JS::RootedVector<JS::Value> argv(cx);
59679 if (!argv.resize(1)) {
59680 // That threw an exception on the JSContext, and our CallSetup will do
59681 // the right thing with that.
59682 return;
59683 }
59684 unsigned argc = 1;
59685
59686 do {
59687
59688 uint32_t length = arg.Length();
59689 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59690 if (!returnArray) {
59691 aRv.Throw(NS_ERROR_UNEXPECTED);
59692 return;
59693 }
59694 // Scope for 'tmp'
59695 {
59696 JS::Rooted<JS::Value> tmp(cx);
59697 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59698 // Control block to let us common up the JS_DefineElement calls when there
59699 // are different ways to succeed at wrapping the object.
59700 do {
59701 JS::ExposeValueToActiveJS(arg[sequenceIdx0]);
59702 tmp.set(arg[sequenceIdx0]);
59703 if (!MaybeWrapValue(cx, &tmp)) {
59704 aRv.Throw(NS_ERROR_UNEXPECTED);
59705 return;
59706 }
59707 break;
59708 } while (false);
59709 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59710 JSPROP_ENUMERATE)) {
59711 aRv.Throw(NS_ERROR_UNEXPECTED);
59712 return;
59713 }
59714 }
59715 }
59716 argv[0].setObject(*returnArray);
59717 break;
59718 } while (false);
59719
59720 JS::Rooted<JS::Value> callable(cx);
59721 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59722 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59723 !InitIds(cx, atomsCache)) ||
59724 !GetCallableProperty(cx, atomsCache->passSequenceOfAny_id, &callable)) {
59725 aRv.Throw(NS_ERROR_UNEXPECTED);
59726 return;
59727 }
59728 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59729 if (!JS::Call(cx, thisValue, callable,
59730 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59731 aRv.NoteJSContextException(cx);
59732 return;
59733 }
59734}
59735
59736void
59737TestJSImplInterfaceJSImpl::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59738{
59739 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59740 if (aRv.Failed()) {
59741 return;
59742 }
59743 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59743); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59743; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59744 BindingCallContext& cx = s.GetCallContext();
59745
59746 JS::Rooted<JS::Value> rval(cx);
59747 JS::RootedVector<JS::Value> argv(cx);
59748 if (!argv.resize(1)) {
59749 // That threw an exception on the JSContext, and our CallSetup will do
59750 // the right thing with that.
59751 return;
59752 }
59753 unsigned argc = 1;
59754
59755 do {
59756
59757 if (arg.IsNull()) {
59758 argv[0].setNull();
59759 break;
59760 }
59761
59762 uint32_t length = arg.Value().Length();
59763 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59764 if (!returnArray) {
59765 aRv.Throw(NS_ERROR_UNEXPECTED);
59766 return;
59767 }
59768 // Scope for 'tmp'
59769 {
59770 JS::Rooted<JS::Value> tmp(cx);
59771 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59772 // Control block to let us common up the JS_DefineElement calls when there
59773 // are different ways to succeed at wrapping the object.
59774 do {
59775 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
59776 tmp.set(arg.Value()[sequenceIdx0]);
59777 if (!MaybeWrapValue(cx, &tmp)) {
59778 aRv.Throw(NS_ERROR_UNEXPECTED);
59779 return;
59780 }
59781 break;
59782 } while (false);
59783 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59784 JSPROP_ENUMERATE)) {
59785 aRv.Throw(NS_ERROR_UNEXPECTED);
59786 return;
59787 }
59788 }
59789 }
59790 argv[0].setObject(*returnArray);
59791 break;
59792 } while (false);
59793
59794 JS::Rooted<JS::Value> callable(cx);
59795 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59796 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59797 !InitIds(cx, atomsCache)) ||
59798 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfAny_id, &callable)) {
59799 aRv.Throw(NS_ERROR_UNEXPECTED);
59800 return;
59801 }
59802 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59803 if (!JS::Call(cx, thisValue, callable,
59804 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59805 aRv.NoteJSContextException(cx);
59806 return;
59807 }
59808}
59809
59810void
59811TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59812{
59813 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59814 if (aRv.Failed()) {
59815 return;
59816 }
59817 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59817); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59817; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59818 BindingCallContext& cx = s.GetCallContext();
59819
59820 JS::Rooted<JS::Value> rval(cx);
59821 JS::RootedVector<JS::Value> argv(cx);
59822 if (!argv.resize(1)) {
59823 // That threw an exception on the JSContext, and our CallSetup will do
59824 // the right thing with that.
59825 return;
59826 }
59827 unsigned argc = 1;
59828
59829 do {
59830 if (arg.WasPassed()) {
59831
59832 uint32_t length = arg.Value().Length();
59833 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59834 if (!returnArray) {
59835 aRv.Throw(NS_ERROR_UNEXPECTED);
59836 return;
59837 }
59838 // Scope for 'tmp'
59839 {
59840 JS::Rooted<JS::Value> tmp(cx);
59841 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59842 // Control block to let us common up the JS_DefineElement calls when there
59843 // are different ways to succeed at wrapping the object.
59844 do {
59845 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
59846 tmp.set(arg.Value()[sequenceIdx0]);
59847 if (!MaybeWrapValue(cx, &tmp)) {
59848 aRv.Throw(NS_ERROR_UNEXPECTED);
59849 return;
59850 }
59851 break;
59852 } while (false);
59853 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59854 JSPROP_ENUMERATE)) {
59855 aRv.Throw(NS_ERROR_UNEXPECTED);
59856 return;
59857 }
59858 }
59859 }
59860 argv[0].setObject(*returnArray);
59861 break;
59862 } else if (argc == 1) {
59863 // This is our current trailing argument; reduce argc
59864 --argc;
59865 } else {
59866 argv[0].setUndefined();
59867 }
59868 } while (false);
59869
59870 JS::Rooted<JS::Value> callable(cx);
59871 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59872 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59873 !InitIds(cx, atomsCache)) ||
59874 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAny_id, &callable)) {
59875 aRv.Throw(NS_ERROR_UNEXPECTED);
59876 return;
59877 }
59878 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59879 if (!JS::Call(cx, thisValue, callable,
59880 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59881 aRv.NoteJSContextException(cx);
59882 return;
59883 }
59884}
59885
59886void
59887TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59888{
59889 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59890 if (aRv.Failed()) {
59891 return;
59892 }
59893 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59893); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59893; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59894 BindingCallContext& cx = s.GetCallContext();
59895
59896 JS::Rooted<JS::Value> rval(cx);
59897 JS::RootedVector<JS::Value> argv(cx);
59898 if (!argv.resize(1)) {
59899 // That threw an exception on the JSContext, and our CallSetup will do
59900 // the right thing with that.
59901 return;
59902 }
59903 unsigned argc = 1;
59904
59905 do {
59906 if (arg.WasPassed()) {
59907
59908 if (arg.Value().IsNull()) {
59909 argv[0].setNull();
59910 break;
59911 }
59912
59913 uint32_t length = arg.Value().Value().Length();
59914 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59915 if (!returnArray) {
59916 aRv.Throw(NS_ERROR_UNEXPECTED);
59917 return;
59918 }
59919 // Scope for 'tmp'
59920 {
59921 JS::Rooted<JS::Value> tmp(cx);
59922 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
59923 // Control block to let us common up the JS_DefineElement calls when there
59924 // are different ways to succeed at wrapping the object.
59925 do {
59926 JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0]);
59927 tmp.set(arg.Value().Value()[sequenceIdx0]);
59928 if (!MaybeWrapValue(cx, &tmp)) {
59929 aRv.Throw(NS_ERROR_UNEXPECTED);
59930 return;
59931 }
59932 break;
59933 } while (false);
59934 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
59935 JSPROP_ENUMERATE)) {
59936 aRv.Throw(NS_ERROR_UNEXPECTED);
59937 return;
59938 }
59939 }
59940 }
59941 argv[0].setObject(*returnArray);
59942 break;
59943 } else if (argc == 1) {
59944 // This is our current trailing argument; reduce argc
59945 --argc;
59946 } else {
59947 argv[0].setUndefined();
59948 }
59949 } while (false);
59950
59951 JS::Rooted<JS::Value> callable(cx);
59952 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
59953 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
59954 !InitIds(cx, atomsCache)) ||
59955 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfAny_id, &callable)) {
59956 aRv.Throw(NS_ERROR_UNEXPECTED);
59957 return;
59958 }
59959 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
59960 if (!JS::Call(cx, thisValue, callable,
59961 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
59962 aRv.NoteJSContextException(cx);
59963 return;
59964 }
59965}
59966
59967void
59968TestJSImplInterfaceJSImpl::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
59969{
59970 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalSequenceOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
59971 if (aRv.Failed()) {
59972 return;
59973 }
59974 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 59974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 59974; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
59975 BindingCallContext& cx = s.GetCallContext();
59976
59977 JS::Rooted<JS::Value> rval(cx);
59978 JS::RootedVector<JS::Value> argv(cx);
59979 if (!argv.resize(1)) {
59980 // That threw an exception on the JSContext, and our CallSetup will do
59981 // the right thing with that.
59982 return;
59983 }
59984 unsigned argc = 1;
59985
59986 do {
59987
59988 if (arg.IsNull()) {
59989 argv[0].setNull();
59990 break;
59991 }
59992
59993 uint32_t length = arg.Value().Length();
59994 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
59995 if (!returnArray) {
59996 aRv.Throw(NS_ERROR_UNEXPECTED);
59997 return;
59998 }
59999 // Scope for 'tmp'
60000 {
60001 JS::Rooted<JS::Value> tmp(cx);
60002 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60003 // Control block to let us common up the JS_DefineElement calls when there
60004 // are different ways to succeed at wrapping the object.
60005 do {
60006 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0]);
60007 tmp.set(arg.Value()[sequenceIdx0]);
60008 if (!MaybeWrapValue(cx, &tmp)) {
60009 aRv.Throw(NS_ERROR_UNEXPECTED);
60010 return;
60011 }
60012 break;
60013 } while (false);
60014 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60015 JSPROP_ENUMERATE)) {
60016 aRv.Throw(NS_ERROR_UNEXPECTED);
60017 return;
60018 }
60019 }
60020 }
60021 argv[0].setObject(*returnArray);
60022 break;
60023 } while (false);
60024
60025 JS::Rooted<JS::Value> callable(cx);
60026 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60027 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60028 !InitIds(cx, atomsCache)) ||
60029 !GetCallableProperty(cx, atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id, &callable)) {
60030 aRv.Throw(NS_ERROR_UNEXPECTED);
60031 return;
60032 }
60033 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60034 if (!JS::Call(cx, thisValue, callable,
60035 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60036 aRv.NoteJSContextException(cx);
60037 return;
60038 }
60039}
60040
60041void
60042TestJSImplInterfaceJSImpl::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60043{
60044 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60045 if (aRv.Failed()) {
60046 return;
60047 }
60048 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60048; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60049 BindingCallContext& cx = s.GetCallContext();
60050
60051 JS::Rooted<JS::Value> rval(cx);
60052 JS::RootedVector<JS::Value> argv(cx);
60053 if (!argv.resize(1)) {
60054 // That threw an exception on the JSContext, and our CallSetup will do
60055 // the right thing with that.
60056 return;
60057 }
60058 unsigned argc = 1;
60059
60060 do {
60061
60062 uint32_t length = arg.Length();
60063 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60064 if (!returnArray) {
60065 aRv.Throw(NS_ERROR_UNEXPECTED);
60066 return;
60067 }
60068 // Scope for 'tmp'
60069 {
60070 JS::Rooted<JS::Value> tmp(cx);
60071 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60072 // Control block to let us common up the JS_DefineElement calls when there
60073 // are different ways to succeed at wrapping the object.
60074 do {
60075
60076 uint32_t length = arg[sequenceIdx0].Length();
60077 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60078 if (!returnArray) {
60079 aRv.Throw(NS_ERROR_UNEXPECTED);
60080 return;
60081 }
60082 // Scope for 'tmp'
60083 {
60084 JS::Rooted<JS::Value> tmp(cx);
60085 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60086 // Control block to let us common up the JS_DefineElement calls when there
60087 // are different ways to succeed at wrapping the object.
60088 do {
60089 JS::ExposeValueToActiveJS(arg[sequenceIdx0][sequenceIdx1]);
60090 tmp.set(arg[sequenceIdx0][sequenceIdx1]);
60091 if (!MaybeWrapValue(cx, &tmp)) {
60092 aRv.Throw(NS_ERROR_UNEXPECTED);
60093 return;
60094 }
60095 break;
60096 } while (false);
60097 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60098 JSPROP_ENUMERATE)) {
60099 aRv.Throw(NS_ERROR_UNEXPECTED);
60100 return;
60101 }
60102 }
60103 }
60104 tmp.setObject(*returnArray);
60105 break;
60106 } while (false);
60107 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60108 JSPROP_ENUMERATE)) {
60109 aRv.Throw(NS_ERROR_UNEXPECTED);
60110 return;
60111 }
60112 }
60113 }
60114 argv[0].setObject(*returnArray);
60115 break;
60116 } while (false);
60117
60118 JS::Rooted<JS::Value> callable(cx);
60119 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60120 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60121 !InitIds(cx, atomsCache)) ||
60122 !GetCallableProperty(cx, atomsCache->passSequenceOfSequenceOfAny_id, &callable)) {
60123 aRv.Throw(NS_ERROR_UNEXPECTED);
60124 return;
60125 }
60126 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60127 if (!JS::Call(cx, thisValue, callable,
60128 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60129 aRv.NoteJSContextException(cx);
60130 return;
60131 }
60132}
60133
60134void
60135TestJSImplInterfaceJSImpl::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60136{
60137 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60138 if (aRv.Failed()) {
60139 return;
60140 }
60141 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60141; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60142 BindingCallContext& cx = s.GetCallContext();
60143
60144 JS::Rooted<JS::Value> rval(cx);
60145 JS::RootedVector<JS::Value> argv(cx);
60146 if (!argv.resize(1)) {
60147 // That threw an exception on the JSContext, and our CallSetup will do
60148 // the right thing with that.
60149 return;
60150 }
60151 unsigned argc = 1;
60152
60153 do {
60154
60155 uint32_t length = arg.Length();
60156 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60157 if (!returnArray) {
60158 aRv.Throw(NS_ERROR_UNEXPECTED);
60159 return;
60160 }
60161 // Scope for 'tmp'
60162 {
60163 JS::Rooted<JS::Value> tmp(cx);
60164 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60165 // Control block to let us common up the JS_DefineElement calls when there
60166 // are different ways to succeed at wrapping the object.
60167 do {
60168
60169 if (arg[sequenceIdx0].IsNull()) {
60170 tmp.setNull();
60171 break;
60172 }
60173
60174 uint32_t length = arg[sequenceIdx0].Value().Length();
60175 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60176 if (!returnArray) {
60177 aRv.Throw(NS_ERROR_UNEXPECTED);
60178 return;
60179 }
60180 // Scope for 'tmp'
60181 {
60182 JS::Rooted<JS::Value> tmp(cx);
60183 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60184 // Control block to let us common up the JS_DefineElement calls when there
60185 // are different ways to succeed at wrapping the object.
60186 do {
60187 JS::ExposeValueToActiveJS(arg[sequenceIdx0].Value()[sequenceIdx1]);
60188 tmp.set(arg[sequenceIdx0].Value()[sequenceIdx1]);
60189 if (!MaybeWrapValue(cx, &tmp)) {
60190 aRv.Throw(NS_ERROR_UNEXPECTED);
60191 return;
60192 }
60193 break;
60194 } while (false);
60195 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60196 JSPROP_ENUMERATE)) {
60197 aRv.Throw(NS_ERROR_UNEXPECTED);
60198 return;
60199 }
60200 }
60201 }
60202 tmp.setObject(*returnArray);
60203 break;
60204 } while (false);
60205 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60206 JSPROP_ENUMERATE)) {
60207 aRv.Throw(NS_ERROR_UNEXPECTED);
60208 return;
60209 }
60210 }
60211 }
60212 argv[0].setObject(*returnArray);
60213 break;
60214 } while (false);
60215
60216 JS::Rooted<JS::Value> callable(cx);
60217 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60218 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60219 !InitIds(cx, atomsCache)) ||
60220 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableSequenceOfAny_id, &callable)) {
60221 aRv.Throw(NS_ERROR_UNEXPECTED);
60222 return;
60223 }
60224 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60225 if (!JS::Call(cx, thisValue, callable,
60226 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60227 aRv.NoteJSContextException(cx);
60228 return;
60229 }
60230}
60231
60232void
60233TestJSImplInterfaceJSImpl::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60234{
60235 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60236 if (aRv.Failed()) {
60237 return;
60238 }
60239 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60239); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60239; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60240 BindingCallContext& cx = s.GetCallContext();
60241
60242 JS::Rooted<JS::Value> rval(cx);
60243 JS::RootedVector<JS::Value> argv(cx);
60244 if (!argv.resize(1)) {
60245 // That threw an exception on the JSContext, and our CallSetup will do
60246 // the right thing with that.
60247 return;
60248 }
60249 unsigned argc = 1;
60250
60251 do {
60252
60253 if (arg.IsNull()) {
60254 argv[0].setNull();
60255 break;
60256 }
60257
60258 uint32_t length = arg.Value().Length();
60259 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60260 if (!returnArray) {
60261 aRv.Throw(NS_ERROR_UNEXPECTED);
60262 return;
60263 }
60264 // Scope for 'tmp'
60265 {
60266 JS::Rooted<JS::Value> tmp(cx);
60267 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60268 // Control block to let us common up the JS_DefineElement calls when there
60269 // are different ways to succeed at wrapping the object.
60270 do {
60271
60272 if (arg.Value()[sequenceIdx0].IsNull()) {
60273 tmp.setNull();
60274 break;
60275 }
60276
60277 uint32_t length = arg.Value()[sequenceIdx0].Value().Length();
60278 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60279 if (!returnArray) {
60280 aRv.Throw(NS_ERROR_UNEXPECTED);
60281 return;
60282 }
60283 // Scope for 'tmp'
60284 {
60285 JS::Rooted<JS::Value> tmp(cx);
60286 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60287 // Control block to let us common up the JS_DefineElement calls when there
60288 // are different ways to succeed at wrapping the object.
60289 do {
60290 JS::ExposeValueToActiveJS(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]);
60291 tmp.set(arg.Value()[sequenceIdx0].Value()[sequenceIdx1]);
60292 if (!MaybeWrapValue(cx, &tmp)) {
60293 aRv.Throw(NS_ERROR_UNEXPECTED);
60294 return;
60295 }
60296 break;
60297 } while (false);
60298 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60299 JSPROP_ENUMERATE)) {
60300 aRv.Throw(NS_ERROR_UNEXPECTED);
60301 return;
60302 }
60303 }
60304 }
60305 tmp.setObject(*returnArray);
60306 break;
60307 } while (false);
60308 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60309 JSPROP_ENUMERATE)) {
60310 aRv.Throw(NS_ERROR_UNEXPECTED);
60311 return;
60312 }
60313 }
60314 }
60315 argv[0].setObject(*returnArray);
60316 break;
60317 } while (false);
60318
60319 JS::Rooted<JS::Value> callable(cx);
60320 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60321 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60322 !InitIds(cx, atomsCache)) ||
60323 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfNullableSequenceOfAny_id, &callable)) {
60324 aRv.Throw(NS_ERROR_UNEXPECTED);
60325 return;
60326 }
60327 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60328 if (!JS::Call(cx, thisValue, callable,
60329 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60330 aRv.NoteJSContextException(cx);
60331 return;
60332 }
60333}
60334
60335void
60336TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60337{
60338 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60339 if (aRv.Failed()) {
60340 return;
60341 }
60342 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60342); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60342; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60343 BindingCallContext& cx = s.GetCallContext();
60344
60345 JS::Rooted<JS::Value> rval(cx);
60346 JS::RootedVector<JS::Value> argv(cx);
60347 if (!argv.resize(1)) {
60348 // That threw an exception on the JSContext, and our CallSetup will do
60349 // the right thing with that.
60350 return;
60351 }
60352 unsigned argc = 1;
60353
60354 do {
60355 if (arg.WasPassed()) {
60356
60357 if (arg.Value().IsNull()) {
60358 argv[0].setNull();
60359 break;
60360 }
60361
60362 uint32_t length = arg.Value().Value().Length();
60363 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60364 if (!returnArray) {
60365 aRv.Throw(NS_ERROR_UNEXPECTED);
60366 return;
60367 }
60368 // Scope for 'tmp'
60369 {
60370 JS::Rooted<JS::Value> tmp(cx);
60371 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
60372 // Control block to let us common up the JS_DefineElement calls when there
60373 // are different ways to succeed at wrapping the object.
60374 do {
60375
60376 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
60377 tmp.setNull();
60378 break;
60379 }
60380
60381 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
60382 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
60383 if (!returnArray) {
60384 aRv.Throw(NS_ERROR_UNEXPECTED);
60385 return;
60386 }
60387 // Scope for 'tmp'
60388 {
60389 JS::Rooted<JS::Value> tmp(cx);
60390 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
60391 // Control block to let us common up the JS_DefineElement calls when there
60392 // are different ways to succeed at wrapping the object.
60393 do {
60394 JS::ExposeValueToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
60395 tmp.set(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
60396 if (!MaybeWrapValue(cx, &tmp)) {
60397 aRv.Throw(NS_ERROR_UNEXPECTED);
60398 return;
60399 }
60400 break;
60401 } while (false);
60402 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
60403 JSPROP_ENUMERATE)) {
60404 aRv.Throw(NS_ERROR_UNEXPECTED);
60405 return;
60406 }
60407 }
60408 }
60409 tmp.setObject(*returnArray);
60410 break;
60411 } while (false);
60412 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
60413 JSPROP_ENUMERATE)) {
60414 aRv.Throw(NS_ERROR_UNEXPECTED);
60415 return;
60416 }
60417 }
60418 }
60419 argv[0].setObject(*returnArray);
60420 break;
60421 } else if (argc == 1) {
60422 // This is our current trailing argument; reduce argc
60423 --argc;
60424 } else {
60425 argv[0].setUndefined();
60426 }
60427 } while (false);
60428
60429 JS::Rooted<JS::Value> callable(cx);
60430 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60431 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60432 !InitIds(cx, atomsCache)) ||
60433 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id, &callable)) {
60434 aRv.Throw(NS_ERROR_UNEXPECTED);
60435 return;
60436 }
60437 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60438 if (!JS::Call(cx, thisValue, callable,
60439 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60440 aRv.NoteJSContextException(cx);
60441 return;
60442 }
60443}
60444
60445void
60446TestJSImplInterfaceJSImpl::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60447{
60448 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60449 if (aRv.Failed()) {
60450 return;
60451 }
60452 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60452); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60452; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60453 BindingCallContext& cx = s.GetCallContext();
60454
60455 JS::Rooted<JS::Value> rval(cx);
60456 JS::RootedVector<JS::Value> argv(cx);
60457 if (!argv.resize(1)) {
60458 // That threw an exception on the JSContext, and our CallSetup will do
60459 // the right thing with that.
60460 return;
60461 }
60462 unsigned argc = 1;
60463
60464 do {
60465
60466 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60467 if (!returnObj) {
60468 aRv.Throw(NS_ERROR_UNEXPECTED);
60469 return;
60470 }
60471 // Scope for 'tmp'
60472 {
60473 JS::Rooted<JS::Value> tmp(cx);
60474 for (auto& entry : arg.Entries()) {
60475 auto& recordValue0 = entry.mValue;
60476 // Control block to let us common up the JS_DefineUCProperty calls when there
60477 // are different ways to succeed at wrapping the value.
60478 do {
60479 JS::ExposeValueToActiveJS(recordValue0);
60480 tmp.set(recordValue0);
60481 if (!MaybeWrapValue(cx, &tmp)) {
60482 aRv.Throw(NS_ERROR_UNEXPECTED);
60483 return;
60484 }
60485 break;
60486 } while (false);
60487 if (!JS_DefineUCProperty(cx, returnObj,
60488 entry.mKey.BeginReading(),
60489 entry.mKey.Length(), tmp,
60490 JSPROP_ENUMERATE)) {
60491 aRv.Throw(NS_ERROR_UNEXPECTED);
60492 return;
60493 }
60494 }
60495 }
60496 argv[0].setObject(*returnObj);
60497 break;
60498 } while (false);
60499
60500 JS::Rooted<JS::Value> callable(cx);
60501 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60502 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60503 !InitIds(cx, atomsCache)) ||
60504 !GetCallableProperty(cx, atomsCache->passRecordOfAny_id, &callable)) {
60505 aRv.Throw(NS_ERROR_UNEXPECTED);
60506 return;
60507 }
60508 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60509 if (!JS::Call(cx, thisValue, callable,
60510 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60511 aRv.NoteJSContextException(cx);
60512 return;
60513 }
60514}
60515
60516void
60517TestJSImplInterfaceJSImpl::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60518{
60519 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60520 if (aRv.Failed()) {
60521 return;
60522 }
60523 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60523; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60524 BindingCallContext& cx = s.GetCallContext();
60525
60526 JS::Rooted<JS::Value> rval(cx);
60527 JS::RootedVector<JS::Value> argv(cx);
60528 if (!argv.resize(1)) {
60529 // That threw an exception on the JSContext, and our CallSetup will do
60530 // the right thing with that.
60531 return;
60532 }
60533 unsigned argc = 1;
60534
60535 do {
60536
60537 if (arg.IsNull()) {
60538 argv[0].setNull();
60539 break;
60540 }
60541
60542 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60543 if (!returnObj) {
60544 aRv.Throw(NS_ERROR_UNEXPECTED);
60545 return;
60546 }
60547 // Scope for 'tmp'
60548 {
60549 JS::Rooted<JS::Value> tmp(cx);
60550 for (auto& entry : arg.Value().Entries()) {
60551 auto& recordValue0 = entry.mValue;
60552 // Control block to let us common up the JS_DefineUCProperty calls when there
60553 // are different ways to succeed at wrapping the value.
60554 do {
60555 JS::ExposeValueToActiveJS(recordValue0);
60556 tmp.set(recordValue0);
60557 if (!MaybeWrapValue(cx, &tmp)) {
60558 aRv.Throw(NS_ERROR_UNEXPECTED);
60559 return;
60560 }
60561 break;
60562 } while (false);
60563 if (!JS_DefineUCProperty(cx, returnObj,
60564 entry.mKey.BeginReading(),
60565 entry.mKey.Length(), tmp,
60566 JSPROP_ENUMERATE)) {
60567 aRv.Throw(NS_ERROR_UNEXPECTED);
60568 return;
60569 }
60570 }
60571 }
60572 argv[0].setObject(*returnObj);
60573 break;
60574 } while (false);
60575
60576 JS::Rooted<JS::Value> callable(cx);
60577 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60578 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60579 !InitIds(cx, atomsCache)) ||
60580 !GetCallableProperty(cx, atomsCache->passNullableRecordOfAny_id, &callable)) {
60581 aRv.Throw(NS_ERROR_UNEXPECTED);
60582 return;
60583 }
60584 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60585 if (!JS::Call(cx, thisValue, callable,
60586 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60587 aRv.NoteJSContextException(cx);
60588 return;
60589 }
60590}
60591
60592void
60593TestJSImplInterfaceJSImpl::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60594{
60595 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60596 if (aRv.Failed()) {
60597 return;
60598 }
60599 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60599); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60599; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60600 BindingCallContext& cx = s.GetCallContext();
60601
60602 JS::Rooted<JS::Value> rval(cx);
60603 JS::RootedVector<JS::Value> argv(cx);
60604 if (!argv.resize(1)) {
60605 // That threw an exception on the JSContext, and our CallSetup will do
60606 // the right thing with that.
60607 return;
60608 }
60609 unsigned argc = 1;
60610
60611 do {
60612 if (arg.WasPassed()) {
60613
60614 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60615 if (!returnObj) {
60616 aRv.Throw(NS_ERROR_UNEXPECTED);
60617 return;
60618 }
60619 // Scope for 'tmp'
60620 {
60621 JS::Rooted<JS::Value> tmp(cx);
60622 for (auto& entry : arg.Value().Entries()) {
60623 auto& recordValue0 = entry.mValue;
60624 // Control block to let us common up the JS_DefineUCProperty calls when there
60625 // are different ways to succeed at wrapping the value.
60626 do {
60627 JS::ExposeValueToActiveJS(recordValue0);
60628 tmp.set(recordValue0);
60629 if (!MaybeWrapValue(cx, &tmp)) {
60630 aRv.Throw(NS_ERROR_UNEXPECTED);
60631 return;
60632 }
60633 break;
60634 } while (false);
60635 if (!JS_DefineUCProperty(cx, returnObj,
60636 entry.mKey.BeginReading(),
60637 entry.mKey.Length(), tmp,
60638 JSPROP_ENUMERATE)) {
60639 aRv.Throw(NS_ERROR_UNEXPECTED);
60640 return;
60641 }
60642 }
60643 }
60644 argv[0].setObject(*returnObj);
60645 break;
60646 } else if (argc == 1) {
60647 // This is our current trailing argument; reduce argc
60648 --argc;
60649 } else {
60650 argv[0].setUndefined();
60651 }
60652 } while (false);
60653
60654 JS::Rooted<JS::Value> callable(cx);
60655 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60656 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60657 !InitIds(cx, atomsCache)) ||
60658 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAny_id, &callable)) {
60659 aRv.Throw(NS_ERROR_UNEXPECTED);
60660 return;
60661 }
60662 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60663 if (!JS::Call(cx, thisValue, callable,
60664 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60665 aRv.NoteJSContextException(cx);
60666 return;
60667 }
60668}
60669
60670void
60671TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60672{
60673 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60674 if (aRv.Failed()) {
60675 return;
60676 }
60677 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60677); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60677; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60678 BindingCallContext& cx = s.GetCallContext();
60679
60680 JS::Rooted<JS::Value> rval(cx);
60681 JS::RootedVector<JS::Value> argv(cx);
60682 if (!argv.resize(1)) {
60683 // That threw an exception on the JSContext, and our CallSetup will do
60684 // the right thing with that.
60685 return;
60686 }
60687 unsigned argc = 1;
60688
60689 do {
60690 if (arg.WasPassed()) {
60691
60692 if (arg.Value().IsNull()) {
60693 argv[0].setNull();
60694 break;
60695 }
60696
60697 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60698 if (!returnObj) {
60699 aRv.Throw(NS_ERROR_UNEXPECTED);
60700 return;
60701 }
60702 // Scope for 'tmp'
60703 {
60704 JS::Rooted<JS::Value> tmp(cx);
60705 for (auto& entry : arg.Value().Value().Entries()) {
60706 auto& recordValue0 = entry.mValue;
60707 // Control block to let us common up the JS_DefineUCProperty calls when there
60708 // are different ways to succeed at wrapping the value.
60709 do {
60710 JS::ExposeValueToActiveJS(recordValue0);
60711 tmp.set(recordValue0);
60712 if (!MaybeWrapValue(cx, &tmp)) {
60713 aRv.Throw(NS_ERROR_UNEXPECTED);
60714 return;
60715 }
60716 break;
60717 } while (false);
60718 if (!JS_DefineUCProperty(cx, returnObj,
60719 entry.mKey.BeginReading(),
60720 entry.mKey.Length(), tmp,
60721 JSPROP_ENUMERATE)) {
60722 aRv.Throw(NS_ERROR_UNEXPECTED);
60723 return;
60724 }
60725 }
60726 }
60727 argv[0].setObject(*returnObj);
60728 break;
60729 } else if (argc == 1) {
60730 // This is our current trailing argument; reduce argc
60731 --argc;
60732 } else {
60733 argv[0].setUndefined();
60734 }
60735 } while (false);
60736
60737 JS::Rooted<JS::Value> callable(cx);
60738 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60739 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60740 !InitIds(cx, atomsCache)) ||
60741 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfAny_id, &callable)) {
60742 aRv.Throw(NS_ERROR_UNEXPECTED);
60743 return;
60744 }
60745 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60746 if (!JS::Call(cx, thisValue, callable,
60747 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60748 aRv.NoteJSContextException(cx);
60749 return;
60750 }
60751}
60752
60753void
60754TestJSImplInterfaceJSImpl::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60755{
60756 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalRecordOfAnyWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60757 if (aRv.Failed()) {
60758 return;
60759 }
60760 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60760); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60760; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60761 BindingCallContext& cx = s.GetCallContext();
60762
60763 JS::Rooted<JS::Value> rval(cx);
60764 JS::RootedVector<JS::Value> argv(cx);
60765 if (!argv.resize(1)) {
60766 // That threw an exception on the JSContext, and our CallSetup will do
60767 // the right thing with that.
60768 return;
60769 }
60770 unsigned argc = 1;
60771
60772 do {
60773
60774 if (arg.IsNull()) {
60775 argv[0].setNull();
60776 break;
60777 }
60778
60779 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60780 if (!returnObj) {
60781 aRv.Throw(NS_ERROR_UNEXPECTED);
60782 return;
60783 }
60784 // Scope for 'tmp'
60785 {
60786 JS::Rooted<JS::Value> tmp(cx);
60787 for (auto& entry : arg.Value().Entries()) {
60788 auto& recordValue0 = entry.mValue;
60789 // Control block to let us common up the JS_DefineUCProperty calls when there
60790 // are different ways to succeed at wrapping the value.
60791 do {
60792 JS::ExposeValueToActiveJS(recordValue0);
60793 tmp.set(recordValue0);
60794 if (!MaybeWrapValue(cx, &tmp)) {
60795 aRv.Throw(NS_ERROR_UNEXPECTED);
60796 return;
60797 }
60798 break;
60799 } while (false);
60800 if (!JS_DefineUCProperty(cx, returnObj,
60801 entry.mKey.BeginReading(),
60802 entry.mKey.Length(), tmp,
60803 JSPROP_ENUMERATE)) {
60804 aRv.Throw(NS_ERROR_UNEXPECTED);
60805 return;
60806 }
60807 }
60808 }
60809 argv[0].setObject(*returnObj);
60810 break;
60811 } while (false);
60812
60813 JS::Rooted<JS::Value> callable(cx);
60814 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60815 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60816 !InitIds(cx, atomsCache)) ||
60817 !GetCallableProperty(cx, atomsCache->passOptionalRecordOfAnyWithDefaultValue_id, &callable)) {
60818 aRv.Throw(NS_ERROR_UNEXPECTED);
60819 return;
60820 }
60821 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60822 if (!JS::Call(cx, thisValue, callable,
60823 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60824 aRv.NoteJSContextException(cx);
60825 return;
60826 }
60827}
60828
60829void
60830TestJSImplInterfaceJSImpl::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60831{
60832 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60833 if (aRv.Failed()) {
60834 return;
60835 }
60836 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60836); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60836; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60837 BindingCallContext& cx = s.GetCallContext();
60838
60839 JS::Rooted<JS::Value> rval(cx);
60840 JS::RootedVector<JS::Value> argv(cx);
60841 if (!argv.resize(1)) {
60842 // That threw an exception on the JSContext, and our CallSetup will do
60843 // the right thing with that.
60844 return;
60845 }
60846 unsigned argc = 1;
60847
60848 do {
60849
60850 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60851 if (!returnObj) {
60852 aRv.Throw(NS_ERROR_UNEXPECTED);
60853 return;
60854 }
60855 // Scope for 'tmp'
60856 {
60857 JS::Rooted<JS::Value> tmp(cx);
60858 for (auto& entry : arg.Entries()) {
60859 auto& recordValue0 = entry.mValue;
60860 // Control block to let us common up the JS_DefineUCProperty calls when there
60861 // are different ways to succeed at wrapping the value.
60862 do {
60863
60864 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60865 if (!returnObj) {
60866 aRv.Throw(NS_ERROR_UNEXPECTED);
60867 return;
60868 }
60869 // Scope for 'tmp'
60870 {
60871 JS::Rooted<JS::Value> tmp(cx);
60872 for (auto& entry : recordValue0.Entries()) {
60873 auto& recordValue1 = entry.mValue;
60874 // Control block to let us common up the JS_DefineUCProperty calls when there
60875 // are different ways to succeed at wrapping the value.
60876 do {
60877 JS::ExposeValueToActiveJS(recordValue1);
60878 tmp.set(recordValue1);
60879 if (!MaybeWrapValue(cx, &tmp)) {
60880 aRv.Throw(NS_ERROR_UNEXPECTED);
60881 return;
60882 }
60883 break;
60884 } while (false);
60885 if (!JS_DefineUCProperty(cx, returnObj,
60886 entry.mKey.BeginReading(),
60887 entry.mKey.Length(), tmp,
60888 JSPROP_ENUMERATE)) {
60889 aRv.Throw(NS_ERROR_UNEXPECTED);
60890 return;
60891 }
60892 }
60893 }
60894 tmp.setObject(*returnObj);
60895 break;
60896 } while (false);
60897 if (!JS_DefineUCProperty(cx, returnObj,
60898 entry.mKey.BeginReading(),
60899 entry.mKey.Length(), tmp,
60900 JSPROP_ENUMERATE)) {
60901 aRv.Throw(NS_ERROR_UNEXPECTED);
60902 return;
60903 }
60904 }
60905 }
60906 argv[0].setObject(*returnObj);
60907 break;
60908 } while (false);
60909
60910 JS::Rooted<JS::Value> callable(cx);
60911 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
60912 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
60913 !InitIds(cx, atomsCache)) ||
60914 !GetCallableProperty(cx, atomsCache->passRecordOfRecordOfAny_id, &callable)) {
60915 aRv.Throw(NS_ERROR_UNEXPECTED);
60916 return;
60917 }
60918 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
60919 if (!JS::Call(cx, thisValue, callable,
60920 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
60921 aRv.NoteJSContextException(cx);
60922 return;
60923 }
60924}
60925
60926void
60927TestJSImplInterfaceJSImpl::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
60928{
60929 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
60930 if (aRv.Failed()) {
60931 return;
60932 }
60933 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 60933); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 60933; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
60934 BindingCallContext& cx = s.GetCallContext();
60935
60936 JS::Rooted<JS::Value> rval(cx);
60937 JS::RootedVector<JS::Value> argv(cx);
60938 if (!argv.resize(1)) {
60939 // That threw an exception on the JSContext, and our CallSetup will do
60940 // the right thing with that.
60941 return;
60942 }
60943 unsigned argc = 1;
60944
60945 do {
60946
60947 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60948 if (!returnObj) {
60949 aRv.Throw(NS_ERROR_UNEXPECTED);
60950 return;
60951 }
60952 // Scope for 'tmp'
60953 {
60954 JS::Rooted<JS::Value> tmp(cx);
60955 for (auto& entry : arg.Entries()) {
60956 auto& recordValue0 = entry.mValue;
60957 // Control block to let us common up the JS_DefineUCProperty calls when there
60958 // are different ways to succeed at wrapping the value.
60959 do {
60960
60961 if (recordValue0.IsNull()) {
60962 tmp.setNull();
60963 break;
60964 }
60965
60966 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
60967 if (!returnObj) {
60968 aRv.Throw(NS_ERROR_UNEXPECTED);
60969 return;
60970 }
60971 // Scope for 'tmp'
60972 {
60973 JS::Rooted<JS::Value> tmp(cx);
60974 for (auto& entry : recordValue0.Value().Entries()) {
60975 auto& recordValue1 = entry.mValue;
60976 // Control block to let us common up the JS_DefineUCProperty calls when there
60977 // are different ways to succeed at wrapping the value.
60978 do {
60979 JS::ExposeValueToActiveJS(recordValue1);
60980 tmp.set(recordValue1);
60981 if (!MaybeWrapValue(cx, &tmp)) {
60982 aRv.Throw(NS_ERROR_UNEXPECTED);
60983 return;
60984 }
60985 break;
60986 } while (false);
60987 if (!JS_DefineUCProperty(cx, returnObj,
60988 entry.mKey.BeginReading(),
60989 entry.mKey.Length(), tmp,
60990 JSPROP_ENUMERATE)) {
60991 aRv.Throw(NS_ERROR_UNEXPECTED);
60992 return;
60993 }
60994 }
60995 }
60996 tmp.setObject(*returnObj);
60997 break;
60998 } while (false);
60999 if (!JS_DefineUCProperty(cx, returnObj,
61000 entry.mKey.BeginReading(),
61001 entry.mKey.Length(), tmp,
61002 JSPROP_ENUMERATE)) {
61003 aRv.Throw(NS_ERROR_UNEXPECTED);
61004 return;
61005 }
61006 }
61007 }
61008 argv[0].setObject(*returnObj);
61009 break;
61010 } while (false);
61011
61012 JS::Rooted<JS::Value> callable(cx);
61013 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61014 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61015 !InitIds(cx, atomsCache)) ||
61016 !GetCallableProperty(cx, atomsCache->passRecordOfNullableRecordOfAny_id, &callable)) {
61017 aRv.Throw(NS_ERROR_UNEXPECTED);
61018 return;
61019 }
61020 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61021 if (!JS::Call(cx, thisValue, callable,
61022 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61023 aRv.NoteJSContextException(cx);
61024 return;
61025 }
61026}
61027
61028void
61029TestJSImplInterfaceJSImpl::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61030{
61031 CallSetup s(this, aRv, "TestJSImplInterface.passNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61032 if (aRv.Failed()) {
61033 return;
61034 }
61035 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61035); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61035; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61036 BindingCallContext& cx = s.GetCallContext();
61037
61038 JS::Rooted<JS::Value> rval(cx);
61039 JS::RootedVector<JS::Value> argv(cx);
61040 if (!argv.resize(1)) {
61041 // That threw an exception on the JSContext, and our CallSetup will do
61042 // the right thing with that.
61043 return;
61044 }
61045 unsigned argc = 1;
61046
61047 do {
61048
61049 if (arg.IsNull()) {
61050 argv[0].setNull();
61051 break;
61052 }
61053
61054 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61055 if (!returnObj) {
61056 aRv.Throw(NS_ERROR_UNEXPECTED);
61057 return;
61058 }
61059 // Scope for 'tmp'
61060 {
61061 JS::Rooted<JS::Value> tmp(cx);
61062 for (auto& entry : arg.Value().Entries()) {
61063 auto& recordValue0 = entry.mValue;
61064 // Control block to let us common up the JS_DefineUCProperty calls when there
61065 // are different ways to succeed at wrapping the value.
61066 do {
61067
61068 if (recordValue0.IsNull()) {
61069 tmp.setNull();
61070 break;
61071 }
61072
61073 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61074 if (!returnObj) {
61075 aRv.Throw(NS_ERROR_UNEXPECTED);
61076 return;
61077 }
61078 // Scope for 'tmp'
61079 {
61080 JS::Rooted<JS::Value> tmp(cx);
61081 for (auto& entry : recordValue0.Value().Entries()) {
61082 auto& recordValue1 = entry.mValue;
61083 // Control block to let us common up the JS_DefineUCProperty calls when there
61084 // are different ways to succeed at wrapping the value.
61085 do {
61086 JS::ExposeValueToActiveJS(recordValue1);
61087 tmp.set(recordValue1);
61088 if (!MaybeWrapValue(cx, &tmp)) {
61089 aRv.Throw(NS_ERROR_UNEXPECTED);
61090 return;
61091 }
61092 break;
61093 } while (false);
61094 if (!JS_DefineUCProperty(cx, returnObj,
61095 entry.mKey.BeginReading(),
61096 entry.mKey.Length(), tmp,
61097 JSPROP_ENUMERATE)) {
61098 aRv.Throw(NS_ERROR_UNEXPECTED);
61099 return;
61100 }
61101 }
61102 }
61103 tmp.setObject(*returnObj);
61104 break;
61105 } while (false);
61106 if (!JS_DefineUCProperty(cx, returnObj,
61107 entry.mKey.BeginReading(),
61108 entry.mKey.Length(), tmp,
61109 JSPROP_ENUMERATE)) {
61110 aRv.Throw(NS_ERROR_UNEXPECTED);
61111 return;
61112 }
61113 }
61114 }
61115 argv[0].setObject(*returnObj);
61116 break;
61117 } while (false);
61118
61119 JS::Rooted<JS::Value> callable(cx);
61120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61122 !InitIds(cx, atomsCache)) ||
61123 !GetCallableProperty(cx, atomsCache->passNullableRecordOfNullableRecordOfAny_id, &callable)) {
61124 aRv.Throw(NS_ERROR_UNEXPECTED);
61125 return;
61126 }
61127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61128 if (!JS::Call(cx, thisValue, callable,
61129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61130 aRv.NoteJSContextException(cx);
61131 return;
61132 }
61133}
61134
61135void
61136TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61137{
61138 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61139 if (aRv.Failed()) {
61140 return;
61141 }
61142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61142; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61143 BindingCallContext& cx = s.GetCallContext();
61144
61145 JS::Rooted<JS::Value> rval(cx);
61146 JS::RootedVector<JS::Value> argv(cx);
61147 if (!argv.resize(1)) {
61148 // That threw an exception on the JSContext, and our CallSetup will do
61149 // the right thing with that.
61150 return;
61151 }
61152 unsigned argc = 1;
61153
61154 do {
61155 if (arg.WasPassed()) {
61156
61157 if (arg.Value().IsNull()) {
61158 argv[0].setNull();
61159 break;
61160 }
61161
61162 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61163 if (!returnObj) {
61164 aRv.Throw(NS_ERROR_UNEXPECTED);
61165 return;
61166 }
61167 // Scope for 'tmp'
61168 {
61169 JS::Rooted<JS::Value> tmp(cx);
61170 for (auto& entry : arg.Value().Value().Entries()) {
61171 auto& recordValue0 = entry.mValue;
61172 // Control block to let us common up the JS_DefineUCProperty calls when there
61173 // are different ways to succeed at wrapping the value.
61174 do {
61175
61176 if (recordValue0.IsNull()) {
61177 tmp.setNull();
61178 break;
61179 }
61180
61181 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61182 if (!returnObj) {
61183 aRv.Throw(NS_ERROR_UNEXPECTED);
61184 return;
61185 }
61186 // Scope for 'tmp'
61187 {
61188 JS::Rooted<JS::Value> tmp(cx);
61189 for (auto& entry : recordValue0.Value().Entries()) {
61190 auto& recordValue1 = entry.mValue;
61191 // Control block to let us common up the JS_DefineUCProperty calls when there
61192 // are different ways to succeed at wrapping the value.
61193 do {
61194 JS::ExposeValueToActiveJS(recordValue1);
61195 tmp.set(recordValue1);
61196 if (!MaybeWrapValue(cx, &tmp)) {
61197 aRv.Throw(NS_ERROR_UNEXPECTED);
61198 return;
61199 }
61200 break;
61201 } while (false);
61202 if (!JS_DefineUCProperty(cx, returnObj,
61203 entry.mKey.BeginReading(),
61204 entry.mKey.Length(), tmp,
61205 JSPROP_ENUMERATE)) {
61206 aRv.Throw(NS_ERROR_UNEXPECTED);
61207 return;
61208 }
61209 }
61210 }
61211 tmp.setObject(*returnObj);
61212 break;
61213 } while (false);
61214 if (!JS_DefineUCProperty(cx, returnObj,
61215 entry.mKey.BeginReading(),
61216 entry.mKey.Length(), tmp,
61217 JSPROP_ENUMERATE)) {
61218 aRv.Throw(NS_ERROR_UNEXPECTED);
61219 return;
61220 }
61221 }
61222 }
61223 argv[0].setObject(*returnObj);
61224 break;
61225 } else if (argc == 1) {
61226 // This is our current trailing argument; reduce argc
61227 --argc;
61228 } else {
61229 argv[0].setUndefined();
61230 }
61231 } while (false);
61232
61233 JS::Rooted<JS::Value> callable(cx);
61234 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61235 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61236 !InitIds(cx, atomsCache)) ||
61237 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id, &callable)) {
61238 aRv.Throw(NS_ERROR_UNEXPECTED);
61239 return;
61240 }
61241 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61242 if (!JS::Call(cx, thisValue, callable,
61243 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61244 aRv.NoteJSContextException(cx);
61245 return;
61246 }
61247}
61248
61249void
61250TestJSImplInterfaceJSImpl::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61251{
61252 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableRecordOfNullableSequenceOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61253 if (aRv.Failed()) {
61254 return;
61255 }
61256 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61256); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61256; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61257 BindingCallContext& cx = s.GetCallContext();
61258
61259 JS::Rooted<JS::Value> rval(cx);
61260 JS::RootedVector<JS::Value> argv(cx);
61261 if (!argv.resize(1)) {
61262 // That threw an exception on the JSContext, and our CallSetup will do
61263 // the right thing with that.
61264 return;
61265 }
61266 unsigned argc = 1;
61267
61268 do {
61269 if (arg.WasPassed()) {
61270
61271 if (arg.Value().IsNull()) {
61272 argv[0].setNull();
61273 break;
61274 }
61275
61276 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61277 if (!returnObj) {
61278 aRv.Throw(NS_ERROR_UNEXPECTED);
61279 return;
61280 }
61281 // Scope for 'tmp'
61282 {
61283 JS::Rooted<JS::Value> tmp(cx);
61284 for (auto& entry : arg.Value().Value().Entries()) {
61285 auto& recordValue0 = entry.mValue;
61286 // Control block to let us common up the JS_DefineUCProperty calls when there
61287 // are different ways to succeed at wrapping the value.
61288 do {
61289
61290 if (recordValue0.IsNull()) {
61291 tmp.setNull();
61292 break;
61293 }
61294
61295 uint32_t length = recordValue0.Value().Length();
61296 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61297 if (!returnArray) {
61298 aRv.Throw(NS_ERROR_UNEXPECTED);
61299 return;
61300 }
61301 // Scope for 'tmp'
61302 {
61303 JS::Rooted<JS::Value> tmp(cx);
61304 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61305 // Control block to let us common up the JS_DefineElement calls when there
61306 // are different ways to succeed at wrapping the object.
61307 do {
61308 JS::ExposeValueToActiveJS(recordValue0.Value()[sequenceIdx0]);
61309 tmp.set(recordValue0.Value()[sequenceIdx0]);
61310 if (!MaybeWrapValue(cx, &tmp)) {
61311 aRv.Throw(NS_ERROR_UNEXPECTED);
61312 return;
61313 }
61314 break;
61315 } while (false);
61316 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61317 JSPROP_ENUMERATE)) {
61318 aRv.Throw(NS_ERROR_UNEXPECTED);
61319 return;
61320 }
61321 }
61322 }
61323 tmp.setObject(*returnArray);
61324 break;
61325 } while (false);
61326 if (!JS_DefineUCProperty(cx, returnObj,
61327 entry.mKey.BeginReading(),
61328 entry.mKey.Length(), tmp,
61329 JSPROP_ENUMERATE)) {
61330 aRv.Throw(NS_ERROR_UNEXPECTED);
61331 return;
61332 }
61333 }
61334 }
61335 argv[0].setObject(*returnObj);
61336 break;
61337 } else if (argc == 1) {
61338 // This is our current trailing argument; reduce argc
61339 --argc;
61340 } else {
61341 argv[0].setUndefined();
61342 }
61343 } while (false);
61344
61345 JS::Rooted<JS::Value> callable(cx);
61346 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61347 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61348 !InitIds(cx, atomsCache)) ||
61349 !GetCallableProperty(cx, atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id, &callable)) {
61350 aRv.Throw(NS_ERROR_UNEXPECTED);
61351 return;
61352 }
61353 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61354 if (!JS::Call(cx, thisValue, callable,
61355 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61356 aRv.NoteJSContextException(cx);
61357 return;
61358 }
61359}
61360
61361void
61362TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61363{
61364 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableRecordOfAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61365 if (aRv.Failed()) {
61366 return;
61367 }
61368 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61368); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61368; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61369 BindingCallContext& cx = s.GetCallContext();
61370
61371 JS::Rooted<JS::Value> rval(cx);
61372 JS::RootedVector<JS::Value> argv(cx);
61373 if (!argv.resize(1)) {
61374 // That threw an exception on the JSContext, and our CallSetup will do
61375 // the right thing with that.
61376 return;
61377 }
61378 unsigned argc = 1;
61379
61380 do {
61381 if (arg.WasPassed()) {
61382
61383 if (arg.Value().IsNull()) {
61384 argv[0].setNull();
61385 break;
61386 }
61387
61388 uint32_t length = arg.Value().Value().Length();
61389 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61390 if (!returnArray) {
61391 aRv.Throw(NS_ERROR_UNEXPECTED);
61392 return;
61393 }
61394 // Scope for 'tmp'
61395 {
61396 JS::Rooted<JS::Value> tmp(cx);
61397 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61398 // Control block to let us common up the JS_DefineElement calls when there
61399 // are different ways to succeed at wrapping the object.
61400 do {
61401
61402 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
61403 tmp.setNull();
61404 break;
61405 }
61406
61407 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
61408 if (!returnObj) {
61409 aRv.Throw(NS_ERROR_UNEXPECTED);
61410 return;
61411 }
61412 // Scope for 'tmp'
61413 {
61414 JS::Rooted<JS::Value> tmp(cx);
61415 for (auto& entry : arg.Value().Value()[sequenceIdx0].Value().Entries()) {
61416 auto& recordValue0 = entry.mValue;
61417 // Control block to let us common up the JS_DefineUCProperty calls when there
61418 // are different ways to succeed at wrapping the value.
61419 do {
61420 JS::ExposeValueToActiveJS(recordValue0);
61421 tmp.set(recordValue0);
61422 if (!MaybeWrapValue(cx, &tmp)) {
61423 aRv.Throw(NS_ERROR_UNEXPECTED);
61424 return;
61425 }
61426 break;
61427 } while (false);
61428 if (!JS_DefineUCProperty(cx, returnObj,
61429 entry.mKey.BeginReading(),
61430 entry.mKey.Length(), tmp,
61431 JSPROP_ENUMERATE)) {
61432 aRv.Throw(NS_ERROR_UNEXPECTED);
61433 return;
61434 }
61435 }
61436 }
61437 tmp.setObject(*returnObj);
61438 break;
61439 } while (false);
61440 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61441 JSPROP_ENUMERATE)) {
61442 aRv.Throw(NS_ERROR_UNEXPECTED);
61443 return;
61444 }
61445 }
61446 }
61447 argv[0].setObject(*returnArray);
61448 break;
61449 } else if (argc == 1) {
61450 // This is our current trailing argument; reduce argc
61451 --argc;
61452 } else {
61453 argv[0].setUndefined();
61454 }
61455 } while (false);
61456
61457 JS::Rooted<JS::Value> callable(cx);
61458 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61459 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61460 !InitIds(cx, atomsCache)) ||
61461 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id, &callable)) {
61462 aRv.Throw(NS_ERROR_UNEXPECTED);
61463 return;
61464 }
61465 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61466 if (!JS::Call(cx, thisValue, callable,
61467 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61468 aRv.NoteJSContextException(cx);
61469 return;
61470 }
61471}
61472
61473void
61474TestJSImplInterfaceJSImpl::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
61475{
61476 CallSetup s(this, aRv, "TestJSImplInterface.receiveAny", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61477 if (aRv.Failed()) {
61478 return;
61479 }
61480 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61480); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61480; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61481 BindingCallContext& cx = s.GetCallContext();
61482
61483 JS::Rooted<JS::Value> rval(cx);
61484
61485 JS::Rooted<JS::Value> callable(cx);
61486 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61487 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61488 !InitIds(cx, atomsCache)) ||
61489 !GetCallableProperty(cx, atomsCache->receiveAny_id, &callable)) {
61490 aRv.Throw(NS_ERROR_UNEXPECTED);
61491 return;
61492 }
61493 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61494 if (!JS::Call(cx, thisValue, callable,
61495 JS::HandleValueArray::empty(), &rval)) {
61496 aRv.NoteJSContextException(cx);
61497 return;
61498 }
61499 JS::Rooted<JS::Value> rvalDecl(cx);
61500#ifdef __clang__1
61501#pragma clang diagnostic push
61502#pragma clang diagnostic ignored "-Wunreachable-code"
61503#pragma clang diagnostic ignored "-Wunreachable-code-return"
61504#endif // __clang__
61505 if ((false) && !CallerSubsumes(rval)) {
61506 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveAny");
61507 aRv.Throw(NS_ERROR_UNEXPECTED);
61508 return;
61509 }
61510#ifdef __clang__1
61511#pragma clang diagnostic pop
61512#endif // __clang__
61513 rvalDecl = rval;
61514 aRetVal.set(rvalDecl);
61515}
61516
61517void
61518TestJSImplInterfaceJSImpl::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61519{
61520 CallSetup s(this, aRv, "TestJSImplInterface.passObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61521 if (aRv.Failed()) {
61522 return;
61523 }
61524 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61524); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61524; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61525 BindingCallContext& cx = s.GetCallContext();
61526
61527 JS::Rooted<JS::Value> rval(cx);
61528 JS::RootedVector<JS::Value> argv(cx);
61529 if (!argv.resize(1)) {
61530 // That threw an exception on the JSContext, and our CallSetup will do
61531 // the right thing with that.
61532 return;
61533 }
61534 unsigned argc = 1;
61535
61536 do {
61537 JS::ExposeObjectToActiveJS(arg);
61538 argv[0].setObject(*arg);
61539 if (!MaybeWrapObjectValue(cx, argv[0])) {
61540 aRv.Throw(NS_ERROR_UNEXPECTED);
61541 return;
61542 }
61543 break;
61544 } while (false);
61545
61546 JS::Rooted<JS::Value> callable(cx);
61547 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61548 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61549 !InitIds(cx, atomsCache)) ||
61550 !GetCallableProperty(cx, atomsCache->passObject_id, &callable)) {
61551 aRv.Throw(NS_ERROR_UNEXPECTED);
61552 return;
61553 }
61554 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61555 if (!JS::Call(cx, thisValue, callable,
61556 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61557 aRv.NoteJSContextException(cx);
61558 return;
61559 }
61560}
61561
61562void
61563TestJSImplInterfaceJSImpl::PassVariadicObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61564{
61565 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61566 if (aRv.Failed()) {
61567 return;
61568 }
61569 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61569; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61570 BindingCallContext& cx = s.GetCallContext();
61571
61572 JS::Rooted<JS::Value> rval(cx);
61573 JS::RootedVector<JS::Value> argv(cx);
61574 if (!argv.resize((1 - 1) + arg.Length())) {
61575 // That threw an exception on the JSContext, and our CallSetup will do
61576 // the right thing with that.
61577 return;
61578 }
61579 unsigned argc = (1 - 1) + arg.Length();
61580
61581 do {
61582 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
61583 JS::ExposeObjectToActiveJS(arg[idx]);
61584 argv[0 + idx].setObject(*arg[idx]);
61585 if (!MaybeWrapObjectValue(cx, argv[0 + idx])) {
61586 aRv.Throw(NS_ERROR_UNEXPECTED);
61587 return;
61588 }
61589 continue;
61590 }
61591 break;
61592 } while (false);
61593
61594 JS::Rooted<JS::Value> callable(cx);
61595 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61596 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61597 !InitIds(cx, atomsCache)) ||
61598 !GetCallableProperty(cx, atomsCache->passVariadicObject_id, &callable)) {
61599 aRv.Throw(NS_ERROR_UNEXPECTED);
61600 return;
61601 }
61602 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61603 if (!JS::Call(cx, thisValue, callable,
61604 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61605 aRv.NoteJSContextException(cx);
61606 return;
61607 }
61608}
61609
61610void
61611TestJSImplInterfaceJSImpl::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61612{
61613 CallSetup s(this, aRv, "TestJSImplInterface.passNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61614 if (aRv.Failed()) {
61615 return;
61616 }
61617 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61617); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61617; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61618 BindingCallContext& cx = s.GetCallContext();
61619
61620 JS::Rooted<JS::Value> rval(cx);
61621 JS::RootedVector<JS::Value> argv(cx);
61622 if (!argv.resize(1)) {
61623 // That threw an exception on the JSContext, and our CallSetup will do
61624 // the right thing with that.
61625 return;
61626 }
61627 unsigned argc = 1;
61628
61629 do {
61630 if (arg) {
61631 JS::ExposeObjectToActiveJS(arg);
61632 }
61633 argv[0].setObjectOrNull(arg);
61634 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61635 aRv.Throw(NS_ERROR_UNEXPECTED);
61636 return;
61637 }
61638 break;
61639 } while (false);
61640
61641 JS::Rooted<JS::Value> callable(cx);
61642 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61643 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61644 !InitIds(cx, atomsCache)) ||
61645 !GetCallableProperty(cx, atomsCache->passNullableObject_id, &callable)) {
61646 aRv.Throw(NS_ERROR_UNEXPECTED);
61647 return;
61648 }
61649 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61650 if (!JS::Call(cx, thisValue, callable,
61651 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61652 aRv.NoteJSContextException(cx);
61653 return;
61654 }
61655}
61656
61657void
61658TestJSImplInterfaceJSImpl::PassVariadicNullableObject(const nsTArray<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61659{
61660 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61661 if (aRv.Failed()) {
61662 return;
61663 }
61664 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61664); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61664; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61665 BindingCallContext& cx = s.GetCallContext();
61666
61667 JS::Rooted<JS::Value> rval(cx);
61668 JS::RootedVector<JS::Value> argv(cx);
61669 if (!argv.resize((1 - 1) + arg.Length())) {
61670 // That threw an exception on the JSContext, and our CallSetup will do
61671 // the right thing with that.
61672 return;
61673 }
61674 unsigned argc = (1 - 1) + arg.Length();
61675
61676 do {
61677 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
61678 JS::ExposeObjectToActiveJS(arg[idx]);
61679 argv[0 + idx].setObject(*arg[idx]);
61680 if (!MaybeWrapObjectValue(cx, argv[0 + idx])) {
61681 aRv.Throw(NS_ERROR_UNEXPECTED);
61682 return;
61683 }
61684 continue;
61685 }
61686 break;
61687 } while (false);
61688
61689 JS::Rooted<JS::Value> callable(cx);
61690 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61691 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61692 !InitIds(cx, atomsCache)) ||
61693 !GetCallableProperty(cx, atomsCache->passVariadicNullableObject_id, &callable)) {
61694 aRv.Throw(NS_ERROR_UNEXPECTED);
61695 return;
61696 }
61697 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61698 if (!JS::Call(cx, thisValue, callable,
61699 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61700 aRv.NoteJSContextException(cx);
61701 return;
61702 }
61703}
61704
61705void
61706TestJSImplInterfaceJSImpl::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61707{
61708 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61709 if (aRv.Failed()) {
61710 return;
61711 }
61712 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61712); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61712; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61713 BindingCallContext& cx = s.GetCallContext();
61714
61715 JS::Rooted<JS::Value> rval(cx);
61716 JS::RootedVector<JS::Value> argv(cx);
61717 if (!argv.resize(1)) {
61718 // That threw an exception on the JSContext, and our CallSetup will do
61719 // the right thing with that.
61720 return;
61721 }
61722 unsigned argc = 1;
61723
61724 do {
61725 if (arg.WasPassed()) {
61726 JS::ExposeObjectToActiveJS(arg.Value());
61727 argv[0].setObject(*arg.Value());
61728 if (!MaybeWrapObjectValue(cx, argv[0])) {
61729 aRv.Throw(NS_ERROR_UNEXPECTED);
61730 return;
61731 }
61732 break;
61733 } else if (argc == 1) {
61734 // This is our current trailing argument; reduce argc
61735 --argc;
61736 } else {
61737 argv[0].setUndefined();
61738 }
61739 } while (false);
61740
61741 JS::Rooted<JS::Value> callable(cx);
61742 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61743 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61744 !InitIds(cx, atomsCache)) ||
61745 !GetCallableProperty(cx, atomsCache->passOptionalObject_id, &callable)) {
61746 aRv.Throw(NS_ERROR_UNEXPECTED);
61747 return;
61748 }
61749 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61750 if (!JS::Call(cx, thisValue, callable,
61751 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61752 aRv.NoteJSContextException(cx);
61753 return;
61754 }
61755}
61756
61757void
61758TestJSImplInterfaceJSImpl::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61759{
61760 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61761 if (aRv.Failed()) {
61762 return;
61763 }
61764 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61764; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61765 BindingCallContext& cx = s.GetCallContext();
61766
61767 JS::Rooted<JS::Value> rval(cx);
61768 JS::RootedVector<JS::Value> argv(cx);
61769 if (!argv.resize(1)) {
61770 // That threw an exception on the JSContext, and our CallSetup will do
61771 // the right thing with that.
61772 return;
61773 }
61774 unsigned argc = 1;
61775
61776 do {
61777 if (arg.WasPassed()) {
61778 if (arg.Value()) {
61779 JS::ExposeObjectToActiveJS(arg.Value());
61780 }
61781 argv[0].setObjectOrNull(arg.Value());
61782 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61783 aRv.Throw(NS_ERROR_UNEXPECTED);
61784 return;
61785 }
61786 break;
61787 } else if (argc == 1) {
61788 // This is our current trailing argument; reduce argc
61789 --argc;
61790 } else {
61791 argv[0].setUndefined();
61792 }
61793 } while (false);
61794
61795 JS::Rooted<JS::Value> callable(cx);
61796 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61797 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61798 !InitIds(cx, atomsCache)) ||
61799 !GetCallableProperty(cx, atomsCache->passOptionalNullableObject_id, &callable)) {
61800 aRv.Throw(NS_ERROR_UNEXPECTED);
61801 return;
61802 }
61803 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61804 if (!JS::Call(cx, thisValue, callable,
61805 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61806 aRv.NoteJSContextException(cx);
61807 return;
61808 }
61809}
61810
61811void
61812TestJSImplInterfaceJSImpl::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
61813{
61814 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableObjectWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61815 if (aRv.Failed()) {
61816 return;
61817 }
61818 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61818); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61818; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61819 BindingCallContext& cx = s.GetCallContext();
61820
61821 JS::Rooted<JS::Value> rval(cx);
61822 JS::RootedVector<JS::Value> argv(cx);
61823 if (!argv.resize(1)) {
61824 // That threw an exception on the JSContext, and our CallSetup will do
61825 // the right thing with that.
61826 return;
61827 }
61828 unsigned argc = 1;
61829
61830 do {
61831 if (arg) {
61832 JS::ExposeObjectToActiveJS(arg);
61833 }
61834 argv[0].setObjectOrNull(arg);
61835 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
61836 aRv.Throw(NS_ERROR_UNEXPECTED);
61837 return;
61838 }
61839 break;
61840 } while (false);
61841
61842 JS::Rooted<JS::Value> callable(cx);
61843 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61844 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61845 !InitIds(cx, atomsCache)) ||
61846 !GetCallableProperty(cx, atomsCache->passOptionalNullableObjectWithDefaultValue_id, &callable)) {
61847 aRv.Throw(NS_ERROR_UNEXPECTED);
61848 return;
61849 }
61850 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61851 if (!JS::Call(cx, thisValue, callable,
61852 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61853 aRv.NoteJSContextException(cx);
61854 return;
61855 }
61856}
61857
61858void
61859TestJSImplInterfaceJSImpl::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61860{
61861 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61862 if (aRv.Failed()) {
61863 return;
61864 }
61865 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61865); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61865; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61866 BindingCallContext& cx = s.GetCallContext();
61867
61868 JS::Rooted<JS::Value> rval(cx);
61869 JS::RootedVector<JS::Value> argv(cx);
61870 if (!argv.resize(1)) {
61871 // That threw an exception on the JSContext, and our CallSetup will do
61872 // the right thing with that.
61873 return;
61874 }
61875 unsigned argc = 1;
61876
61877 do {
61878
61879 uint32_t length = arg.Length();
61880 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61881 if (!returnArray) {
61882 aRv.Throw(NS_ERROR_UNEXPECTED);
61883 return;
61884 }
61885 // Scope for 'tmp'
61886 {
61887 JS::Rooted<JS::Value> tmp(cx);
61888 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61889 // Control block to let us common up the JS_DefineElement calls when there
61890 // are different ways to succeed at wrapping the object.
61891 do {
61892 JS::ExposeObjectToActiveJS(arg[sequenceIdx0]);
61893 tmp.setObject(*arg[sequenceIdx0]);
61894 if (!MaybeWrapObjectValue(cx, &tmp)) {
61895 aRv.Throw(NS_ERROR_UNEXPECTED);
61896 return;
61897 }
61898 break;
61899 } while (false);
61900 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61901 JSPROP_ENUMERATE)) {
61902 aRv.Throw(NS_ERROR_UNEXPECTED);
61903 return;
61904 }
61905 }
61906 }
61907 argv[0].setObject(*returnArray);
61908 break;
61909 } while (false);
61910
61911 JS::Rooted<JS::Value> callable(cx);
61912 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61913 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61914 !InitIds(cx, atomsCache)) ||
61915 !GetCallableProperty(cx, atomsCache->passSequenceOfObject_id, &callable)) {
61916 aRv.Throw(NS_ERROR_UNEXPECTED);
61917 return;
61918 }
61919 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61920 if (!JS::Call(cx, thisValue, callable,
61921 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61922 aRv.NoteJSContextException(cx);
61923 return;
61924 }
61925}
61926
61927void
61928TestJSImplInterfaceJSImpl::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
61929{
61930 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
61931 if (aRv.Failed()) {
61932 return;
61933 }
61934 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 61934); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 61934; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
61935 BindingCallContext& cx = s.GetCallContext();
61936
61937 JS::Rooted<JS::Value> rval(cx);
61938 JS::RootedVector<JS::Value> argv(cx);
61939 if (!argv.resize(1)) {
61940 // That threw an exception on the JSContext, and our CallSetup will do
61941 // the right thing with that.
61942 return;
61943 }
61944 unsigned argc = 1;
61945
61946 do {
61947
61948 uint32_t length = arg.Length();
61949 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
61950 if (!returnArray) {
61951 aRv.Throw(NS_ERROR_UNEXPECTED);
61952 return;
61953 }
61954 // Scope for 'tmp'
61955 {
61956 JS::Rooted<JS::Value> tmp(cx);
61957 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
61958 // Control block to let us common up the JS_DefineElement calls when there
61959 // are different ways to succeed at wrapping the object.
61960 do {
61961 if (arg[sequenceIdx0]) {
61962 JS::ExposeObjectToActiveJS(arg[sequenceIdx0]);
61963 }
61964 tmp.setObjectOrNull(arg[sequenceIdx0]);
61965 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
61966 aRv.Throw(NS_ERROR_UNEXPECTED);
61967 return;
61968 }
61969 break;
61970 } while (false);
61971 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
61972 JSPROP_ENUMERATE)) {
61973 aRv.Throw(NS_ERROR_UNEXPECTED);
61974 return;
61975 }
61976 }
61977 }
61978 argv[0].setObject(*returnArray);
61979 break;
61980 } while (false);
61981
61982 JS::Rooted<JS::Value> callable(cx);
61983 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
61984 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
61985 !InitIds(cx, atomsCache)) ||
61986 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableObject_id, &callable)) {
61987 aRv.Throw(NS_ERROR_UNEXPECTED);
61988 return;
61989 }
61990 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
61991 if (!JS::Call(cx, thisValue, callable,
61992 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
61993 aRv.NoteJSContextException(cx);
61994 return;
61995 }
61996}
61997
61998void
61999TestJSImplInterfaceJSImpl::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62000{
62001 CallSetup s(this, aRv, "TestJSImplInterface.passNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62002 if (aRv.Failed()) {
62003 return;
62004 }
62005 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62005); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62005; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62006 BindingCallContext& cx = s.GetCallContext();
62007
62008 JS::Rooted<JS::Value> rval(cx);
62009 JS::RootedVector<JS::Value> argv(cx);
62010 if (!argv.resize(1)) {
62011 // That threw an exception on the JSContext, and our CallSetup will do
62012 // the right thing with that.
62013 return;
62014 }
62015 unsigned argc = 1;
62016
62017 do {
62018
62019 if (arg.IsNull()) {
62020 argv[0].setNull();
62021 break;
62022 }
62023
62024 uint32_t length = arg.Value().Length();
62025 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62026 if (!returnArray) {
62027 aRv.Throw(NS_ERROR_UNEXPECTED);
62028 return;
62029 }
62030 // Scope for 'tmp'
62031 {
62032 JS::Rooted<JS::Value> tmp(cx);
62033 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62034 // Control block to let us common up the JS_DefineElement calls when there
62035 // are different ways to succeed at wrapping the object.
62036 do {
62037 JS::ExposeObjectToActiveJS(arg.Value()[sequenceIdx0]);
62038 tmp.setObject(*arg.Value()[sequenceIdx0]);
62039 if (!MaybeWrapObjectValue(cx, &tmp)) {
62040 aRv.Throw(NS_ERROR_UNEXPECTED);
62041 return;
62042 }
62043 break;
62044 } while (false);
62045 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62046 JSPROP_ENUMERATE)) {
62047 aRv.Throw(NS_ERROR_UNEXPECTED);
62048 return;
62049 }
62050 }
62051 }
62052 argv[0].setObject(*returnArray);
62053 break;
62054 } while (false);
62055
62056 JS::Rooted<JS::Value> callable(cx);
62057 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62058 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62059 !InitIds(cx, atomsCache)) ||
62060 !GetCallableProperty(cx, atomsCache->passNullableSequenceOfObject_id, &callable)) {
62061 aRv.Throw(NS_ERROR_UNEXPECTED);
62062 return;
62063 }
62064 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62065 if (!JS::Call(cx, thisValue, callable,
62066 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62067 aRv.NoteJSContextException(cx);
62068 return;
62069 }
62070}
62071
62072void
62073TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62074{
62075 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62076 if (aRv.Failed()) {
62077 return;
62078 }
62079 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62079); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62079; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62080 BindingCallContext& cx = s.GetCallContext();
62081
62082 JS::Rooted<JS::Value> rval(cx);
62083 JS::RootedVector<JS::Value> argv(cx);
62084 if (!argv.resize(1)) {
62085 // That threw an exception on the JSContext, and our CallSetup will do
62086 // the right thing with that.
62087 return;
62088 }
62089 unsigned argc = 1;
62090
62091 do {
62092 if (arg.WasPassed()) {
62093
62094 if (arg.Value().IsNull()) {
62095 argv[0].setNull();
62096 break;
62097 }
62098
62099 uint32_t length = arg.Value().Value().Length();
62100 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62101 if (!returnArray) {
62102 aRv.Throw(NS_ERROR_UNEXPECTED);
62103 return;
62104 }
62105 // Scope for 'tmp'
62106 {
62107 JS::Rooted<JS::Value> tmp(cx);
62108 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62109 // Control block to let us common up the JS_DefineElement calls when there
62110 // are different ways to succeed at wrapping the object.
62111 do {
62112
62113 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
62114 tmp.setNull();
62115 break;
62116 }
62117
62118 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
62119 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62120 if (!returnArray) {
62121 aRv.Throw(NS_ERROR_UNEXPECTED);
62122 return;
62123 }
62124 // Scope for 'tmp'
62125 {
62126 JS::Rooted<JS::Value> tmp(cx);
62127 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
62128 // Control block to let us common up the JS_DefineElement calls when there
62129 // are different ways to succeed at wrapping the object.
62130 do {
62131 JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62132 tmp.setObject(*arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62133 if (!MaybeWrapObjectValue(cx, &tmp)) {
62134 aRv.Throw(NS_ERROR_UNEXPECTED);
62135 return;
62136 }
62137 break;
62138 } while (false);
62139 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
62140 JSPROP_ENUMERATE)) {
62141 aRv.Throw(NS_ERROR_UNEXPECTED);
62142 return;
62143 }
62144 }
62145 }
62146 tmp.setObject(*returnArray);
62147 break;
62148 } while (false);
62149 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62150 JSPROP_ENUMERATE)) {
62151 aRv.Throw(NS_ERROR_UNEXPECTED);
62152 return;
62153 }
62154 }
62155 }
62156 argv[0].setObject(*returnArray);
62157 break;
62158 } else if (argc == 1) {
62159 // This is our current trailing argument; reduce argc
62160 --argc;
62161 } else {
62162 argv[0].setUndefined();
62163 }
62164 } while (false);
62165
62166 JS::Rooted<JS::Value> callable(cx);
62167 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62168 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62169 !InitIds(cx, atomsCache)) ||
62170 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id, &callable)) {
62171 aRv.Throw(NS_ERROR_UNEXPECTED);
62172 return;
62173 }
62174 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62175 if (!JS::Call(cx, thisValue, callable,
62176 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62177 aRv.NoteJSContextException(cx);
62178 return;
62179 }
62180}
62181
62182void
62183TestJSImplInterfaceJSImpl::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62184{
62185 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableSequenceOfNullableSequenceOfNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62186 if (aRv.Failed()) {
62187 return;
62188 }
62189 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62189); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62189; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62190 BindingCallContext& cx = s.GetCallContext();
62191
62192 JS::Rooted<JS::Value> rval(cx);
62193 JS::RootedVector<JS::Value> argv(cx);
62194 if (!argv.resize(1)) {
62195 // That threw an exception on the JSContext, and our CallSetup will do
62196 // the right thing with that.
62197 return;
62198 }
62199 unsigned argc = 1;
62200
62201 do {
62202 if (arg.WasPassed()) {
62203
62204 if (arg.Value().IsNull()) {
62205 argv[0].setNull();
62206 break;
62207 }
62208
62209 uint32_t length = arg.Value().Value().Length();
62210 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62211 if (!returnArray) {
62212 aRv.Throw(NS_ERROR_UNEXPECTED);
62213 return;
62214 }
62215 // Scope for 'tmp'
62216 {
62217 JS::Rooted<JS::Value> tmp(cx);
62218 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
62219 // Control block to let us common up the JS_DefineElement calls when there
62220 // are different ways to succeed at wrapping the object.
62221 do {
62222
62223 if (arg.Value().Value()[sequenceIdx0].IsNull()) {
62224 tmp.setNull();
62225 break;
62226 }
62227
62228 uint32_t length = arg.Value().Value()[sequenceIdx0].Value().Length();
62229 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
62230 if (!returnArray) {
62231 aRv.Throw(NS_ERROR_UNEXPECTED);
62232 return;
62233 }
62234 // Scope for 'tmp'
62235 {
62236 JS::Rooted<JS::Value> tmp(cx);
62237 for (uint32_t sequenceIdx1 = 0; sequenceIdx1 < length; ++sequenceIdx1) {
62238 // Control block to let us common up the JS_DefineElement calls when there
62239 // are different ways to succeed at wrapping the object.
62240 do {
62241 if (arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]) {
62242 JS::ExposeObjectToActiveJS(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62243 }
62244 tmp.setObjectOrNull(arg.Value().Value()[sequenceIdx0].Value()[sequenceIdx1]);
62245 if (!MaybeWrapObjectOrNullValue(cx, &tmp)) {
62246 aRv.Throw(NS_ERROR_UNEXPECTED);
62247 return;
62248 }
62249 break;
62250 } while (false);
62251 if (!JS_DefineElement(cx, returnArray, sequenceIdx1, tmp,
62252 JSPROP_ENUMERATE)) {
62253 aRv.Throw(NS_ERROR_UNEXPECTED);
62254 return;
62255 }
62256 }
62257 }
62258 tmp.setObject(*returnArray);
62259 break;
62260 } while (false);
62261 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
62262 JSPROP_ENUMERATE)) {
62263 aRv.Throw(NS_ERROR_UNEXPECTED);
62264 return;
62265 }
62266 }
62267 }
62268 argv[0].setObject(*returnArray);
62269 break;
62270 } else if (argc == 1) {
62271 // This is our current trailing argument; reduce argc
62272 --argc;
62273 } else {
62274 argv[0].setUndefined();
62275 }
62276 } while (false);
62277
62278 JS::Rooted<JS::Value> callable(cx);
62279 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62280 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62281 !InitIds(cx, atomsCache)) ||
62282 !GetCallableProperty(cx, atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id, &callable)) {
62283 aRv.Throw(NS_ERROR_UNEXPECTED);
62284 return;
62285 }
62286 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62287 if (!JS::Call(cx, thisValue, callable,
62288 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62289 aRv.NoteJSContextException(cx);
62290 return;
62291 }
62292}
62293
62294void
62295TestJSImplInterfaceJSImpl::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
62296{
62297 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62298 if (aRv.Failed()) {
62299 return;
62300 }
62301 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62301); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62301; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62302 BindingCallContext& cx = s.GetCallContext();
62303
62304 JS::Rooted<JS::Value> rval(cx);
62305 JS::RootedVector<JS::Value> argv(cx);
62306 if (!argv.resize(1)) {
62307 // That threw an exception on the JSContext, and our CallSetup will do
62308 // the right thing with that.
62309 return;
62310 }
62311 unsigned argc = 1;
62312
62313 do {
62314
62315 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
62316 if (!returnObj) {
62317 aRv.Throw(NS_ERROR_UNEXPECTED);
62318 return;
62319 }
62320 // Scope for 'tmp'
62321 {
62322 JS::Rooted<JS::Value> tmp(cx);
62323 for (auto& entry : arg.Entries()) {
62324 auto& recordValue0 = entry.mValue;
62325 // Control block to let us common up the JS_DefineUCProperty calls when there
62326 // are different ways to succeed at wrapping the value.
62327 do {
62328 JS::ExposeObjectToActiveJS(recordValue0);
62329 tmp.setObject(*recordValue0);
62330 if (!MaybeWrapObjectValue(cx, &tmp)) {
62331 aRv.Throw(NS_ERROR_UNEXPECTED);
62332 return;
62333 }
62334 break;
62335 } while (false);
62336 if (!JS_DefineUCProperty(cx, returnObj,
62337 entry.mKey.BeginReading(),
62338 entry.mKey.Length(), tmp,
62339 JSPROP_ENUMERATE)) {
62340 aRv.Throw(NS_ERROR_UNEXPECTED);
62341 return;
62342 }
62343 }
62344 }
62345 argv[0].setObject(*returnObj);
62346 break;
62347 } while (false);
62348
62349 JS::Rooted<JS::Value> callable(cx);
62350 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62351 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62352 !InitIds(cx, atomsCache)) ||
62353 !GetCallableProperty(cx, atomsCache->passRecordOfObject_id, &callable)) {
62354 aRv.Throw(NS_ERROR_UNEXPECTED);
62355 return;
62356 }
62357 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62358 if (!JS::Call(cx, thisValue, callable,
62359 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62360 aRv.NoteJSContextException(cx);
62361 return;
62362 }
62363}
62364
62365void
62366TestJSImplInterfaceJSImpl::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
62367{
62368 CallSetup s(this, aRv, "TestJSImplInterface.receiveObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62369 if (aRv.Failed()) {
62370 return;
62371 }
62372 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62372); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62372; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62373 BindingCallContext& cx = s.GetCallContext();
62374
62375 JS::Rooted<JS::Value> rval(cx);
62376
62377 JS::Rooted<JS::Value> callable(cx);
62378 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62379 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62380 !InitIds(cx, atomsCache)) ||
62381 !GetCallableProperty(cx, atomsCache->receiveObject_id, &callable)) {
62382 aRv.Throw(NS_ERROR_UNEXPECTED);
62383 return;
62384 }
62385 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62386 if (!JS::Call(cx, thisValue, callable,
62387 JS::HandleValueArray::empty(), &rval)) {
62388 aRv.NoteJSContextException(cx);
62389 return;
62390 }
62391 JS::Rooted<JSObject*> rvalDecl(cx);
62392 if (rval.isObject()) {
62393#ifdef __clang__1
62394#pragma clang diagnostic push
62395#pragma clang diagnostic ignored "-Wunreachable-code"
62396#pragma clang diagnostic ignored "-Wunreachable-code-return"
62397#endif // __clang__
62398 if ((false) && !CallerSubsumes(rval)) {
62399 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveObject");
62400 aRv.Throw(NS_ERROR_UNEXPECTED);
62401 return;
62402 }
62403#ifdef __clang__1
62404#pragma clang diagnostic pop
62405#endif // __clang__
62406 rvalDecl = &rval.toObject();
62407 } else {
62408 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveObject");
62409 aRv.Throw(NS_ERROR_UNEXPECTED);
62410 return;
62411 }
62412 aRetVal.set(rvalDecl);
62413}
62414
62415void
62416TestJSImplInterfaceJSImpl::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
62417{
62418 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62419 if (aRv.Failed()) {
62420 return;
62421 }
62422 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62422); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62422; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62423 BindingCallContext& cx = s.GetCallContext();
62424
62425 JS::Rooted<JS::Value> rval(cx);
62426
62427 JS::Rooted<JS::Value> callable(cx);
62428 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62429 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62430 !InitIds(cx, atomsCache)) ||
62431 !GetCallableProperty(cx, atomsCache->receiveNullableObject_id, &callable)) {
62432 aRv.Throw(NS_ERROR_UNEXPECTED);
62433 return;
62434 }
62435 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62436 if (!JS::Call(cx, thisValue, callable,
62437 JS::HandleValueArray::empty(), &rval)) {
62438 aRv.NoteJSContextException(cx);
62439 return;
62440 }
62441 JS::Rooted<JSObject*> rvalDecl(cx);
62442 if (rval.isObject()) {
62443#ifdef __clang__1
62444#pragma clang diagnostic push
62445#pragma clang diagnostic ignored "-Wunreachable-code"
62446#pragma clang diagnostic ignored "-Wunreachable-code-return"
62447#endif // __clang__
62448 if ((false) && !CallerSubsumes(rval)) {
62449 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.receiveNullableObject");
62450 aRv.Throw(NS_ERROR_UNEXPECTED);
62451 return;
62452 }
62453#ifdef __clang__1
62454#pragma clang diagnostic pop
62455#endif // __clang__
62456 rvalDecl = &rval.toObject();
62457 } else if (rval.isNullOrUndefined()) {
62458 rvalDecl = nullptr;
62459 } else {
62460 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.receiveNullableObject");
62461 aRv.Throw(NS_ERROR_UNEXPECTED);
62462 return;
62463 }
62464 aRetVal.set(rvalDecl);
62465}
62466
62467void
62468TestJSImplInterfaceJSImpl::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62469{
62470 CallSetup s(this, aRv, "TestJSImplInterface.passUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62471 if (aRv.Failed()) {
62472 return;
62473 }
62474 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62474); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62474; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62475 BindingCallContext& cx = s.GetCallContext();
62476
62477 JS::Rooted<JS::Value> rval(cx);
62478 JS::RootedVector<JS::Value> argv(cx);
62479 if (!argv.resize(1)) {
62480 // That threw an exception on the JSContext, and our CallSetup will do
62481 // the right thing with that.
62482 return;
62483 }
62484 unsigned argc = 1;
62485
62486 do {
62487 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62488 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62489 aRv.Throw(NS_ERROR_UNEXPECTED);
62490 return;
62491 }
62492 break;
62493 } while (false);
62494
62495 JS::Rooted<JS::Value> callable(cx);
62496 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62497 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62498 !InitIds(cx, atomsCache)) ||
62499 !GetCallableProperty(cx, atomsCache->passUnion_id, &callable)) {
62500 aRv.Throw(NS_ERROR_UNEXPECTED);
62501 return;
62502 }
62503 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62504 if (!JS::Call(cx, thisValue, callable,
62505 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62506 aRv.NoteJSContextException(cx);
62507 return;
62508 }
62509}
62510
62511void
62512TestJSImplInterfaceJSImpl::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62513{
62514 CallSetup s(this, aRv, "TestJSImplInterface.passUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62515 if (aRv.Failed()) {
62516 return;
62517 }
62518 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62518; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62519 BindingCallContext& cx = s.GetCallContext();
62520
62521 JS::Rooted<JS::Value> rval(cx);
62522 JS::RootedVector<JS::Value> argv(cx);
62523 if (!argv.resize(1)) {
62524 // That threw an exception on the JSContext, and our CallSetup will do
62525 // the right thing with that.
62526 return;
62527 }
62528 unsigned argc = 1;
62529
62530 do {
62531 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62532 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62533 aRv.Throw(NS_ERROR_UNEXPECTED);
62534 return;
62535 }
62536 break;
62537 } while (false);
62538
62539 JS::Rooted<JS::Value> callable(cx);
62540 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62541 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62542 !InitIds(cx, atomsCache)) ||
62543 !GetCallableProperty(cx, atomsCache->passUnion2_id, &callable)) {
62544 aRv.Throw(NS_ERROR_UNEXPECTED);
62545 return;
62546 }
62547 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62548 if (!JS::Call(cx, thisValue, callable,
62549 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62550 aRv.NoteJSContextException(cx);
62551 return;
62552 }
62553}
62554
62555void
62556TestJSImplInterfaceJSImpl::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62557{
62558 CallSetup s(this, aRv, "TestJSImplInterface.passUnion3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62559 if (aRv.Failed()) {
62560 return;
62561 }
62562 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62562); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62562; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62563 BindingCallContext& cx = s.GetCallContext();
62564
62565 JS::Rooted<JS::Value> rval(cx);
62566 JS::RootedVector<JS::Value> argv(cx);
62567 if (!argv.resize(1)) {
62568 // That threw an exception on the JSContext, and our CallSetup will do
62569 // the right thing with that.
62570 return;
62571 }
62572 unsigned argc = 1;
62573
62574 do {
62575 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62576 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62577 aRv.Throw(NS_ERROR_UNEXPECTED);
62578 return;
62579 }
62580 break;
62581 } while (false);
62582
62583 JS::Rooted<JS::Value> callable(cx);
62584 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62585 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62586 !InitIds(cx, atomsCache)) ||
62587 !GetCallableProperty(cx, atomsCache->passUnion3_id, &callable)) {
62588 aRv.Throw(NS_ERROR_UNEXPECTED);
62589 return;
62590 }
62591 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62592 if (!JS::Call(cx, thisValue, callable,
62593 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62594 aRv.NoteJSContextException(cx);
62595 return;
62596 }
62597}
62598
62599void
62600TestJSImplInterfaceJSImpl::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62601{
62602 CallSetup s(this, aRv, "TestJSImplInterface.passUnion4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62603 if (aRv.Failed()) {
62604 return;
62605 }
62606 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62606); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62606; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62607 BindingCallContext& cx = s.GetCallContext();
62608
62609 JS::Rooted<JS::Value> rval(cx);
62610 JS::RootedVector<JS::Value> argv(cx);
62611 if (!argv.resize(1)) {
62612 // That threw an exception on the JSContext, and our CallSetup will do
62613 // the right thing with that.
62614 return;
62615 }
62616 unsigned argc = 1;
62617
62618 do {
62619 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62620 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62621 aRv.Throw(NS_ERROR_UNEXPECTED);
62622 return;
62623 }
62624 break;
62625 } while (false);
62626
62627 JS::Rooted<JS::Value> callable(cx);
62628 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62629 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62630 !InitIds(cx, atomsCache)) ||
62631 !GetCallableProperty(cx, atomsCache->passUnion4_id, &callable)) {
62632 aRv.Throw(NS_ERROR_UNEXPECTED);
62633 return;
62634 }
62635 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62636 if (!JS::Call(cx, thisValue, callable,
62637 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62638 aRv.NoteJSContextException(cx);
62639 return;
62640 }
62641}
62642
62643void
62644TestJSImplInterfaceJSImpl::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62645{
62646 CallSetup s(this, aRv, "TestJSImplInterface.passUnion5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62647 if (aRv.Failed()) {
62648 return;
62649 }
62650 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62650); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62650; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62651 BindingCallContext& cx = s.GetCallContext();
62652
62653 JS::Rooted<JS::Value> rval(cx);
62654 JS::RootedVector<JS::Value> argv(cx);
62655 if (!argv.resize(1)) {
62656 // That threw an exception on the JSContext, and our CallSetup will do
62657 // the right thing with that.
62658 return;
62659 }
62660 unsigned argc = 1;
62661
62662 do {
62663 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62664 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62665 aRv.Throw(NS_ERROR_UNEXPECTED);
62666 return;
62667 }
62668 break;
62669 } while (false);
62670
62671 JS::Rooted<JS::Value> callable(cx);
62672 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62673 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62674 !InitIds(cx, atomsCache)) ||
62675 !GetCallableProperty(cx, atomsCache->passUnion5_id, &callable)) {
62676 aRv.Throw(NS_ERROR_UNEXPECTED);
62677 return;
62678 }
62679 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62680 if (!JS::Call(cx, thisValue, callable,
62681 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62682 aRv.NoteJSContextException(cx);
62683 return;
62684 }
62685}
62686
62687void
62688TestJSImplInterfaceJSImpl::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
62689{
62690 CallSetup s(this, aRv, "TestJSImplInterface.passUnion6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62691 if (aRv.Failed()) {
62692 return;
62693 }
62694 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62694; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62695 BindingCallContext& cx = s.GetCallContext();
62696
62697 JS::Rooted<JS::Value> rval(cx);
62698 JS::RootedVector<JS::Value> argv(cx);
62699 if (!argv.resize(1)) {
62700 // That threw an exception on the JSContext, and our CallSetup will do
62701 // the right thing with that.
62702 return;
62703 }
62704 unsigned argc = 1;
62705
62706 do {
62707 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62708 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62709 aRv.Throw(NS_ERROR_UNEXPECTED);
62710 return;
62711 }
62712 break;
62713 } while (false);
62714
62715 JS::Rooted<JS::Value> callable(cx);
62716 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62717 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62718 !InitIds(cx, atomsCache)) ||
62719 !GetCallableProperty(cx, atomsCache->passUnion6_id, &callable)) {
62720 aRv.Throw(NS_ERROR_UNEXPECTED);
62721 return;
62722 }
62723 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62724 if (!JS::Call(cx, thisValue, callable,
62725 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62726 aRv.NoteJSContextException(cx);
62727 return;
62728 }
62729}
62730
62731void
62732TestJSImplInterfaceJSImpl::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62733{
62734 CallSetup s(this, aRv, "TestJSImplInterface.passUnion7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62735 if (aRv.Failed()) {
62736 return;
62737 }
62738 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62738); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62738; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62739 BindingCallContext& cx = s.GetCallContext();
62740
62741 JS::Rooted<JS::Value> rval(cx);
62742 JS::RootedVector<JS::Value> argv(cx);
62743 if (!argv.resize(1)) {
62744 // That threw an exception on the JSContext, and our CallSetup will do
62745 // the right thing with that.
62746 return;
62747 }
62748 unsigned argc = 1;
62749
62750 do {
62751 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62752 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62753 aRv.Throw(NS_ERROR_UNEXPECTED);
62754 return;
62755 }
62756 break;
62757 } while (false);
62758
62759 JS::Rooted<JS::Value> callable(cx);
62760 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62761 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62762 !InitIds(cx, atomsCache)) ||
62763 !GetCallableProperty(cx, atomsCache->passUnion7_id, &callable)) {
62764 aRv.Throw(NS_ERROR_UNEXPECTED);
62765 return;
62766 }
62767 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62768 if (!JS::Call(cx, thisValue, callable,
62769 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62770 aRv.NoteJSContextException(cx);
62771 return;
62772 }
62773}
62774
62775void
62776TestJSImplInterfaceJSImpl::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62777{
62778 CallSetup s(this, aRv, "TestJSImplInterface.passUnion8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62779 if (aRv.Failed()) {
62780 return;
62781 }
62782 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62782); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62782; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62783 BindingCallContext& cx = s.GetCallContext();
62784
62785 JS::Rooted<JS::Value> rval(cx);
62786 JS::RootedVector<JS::Value> argv(cx);
62787 if (!argv.resize(1)) {
62788 // That threw an exception on the JSContext, and our CallSetup will do
62789 // the right thing with that.
62790 return;
62791 }
62792 unsigned argc = 1;
62793
62794 do {
62795 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62796 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62797 aRv.Throw(NS_ERROR_UNEXPECTED);
62798 return;
62799 }
62800 break;
62801 } while (false);
62802
62803 JS::Rooted<JS::Value> callable(cx);
62804 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62805 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62806 !InitIds(cx, atomsCache)) ||
62807 !GetCallableProperty(cx, atomsCache->passUnion8_id, &callable)) {
62808 aRv.Throw(NS_ERROR_UNEXPECTED);
62809 return;
62810 }
62811 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62812 if (!JS::Call(cx, thisValue, callable,
62813 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62814 aRv.NoteJSContextException(cx);
62815 return;
62816 }
62817}
62818
62819void
62820TestJSImplInterfaceJSImpl::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
62821{
62822 CallSetup s(this, aRv, "TestJSImplInterface.passUnion9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62823 if (aRv.Failed()) {
62824 return;
62825 }
62826 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62826; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62827 BindingCallContext& cx = s.GetCallContext();
62828
62829 JS::Rooted<JS::Value> rval(cx);
62830 JS::RootedVector<JS::Value> argv(cx);
62831 if (!argv.resize(1)) {
62832 // That threw an exception on the JSContext, and our CallSetup will do
62833 // the right thing with that.
62834 return;
62835 }
62836 unsigned argc = 1;
62837
62838 do {
62839 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62840 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62841 aRv.Throw(NS_ERROR_UNEXPECTED);
62842 return;
62843 }
62844 break;
62845 } while (false);
62846
62847 JS::Rooted<JS::Value> callable(cx);
62848 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62849 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62850 !InitIds(cx, atomsCache)) ||
62851 !GetCallableProperty(cx, atomsCache->passUnion9_id, &callable)) {
62852 aRv.Throw(NS_ERROR_UNEXPECTED);
62853 return;
62854 }
62855 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62856 if (!JS::Call(cx, thisValue, callable,
62857 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62858 aRv.NoteJSContextException(cx);
62859 return;
62860 }
62861}
62862
62863void
62864TestJSImplInterfaceJSImpl::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62865{
62866 CallSetup s(this, aRv, "TestJSImplInterface.passUnion10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62867 if (aRv.Failed()) {
62868 return;
62869 }
62870 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62870); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62870; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62871 BindingCallContext& cx = s.GetCallContext();
62872
62873 JS::Rooted<JS::Value> rval(cx);
62874 JS::RootedVector<JS::Value> argv(cx);
62875 if (!argv.resize(1)) {
62876 // That threw an exception on the JSContext, and our CallSetup will do
62877 // the right thing with that.
62878 return;
62879 }
62880 unsigned argc = 1;
62881
62882 do {
62883 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62884 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62885 aRv.Throw(NS_ERROR_UNEXPECTED);
62886 return;
62887 }
62888 break;
62889 } while (false);
62890
62891 JS::Rooted<JS::Value> callable(cx);
62892 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62893 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62894 !InitIds(cx, atomsCache)) ||
62895 !GetCallableProperty(cx, atomsCache->passUnion10_id, &callable)) {
62896 aRv.Throw(NS_ERROR_UNEXPECTED);
62897 return;
62898 }
62899 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62900 if (!JS::Call(cx, thisValue, callable,
62901 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62902 aRv.NoteJSContextException(cx);
62903 return;
62904 }
62905}
62906
62907void
62908TestJSImplInterfaceJSImpl::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62909{
62910 CallSetup s(this, aRv, "TestJSImplInterface.passUnion11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62911 if (aRv.Failed()) {
62912 return;
62913 }
62914 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62914); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62914; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62915 BindingCallContext& cx = s.GetCallContext();
62916
62917 JS::Rooted<JS::Value> rval(cx);
62918 JS::RootedVector<JS::Value> argv(cx);
62919 if (!argv.resize(1)) {
62920 // That threw an exception on the JSContext, and our CallSetup will do
62921 // the right thing with that.
62922 return;
62923 }
62924 unsigned argc = 1;
62925
62926 do {
62927 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62928 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62929 aRv.Throw(NS_ERROR_UNEXPECTED);
62930 return;
62931 }
62932 break;
62933 } while (false);
62934
62935 JS::Rooted<JS::Value> callable(cx);
62936 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62937 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62938 !InitIds(cx, atomsCache)) ||
62939 !GetCallableProperty(cx, atomsCache->passUnion11_id, &callable)) {
62940 aRv.Throw(NS_ERROR_UNEXPECTED);
62941 return;
62942 }
62943 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62944 if (!JS::Call(cx, thisValue, callable,
62945 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62946 aRv.NoteJSContextException(cx);
62947 return;
62948 }
62949}
62950
62951void
62952TestJSImplInterfaceJSImpl::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
62953{
62954 CallSetup s(this, aRv, "TestJSImplInterface.passUnion12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62955 if (aRv.Failed()) {
62956 return;
62957 }
62958 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 62958); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 62958; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
62959 BindingCallContext& cx = s.GetCallContext();
62960
62961 JS::Rooted<JS::Value> rval(cx);
62962 JS::RootedVector<JS::Value> argv(cx);
62963 if (!argv.resize(1)) {
62964 // That threw an exception on the JSContext, and our CallSetup will do
62965 // the right thing with that.
62966 return;
62967 }
62968 unsigned argc = 1;
62969
62970 do {
62971 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
62972 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
62973 aRv.Throw(NS_ERROR_UNEXPECTED);
62974 return;
62975 }
62976 break;
62977 } while (false);
62978
62979 JS::Rooted<JS::Value> callable(cx);
62980 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
62981 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
62982 !InitIds(cx, atomsCache)) ||
62983 !GetCallableProperty(cx, atomsCache->passUnion12_id, &callable)) {
62984 aRv.Throw(NS_ERROR_UNEXPECTED);
62985 return;
62986 }
62987 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
62988 if (!JS::Call(cx, thisValue, callable,
62989 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
62990 aRv.NoteJSContextException(cx);
62991 return;
62992 }
62993}
62994
62995void
62996TestJSImplInterfaceJSImpl::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
62997{
62998 CallSetup s(this, aRv, "TestJSImplInterface.passUnion13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
62999 if (aRv.Failed()) {
63000 return;
63001 }
63002 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63002); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63002; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63003 BindingCallContext& cx = s.GetCallContext();
63004
63005 JS::Rooted<JS::Value> rval(cx);
63006 JS::RootedVector<JS::Value> argv(cx);
63007 if (!argv.resize(1)) {
63008 // That threw an exception on the JSContext, and our CallSetup will do
63009 // the right thing with that.
63010 return;
63011 }
63012 unsigned argc = 1;
63013
63014 do {
63015 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63016 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63017 aRv.Throw(NS_ERROR_UNEXPECTED);
63018 return;
63019 }
63020 break;
63021 } while (false);
63022
63023 JS::Rooted<JS::Value> callable(cx);
63024 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63025 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63026 !InitIds(cx, atomsCache)) ||
63027 !GetCallableProperty(cx, atomsCache->passUnion13_id, &callable)) {
63028 aRv.Throw(NS_ERROR_UNEXPECTED);
63029 return;
63030 }
63031 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63032 if (!JS::Call(cx, thisValue, callable,
63033 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63034 aRv.NoteJSContextException(cx);
63035 return;
63036 }
63037}
63038
63039void
63040TestJSImplInterfaceJSImpl::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
63041{
63042 CallSetup s(this, aRv, "TestJSImplInterface.passUnion14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63043 if (aRv.Failed()) {
63044 return;
63045 }
63046 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63046); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63046; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63047 BindingCallContext& cx = s.GetCallContext();
63048
63049 JS::Rooted<JS::Value> rval(cx);
63050 JS::RootedVector<JS::Value> argv(cx);
63051 if (!argv.resize(1)) {
63052 // That threw an exception on the JSContext, and our CallSetup will do
63053 // the right thing with that.
63054 return;
63055 }
63056 unsigned argc = 1;
63057
63058 do {
63059 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63060 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63061 aRv.Throw(NS_ERROR_UNEXPECTED);
63062 return;
63063 }
63064 break;
63065 } while (false);
63066
63067 JS::Rooted<JS::Value> callable(cx);
63068 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63069 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63070 !InitIds(cx, atomsCache)) ||
63071 !GetCallableProperty(cx, atomsCache->passUnion14_id, &callable)) {
63072 aRv.Throw(NS_ERROR_UNEXPECTED);
63073 return;
63074 }
63075 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63076 if (!JS::Call(cx, thisValue, callable,
63077 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63078 aRv.NoteJSContextException(cx);
63079 return;
63080 }
63081}
63082
63083void
63084TestJSImplInterfaceJSImpl::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63085{
63086 CallSetup s(this, aRv, "TestJSImplInterface.passUnion15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63087 if (aRv.Failed()) {
63088 return;
63089 }
63090 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63090); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63090; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63091 BindingCallContext& cx = s.GetCallContext();
63092
63093 JS::Rooted<JS::Value> rval(cx);
63094 JS::RootedVector<JS::Value> argv(cx);
63095 if (!argv.resize(1)) {
63096 // That threw an exception on the JSContext, and our CallSetup will do
63097 // the right thing with that.
63098 return;
63099 }
63100 unsigned argc = 1;
63101
63102 do {
63103 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63104 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63105 aRv.Throw(NS_ERROR_UNEXPECTED);
63106 return;
63107 }
63108 break;
63109 } while (false);
63110
63111 JS::Rooted<JS::Value> callable(cx);
63112 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63113 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63114 !InitIds(cx, atomsCache)) ||
63115 !GetCallableProperty(cx, atomsCache->passUnion15_id, &callable)) {
63116 aRv.Throw(NS_ERROR_UNEXPECTED);
63117 return;
63118 }
63119 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63120 if (!JS::Call(cx, thisValue, callable,
63121 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63122 aRv.NoteJSContextException(cx);
63123 return;
63124 }
63125}
63126
63127void
63128TestJSImplInterfaceJSImpl::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
63129{
63130 CallSetup s(this, aRv, "TestJSImplInterface.passUnion16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63131 if (aRv.Failed()) {
63132 return;
63133 }
63134 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63134); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63134; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63135 BindingCallContext& cx = s.GetCallContext();
63136
63137 JS::Rooted<JS::Value> rval(cx);
63138 JS::RootedVector<JS::Value> argv(cx);
63139 if (!argv.resize(1)) {
63140 // That threw an exception on the JSContext, and our CallSetup will do
63141 // the right thing with that.
63142 return;
63143 }
63144 unsigned argc = 1;
63145
63146 do {
63147 if (arg.WasPassed()) {
63148 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63149 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
63150 aRv.Throw(NS_ERROR_UNEXPECTED);
63151 return;
63152 }
63153 break;
63154 } else if (argc == 1) {
63155 // This is our current trailing argument; reduce argc
63156 --argc;
63157 } else {
63158 argv[0].setUndefined();
63159 }
63160 } while (false);
63161
63162 JS::Rooted<JS::Value> callable(cx);
63163 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63164 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63165 !InitIds(cx, atomsCache)) ||
63166 !GetCallableProperty(cx, atomsCache->passUnion16_id, &callable)) {
63167 aRv.Throw(NS_ERROR_UNEXPECTED);
63168 return;
63169 }
63170 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63171 if (!JS::Call(cx, thisValue, callable,
63172 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63173 aRv.NoteJSContextException(cx);
63174 return;
63175 }
63176}
63177
63178void
63179TestJSImplInterfaceJSImpl::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63180{
63181 CallSetup s(this, aRv, "TestJSImplInterface.passUnion17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63182 if (aRv.Failed()) {
63183 return;
63184 }
63185 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63185); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63185; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63186 BindingCallContext& cx = s.GetCallContext();
63187
63188 JS::Rooted<JS::Value> rval(cx);
63189 JS::RootedVector<JS::Value> argv(cx);
63190 if (!argv.resize(1)) {
63191 // That threw an exception on the JSContext, and our CallSetup will do
63192 // the right thing with that.
63193 return;
63194 }
63195 unsigned argc = 1;
63196
63197 do {
63198 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63199 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63200 aRv.Throw(NS_ERROR_UNEXPECTED);
63201 return;
63202 }
63203 break;
63204 } while (false);
63205
63206 JS::Rooted<JS::Value> callable(cx);
63207 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63208 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63209 !InitIds(cx, atomsCache)) ||
63210 !GetCallableProperty(cx, atomsCache->passUnion17_id, &callable)) {
63211 aRv.Throw(NS_ERROR_UNEXPECTED);
63212 return;
63213 }
63214 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63215 if (!JS::Call(cx, thisValue, callable,
63216 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63217 aRv.NoteJSContextException(cx);
63218 return;
63219 }
63220}
63221
63222void
63223TestJSImplInterfaceJSImpl::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63224{
63225 CallSetup s(this, aRv, "TestJSImplInterface.passUnion18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63226 if (aRv.Failed()) {
63227 return;
63228 }
63229 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63229); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63229; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63230 BindingCallContext& cx = s.GetCallContext();
63231
63232 JS::Rooted<JS::Value> rval(cx);
63233 JS::RootedVector<JS::Value> argv(cx);
63234 if (!argv.resize(1)) {
63235 // That threw an exception on the JSContext, and our CallSetup will do
63236 // the right thing with that.
63237 return;
63238 }
63239 unsigned argc = 1;
63240
63241 do {
63242 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63243 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63244 aRv.Throw(NS_ERROR_UNEXPECTED);
63245 return;
63246 }
63247 break;
63248 } while (false);
63249
63250 JS::Rooted<JS::Value> callable(cx);
63251 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63252 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63253 !InitIds(cx, atomsCache)) ||
63254 !GetCallableProperty(cx, atomsCache->passUnion18_id, &callable)) {
63255 aRv.Throw(NS_ERROR_UNEXPECTED);
63256 return;
63257 }
63258 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63259 if (!JS::Call(cx, thisValue, callable,
63260 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63261 aRv.NoteJSContextException(cx);
63262 return;
63263 }
63264}
63265
63266void
63267TestJSImplInterfaceJSImpl::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
63268{
63269 CallSetup s(this, aRv, "TestJSImplInterface.passUnion19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63270 if (aRv.Failed()) {
63271 return;
63272 }
63273 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63273); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63273; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63274 BindingCallContext& cx = s.GetCallContext();
63275
63276 JS::Rooted<JS::Value> rval(cx);
63277 JS::RootedVector<JS::Value> argv(cx);
63278 if (!argv.resize(1)) {
63279 // That threw an exception on the JSContext, and our CallSetup will do
63280 // the right thing with that.
63281 return;
63282 }
63283 unsigned argc = 1;
63284
63285 do {
63286 if (arg.WasPassed()) {
63287 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63288 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
63289 aRv.Throw(NS_ERROR_UNEXPECTED);
63290 return;
63291 }
63292 break;
63293 } else if (argc == 1) {
63294 // This is our current trailing argument; reduce argc
63295 --argc;
63296 } else {
63297 argv[0].setUndefined();
63298 }
63299 } while (false);
63300
63301 JS::Rooted<JS::Value> callable(cx);
63302 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63303 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63304 !InitIds(cx, atomsCache)) ||
63305 !GetCallableProperty(cx, atomsCache->passUnion19_id, &callable)) {
63306 aRv.Throw(NS_ERROR_UNEXPECTED);
63307 return;
63308 }
63309 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63310 if (!JS::Call(cx, thisValue, callable,
63311 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63312 aRv.NoteJSContextException(cx);
63313 return;
63314 }
63315}
63316
63317void
63318TestJSImplInterfaceJSImpl::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63319{
63320 CallSetup s(this, aRv, "TestJSImplInterface.passUnion20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63321 if (aRv.Failed()) {
63322 return;
63323 }
63324 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63324); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63324; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63325 BindingCallContext& cx = s.GetCallContext();
63326
63327 JS::Rooted<JS::Value> rval(cx);
63328 JS::RootedVector<JS::Value> argv(cx);
63329 if (!argv.resize(1)) {
63330 // That threw an exception on the JSContext, and our CallSetup will do
63331 // the right thing with that.
63332 return;
63333 }
63334 unsigned argc = 1;
63335
63336 do {
63337 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63338 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63339 aRv.Throw(NS_ERROR_UNEXPECTED);
63340 return;
63341 }
63342 break;
63343 } while (false);
63344
63345 JS::Rooted<JS::Value> callable(cx);
63346 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63347 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63348 !InitIds(cx, atomsCache)) ||
63349 !GetCallableProperty(cx, atomsCache->passUnion20_id, &callable)) {
63350 aRv.Throw(NS_ERROR_UNEXPECTED);
63351 return;
63352 }
63353 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63354 if (!JS::Call(cx, thisValue, callable,
63355 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63356 aRv.NoteJSContextException(cx);
63357 return;
63358 }
63359}
63360
63361void
63362TestJSImplInterfaceJSImpl::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63363{
63364 CallSetup s(this, aRv, "TestJSImplInterface.passUnion21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63365 if (aRv.Failed()) {
63366 return;
63367 }
63368 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63368); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63368; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63369 BindingCallContext& cx = s.GetCallContext();
63370
63371 JS::Rooted<JS::Value> rval(cx);
63372 JS::RootedVector<JS::Value> argv(cx);
63373 if (!argv.resize(1)) {
63374 // That threw an exception on the JSContext, and our CallSetup will do
63375 // the right thing with that.
63376 return;
63377 }
63378 unsigned argc = 1;
63379
63380 do {
63381 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63382 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63383 aRv.Throw(NS_ERROR_UNEXPECTED);
63384 return;
63385 }
63386 break;
63387 } while (false);
63388
63389 JS::Rooted<JS::Value> callable(cx);
63390 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63391 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63392 !InitIds(cx, atomsCache)) ||
63393 !GetCallableProperty(cx, atomsCache->passUnion21_id, &callable)) {
63394 aRv.Throw(NS_ERROR_UNEXPECTED);
63395 return;
63396 }
63397 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63398 if (!JS::Call(cx, thisValue, callable,
63399 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63400 aRv.NoteJSContextException(cx);
63401 return;
63402 }
63403}
63404
63405void
63406TestJSImplInterfaceJSImpl::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63407{
63408 CallSetup s(this, aRv, "TestJSImplInterface.passUnion22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63409 if (aRv.Failed()) {
63410 return;
63411 }
63412 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63412); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63412; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63413 BindingCallContext& cx = s.GetCallContext();
63414
63415 JS::Rooted<JS::Value> rval(cx);
63416 JS::RootedVector<JS::Value> argv(cx);
63417 if (!argv.resize(1)) {
63418 // That threw an exception on the JSContext, and our CallSetup will do
63419 // the right thing with that.
63420 return;
63421 }
63422 unsigned argc = 1;
63423
63424 do {
63425 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63426 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63427 aRv.Throw(NS_ERROR_UNEXPECTED);
63428 return;
63429 }
63430 break;
63431 } while (false);
63432
63433 JS::Rooted<JS::Value> callable(cx);
63434 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63435 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63436 !InitIds(cx, atomsCache)) ||
63437 !GetCallableProperty(cx, atomsCache->passUnion22_id, &callable)) {
63438 aRv.Throw(NS_ERROR_UNEXPECTED);
63439 return;
63440 }
63441 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63442 if (!JS::Call(cx, thisValue, callable,
63443 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63444 aRv.NoteJSContextException(cx);
63445 return;
63446 }
63447}
63448
63449void
63450TestJSImplInterfaceJSImpl::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63451{
63452 CallSetup s(this, aRv, "TestJSImplInterface.passUnion23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63453 if (aRv.Failed()) {
63454 return;
63455 }
63456 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63456); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63456; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63457 BindingCallContext& cx = s.GetCallContext();
63458
63459 JS::Rooted<JS::Value> rval(cx);
63460 JS::RootedVector<JS::Value> argv(cx);
63461 if (!argv.resize(1)) {
63462 // That threw an exception on the JSContext, and our CallSetup will do
63463 // the right thing with that.
63464 return;
63465 }
63466 unsigned argc = 1;
63467
63468 do {
63469 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63470 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63471 aRv.Throw(NS_ERROR_UNEXPECTED);
63472 return;
63473 }
63474 break;
63475 } while (false);
63476
63477 JS::Rooted<JS::Value> callable(cx);
63478 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63479 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63480 !InitIds(cx, atomsCache)) ||
63481 !GetCallableProperty(cx, atomsCache->passUnion23_id, &callable)) {
63482 aRv.Throw(NS_ERROR_UNEXPECTED);
63483 return;
63484 }
63485 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63486 if (!JS::Call(cx, thisValue, callable,
63487 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63488 aRv.NoteJSContextException(cx);
63489 return;
63490 }
63491}
63492
63493void
63494TestJSImplInterfaceJSImpl::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63495{
63496 CallSetup s(this, aRv, "TestJSImplInterface.passUnion24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63497 if (aRv.Failed()) {
63498 return;
63499 }
63500 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63500; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63501 BindingCallContext& cx = s.GetCallContext();
63502
63503 JS::Rooted<JS::Value> rval(cx);
63504 JS::RootedVector<JS::Value> argv(cx);
63505 if (!argv.resize(1)) {
63506 // That threw an exception on the JSContext, and our CallSetup will do
63507 // the right thing with that.
63508 return;
63509 }
63510 unsigned argc = 1;
63511
63512 do {
63513 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63514 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63515 aRv.Throw(NS_ERROR_UNEXPECTED);
63516 return;
63517 }
63518 break;
63519 } while (false);
63520
63521 JS::Rooted<JS::Value> callable(cx);
63522 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63523 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63524 !InitIds(cx, atomsCache)) ||
63525 !GetCallableProperty(cx, atomsCache->passUnion24_id, &callable)) {
63526 aRv.Throw(NS_ERROR_UNEXPECTED);
63527 return;
63528 }
63529 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63530 if (!JS::Call(cx, thisValue, callable,
63531 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63532 aRv.NoteJSContextException(cx);
63533 return;
63534 }
63535}
63536
63537void
63538TestJSImplInterfaceJSImpl::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63539{
63540 CallSetup s(this, aRv, "TestJSImplInterface.passUnion25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63541 if (aRv.Failed()) {
63542 return;
63543 }
63544 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63544); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63544; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63545 BindingCallContext& cx = s.GetCallContext();
63546
63547 JS::Rooted<JS::Value> rval(cx);
63548 JS::RootedVector<JS::Value> argv(cx);
63549 if (!argv.resize(1)) {
63550 // That threw an exception on the JSContext, and our CallSetup will do
63551 // the right thing with that.
63552 return;
63553 }
63554 unsigned argc = 1;
63555
63556 do {
63557 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63558 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63559 aRv.Throw(NS_ERROR_UNEXPECTED);
63560 return;
63561 }
63562 break;
63563 } while (false);
63564
63565 JS::Rooted<JS::Value> callable(cx);
63566 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63567 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63568 !InitIds(cx, atomsCache)) ||
63569 !GetCallableProperty(cx, atomsCache->passUnion25_id, &callable)) {
63570 aRv.Throw(NS_ERROR_UNEXPECTED);
63571 return;
63572 }
63573 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63574 if (!JS::Call(cx, thisValue, callable,
63575 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63576 aRv.NoteJSContextException(cx);
63577 return;
63578 }
63579}
63580
63581void
63582TestJSImplInterfaceJSImpl::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63583{
63584 CallSetup s(this, aRv, "TestJSImplInterface.passUnion26", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63585 if (aRv.Failed()) {
63586 return;
63587 }
63588 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63588); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63588; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63589 BindingCallContext& cx = s.GetCallContext();
63590
63591 JS::Rooted<JS::Value> rval(cx);
63592 JS::RootedVector<JS::Value> argv(cx);
63593 if (!argv.resize(1)) {
63594 // That threw an exception on the JSContext, and our CallSetup will do
63595 // the right thing with that.
63596 return;
63597 }
63598 unsigned argc = 1;
63599
63600 do {
63601 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63602 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63603 aRv.Throw(NS_ERROR_UNEXPECTED);
63604 return;
63605 }
63606 break;
63607 } while (false);
63608
63609 JS::Rooted<JS::Value> callable(cx);
63610 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63611 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63612 !InitIds(cx, atomsCache)) ||
63613 !GetCallableProperty(cx, atomsCache->passUnion26_id, &callable)) {
63614 aRv.Throw(NS_ERROR_UNEXPECTED);
63615 return;
63616 }
63617 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63618 if (!JS::Call(cx, thisValue, callable,
63619 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63620 aRv.NoteJSContextException(cx);
63621 return;
63622 }
63623}
63624
63625void
63626TestJSImplInterfaceJSImpl::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm)
63627{
63628 CallSetup s(this, aRv, "TestJSImplInterface.passUnion27", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63629 if (aRv.Failed()) {
63630 return;
63631 }
63632 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63632); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63632; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63633 BindingCallContext& cx = s.GetCallContext();
63634
63635 JS::Rooted<JS::Value> rval(cx);
63636 JS::RootedVector<JS::Value> argv(cx);
63637 if (!argv.resize(1)) {
63638 // That threw an exception on the JSContext, and our CallSetup will do
63639 // the right thing with that.
63640 return;
63641 }
63642 unsigned argc = 1;
63643
63644 do {
63645 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63646 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63647 aRv.Throw(NS_ERROR_UNEXPECTED);
63648 return;
63649 }
63650 break;
63651 } while (false);
63652
63653 JS::Rooted<JS::Value> callable(cx);
63654 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63655 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63656 !InitIds(cx, atomsCache)) ||
63657 !GetCallableProperty(cx, atomsCache->passUnion27_id, &callable)) {
63658 aRv.Throw(NS_ERROR_UNEXPECTED);
63659 return;
63660 }
63661 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63662 if (!JS::Call(cx, thisValue, callable,
63663 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63664 aRv.NoteJSContextException(cx);
63665 return;
63666 }
63667}
63668
63669void
63670TestJSImplInterfaceJSImpl::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
63671{
63672 CallSetup s(this, aRv, "TestJSImplInterface.passUnion28", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63673 if (aRv.Failed()) {
63674 return;
63675 }
63676 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63676); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63676; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63677 BindingCallContext& cx = s.GetCallContext();
63678
63679 JS::Rooted<JS::Value> rval(cx);
63680 JS::RootedVector<JS::Value> argv(cx);
63681 if (!argv.resize(1)) {
63682 // That threw an exception on the JSContext, and our CallSetup will do
63683 // the right thing with that.
63684 return;
63685 }
63686 unsigned argc = 1;
63687
63688 do {
63689 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63690 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63691 aRv.Throw(NS_ERROR_UNEXPECTED);
63692 return;
63693 }
63694 break;
63695 } while (false);
63696
63697 JS::Rooted<JS::Value> callable(cx);
63698 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63699 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63700 !InitIds(cx, atomsCache)) ||
63701 !GetCallableProperty(cx, atomsCache->passUnion28_id, &callable)) {
63702 aRv.Throw(NS_ERROR_UNEXPECTED);
63703 return;
63704 }
63705 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63706 if (!JS::Call(cx, thisValue, callable,
63707 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63708 aRv.NoteJSContextException(cx);
63709 return;
63710 }
63711}
63712
63713void
63714TestJSImplInterfaceJSImpl::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63715{
63716 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithCallback", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63717 if (aRv.Failed()) {
63718 return;
63719 }
63720 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63720); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63720; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63721 BindingCallContext& cx = s.GetCallContext();
63722
63723 JS::Rooted<JS::Value> rval(cx);
63724 JS::RootedVector<JS::Value> argv(cx);
63725 if (!argv.resize(1)) {
63726 // That threw an exception on the JSContext, and our CallSetup will do
63727 // the right thing with that.
63728 return;
63729 }
63730 unsigned argc = 1;
63731
63732 do {
63733 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63734 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63735 aRv.Throw(NS_ERROR_UNEXPECTED);
63736 return;
63737 }
63738 break;
63739 } while (false);
63740
63741 JS::Rooted<JS::Value> callable(cx);
63742 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63743 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63744 !InitIds(cx, atomsCache)) ||
63745 !GetCallableProperty(cx, atomsCache->passUnionWithCallback_id, &callable)) {
63746 aRv.Throw(NS_ERROR_UNEXPECTED);
63747 return;
63748 }
63749 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63750 if (!JS::Call(cx, thisValue, callable,
63751 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63752 aRv.NoteJSContextException(cx);
63753 return;
63754 }
63755}
63756
63757void
63758TestJSImplInterfaceJSImpl::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63759{
63760 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithByteString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63761 if (aRv.Failed()) {
63762 return;
63763 }
63764 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63764); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63764; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63765 BindingCallContext& cx = s.GetCallContext();
63766
63767 JS::Rooted<JS::Value> rval(cx);
63768 JS::RootedVector<JS::Value> argv(cx);
63769 if (!argv.resize(1)) {
63770 // That threw an exception on the JSContext, and our CallSetup will do
63771 // the right thing with that.
63772 return;
63773 }
63774 unsigned argc = 1;
63775
63776 do {
63777 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63778 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63779 aRv.Throw(NS_ERROR_UNEXPECTED);
63780 return;
63781 }
63782 break;
63783 } while (false);
63784
63785 JS::Rooted<JS::Value> callable(cx);
63786 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63787 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63788 !InitIds(cx, atomsCache)) ||
63789 !GetCallableProperty(cx, atomsCache->passUnionWithByteString_id, &callable)) {
63790 aRv.Throw(NS_ERROR_UNEXPECTED);
63791 return;
63792 }
63793 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63794 if (!JS::Call(cx, thisValue, callable,
63795 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63796 aRv.NoteJSContextException(cx);
63797 return;
63798 }
63799}
63800
63801void
63802TestJSImplInterfaceJSImpl::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63803{
63804 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithUTF8String", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63805 if (aRv.Failed()) {
63806 return;
63807 }
63808 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63808); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63808; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63809 BindingCallContext& cx = s.GetCallContext();
63810
63811 JS::Rooted<JS::Value> rval(cx);
63812 JS::RootedVector<JS::Value> argv(cx);
63813 if (!argv.resize(1)) {
63814 // That threw an exception on the JSContext, and our CallSetup will do
63815 // the right thing with that.
63816 return;
63817 }
63818 unsigned argc = 1;
63819
63820 do {
63821 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63822 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63823 aRv.Throw(NS_ERROR_UNEXPECTED);
63824 return;
63825 }
63826 break;
63827 } while (false);
63828
63829 JS::Rooted<JS::Value> callable(cx);
63830 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63831 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63832 !InitIds(cx, atomsCache)) ||
63833 !GetCallableProperty(cx, atomsCache->passUnionWithUTF8String_id, &callable)) {
63834 aRv.Throw(NS_ERROR_UNEXPECTED);
63835 return;
63836 }
63837 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63838 if (!JS::Call(cx, thisValue, callable,
63839 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63840 aRv.NoteJSContextException(cx);
63841 return;
63842 }
63843}
63844
63845void
63846TestJSImplInterfaceJSImpl::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
63847{
63848 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63849 if (aRv.Failed()) {
63850 return;
63851 }
63852 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63852); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63852; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63853 BindingCallContext& cx = s.GetCallContext();
63854
63855 JS::Rooted<JS::Value> rval(cx);
63856 JS::RootedVector<JS::Value> argv(cx);
63857 if (!argv.resize(1)) {
63858 // That threw an exception on the JSContext, and our CallSetup will do
63859 // the right thing with that.
63860 return;
63861 }
63862 unsigned argc = 1;
63863
63864 do {
63865 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63866 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63867 aRv.Throw(NS_ERROR_UNEXPECTED);
63868 return;
63869 }
63870 break;
63871 } while (false);
63872
63873 JS::Rooted<JS::Value> callable(cx);
63874 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63875 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63876 !InitIds(cx, atomsCache)) ||
63877 !GetCallableProperty(cx, atomsCache->passUnionWithRecord_id, &callable)) {
63878 aRv.Throw(NS_ERROR_UNEXPECTED);
63879 return;
63880 }
63881 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63882 if (!JS::Call(cx, thisValue, callable,
63883 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63884 aRv.NoteJSContextException(cx);
63885 return;
63886 }
63887}
63888
63889void
63890TestJSImplInterfaceJSImpl::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
63891{
63892 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithRecordAndSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63893 if (aRv.Failed()) {
63894 return;
63895 }
63896 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63896); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63896; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63897 BindingCallContext& cx = s.GetCallContext();
63898
63899 JS::Rooted<JS::Value> rval(cx);
63900 JS::RootedVector<JS::Value> argv(cx);
63901 if (!argv.resize(1)) {
63902 // That threw an exception on the JSContext, and our CallSetup will do
63903 // the right thing with that.
63904 return;
63905 }
63906 unsigned argc = 1;
63907
63908 do {
63909 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63910 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63911 aRv.Throw(NS_ERROR_UNEXPECTED);
63912 return;
63913 }
63914 break;
63915 } while (false);
63916
63917 JS::Rooted<JS::Value> callable(cx);
63918 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63919 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63920 !InitIds(cx, atomsCache)) ||
63921 !GetCallableProperty(cx, atomsCache->passUnionWithRecordAndSequence_id, &callable)) {
63922 aRv.Throw(NS_ERROR_UNEXPECTED);
63923 return;
63924 }
63925 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63926 if (!JS::Call(cx, thisValue, callable,
63927 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63928 aRv.NoteJSContextException(cx);
63929 return;
63930 }
63931}
63932
63933void
63934TestJSImplInterfaceJSImpl::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm)
63935{
63936 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSequenceAndRecord", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63937 if (aRv.Failed()) {
63938 return;
63939 }
63940 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63940); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63940; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63941 BindingCallContext& cx = s.GetCallContext();
63942
63943 JS::Rooted<JS::Value> rval(cx);
63944 JS::RootedVector<JS::Value> argv(cx);
63945 if (!argv.resize(1)) {
63946 // That threw an exception on the JSContext, and our CallSetup will do
63947 // the right thing with that.
63948 return;
63949 }
63950 unsigned argc = 1;
63951
63952 do {
63953 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63954 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63955 aRv.Throw(NS_ERROR_UNEXPECTED);
63956 return;
63957 }
63958 break;
63959 } while (false);
63960
63961 JS::Rooted<JS::Value> callable(cx);
63962 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
63963 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
63964 !InitIds(cx, atomsCache)) ||
63965 !GetCallableProperty(cx, atomsCache->passUnionWithSequenceAndRecord_id, &callable)) {
63966 aRv.Throw(NS_ERROR_UNEXPECTED);
63967 return;
63968 }
63969 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
63970 if (!JS::Call(cx, thisValue, callable,
63971 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
63972 aRv.NoteJSContextException(cx);
63973 return;
63974 }
63975}
63976
63977void
63978TestJSImplInterfaceJSImpl::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
63979{
63980 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithSVS", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
63981 if (aRv.Failed()) {
63982 return;
63983 }
63984 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 63984); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 63984; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
63985 BindingCallContext& cx = s.GetCallContext();
63986
63987 JS::Rooted<JS::Value> rval(cx);
63988 JS::RootedVector<JS::Value> argv(cx);
63989 if (!argv.resize(1)) {
63990 // That threw an exception on the JSContext, and our CallSetup will do
63991 // the right thing with that.
63992 return;
63993 }
63994 unsigned argc = 1;
63995
63996 do {
63997 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
63998 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
63999 aRv.Throw(NS_ERROR_UNEXPECTED);
64000 return;
64001 }
64002 break;
64003 } while (false);
64004
64005 JS::Rooted<JS::Value> callable(cx);
64006 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64007 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64008 !InitIds(cx, atomsCache)) ||
64009 !GetCallableProperty(cx, atomsCache->passUnionWithSVS_id, &callable)) {
64010 aRv.Throw(NS_ERROR_UNEXPECTED);
64011 return;
64012 }
64013 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64014 if (!JS::Call(cx, thisValue, callable,
64015 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64016 aRv.NoteJSContextException(cx);
64017 return;
64018 }
64019}
64020
64021void
64022TestJSImplInterfaceJSImpl::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
64023{
64024 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64025 if (aRv.Failed()) {
64026 return;
64027 }
64028 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64028); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64028; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64029 BindingCallContext& cx = s.GetCallContext();
64030
64031 JS::Rooted<JS::Value> rval(cx);
64032 JS::RootedVector<JS::Value> argv(cx);
64033 if (!argv.resize(1)) {
64034 // That threw an exception on the JSContext, and our CallSetup will do
64035 // the right thing with that.
64036 return;
64037 }
64038 unsigned argc = 1;
64039
64040 do {
64041 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64042 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64043 aRv.Throw(NS_ERROR_UNEXPECTED);
64044 return;
64045 }
64046 break;
64047 } while (false);
64048
64049 JS::Rooted<JS::Value> callable(cx);
64050 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64051 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64052 !InitIds(cx, atomsCache)) ||
64053 !GetCallableProperty(cx, atomsCache->passUnionWithNullable_id, &callable)) {
64054 aRv.Throw(NS_ERROR_UNEXPECTED);
64055 return;
64056 }
64057 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64058 if (!JS::Call(cx, thisValue, callable,
64059 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64060 aRv.NoteJSContextException(cx);
64061 return;
64062 }
64063}
64064
64065void
64066TestJSImplInterfaceJSImpl::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64067{
64068 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64069 if (aRv.Failed()) {
64070 return;
64071 }
64072 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64072); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64072; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64073 BindingCallContext& cx = s.GetCallContext();
64074
64075 JS::Rooted<JS::Value> rval(cx);
64076 JS::RootedVector<JS::Value> argv(cx);
64077 if (!argv.resize(1)) {
64078 // That threw an exception on the JSContext, and our CallSetup will do
64079 // the right thing with that.
64080 return;
64081 }
64082 unsigned argc = 1;
64083
64084 do {
64085 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64086 if (arg.IsNull()) {
64087 argv[0].setNull();
64088 break;
64089 }
64090 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64091 aRv.Throw(NS_ERROR_UNEXPECTED);
64092 return;
64093 }
64094 break;
64095 } while (false);
64096
64097 JS::Rooted<JS::Value> callable(cx);
64098 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64099 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64100 !InitIds(cx, atomsCache)) ||
64101 !GetCallableProperty(cx, atomsCache->passNullableUnion_id, &callable)) {
64102 aRv.Throw(NS_ERROR_UNEXPECTED);
64103 return;
64104 }
64105 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64106 if (!JS::Call(cx, thisValue, callable,
64107 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64108 aRv.NoteJSContextException(cx);
64109 return;
64110 }
64111}
64112
64113void
64114TestJSImplInterfaceJSImpl::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64115{
64116 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64117 if (aRv.Failed()) {
64118 return;
64119 }
64120 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64120); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64120; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64121 BindingCallContext& cx = s.GetCallContext();
64122
64123 JS::Rooted<JS::Value> rval(cx);
64124 JS::RootedVector<JS::Value> argv(cx);
64125 if (!argv.resize(1)) {
64126 // That threw an exception on the JSContext, and our CallSetup will do
64127 // the right thing with that.
64128 return;
64129 }
64130 unsigned argc = 1;
64131
64132 do {
64133 if (arg.WasPassed()) {
64134 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64135 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64136 aRv.Throw(NS_ERROR_UNEXPECTED);
64137 return;
64138 }
64139 break;
64140 } else if (argc == 1) {
64141 // This is our current trailing argument; reduce argc
64142 --argc;
64143 } else {
64144 argv[0].setUndefined();
64145 }
64146 } while (false);
64147
64148 JS::Rooted<JS::Value> callable(cx);
64149 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64150 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64151 !InitIds(cx, atomsCache)) ||
64152 !GetCallableProperty(cx, atomsCache->passOptionalUnion_id, &callable)) {
64153 aRv.Throw(NS_ERROR_UNEXPECTED);
64154 return;
64155 }
64156 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64157 if (!JS::Call(cx, thisValue, callable,
64158 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64159 aRv.NoteJSContextException(cx);
64160 return;
64161 }
64162}
64163
64164void
64165TestJSImplInterfaceJSImpl::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64166{
64167 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64168 if (aRv.Failed()) {
64169 return;
64170 }
64171 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64171; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64172 BindingCallContext& cx = s.GetCallContext();
64173
64174 JS::Rooted<JS::Value> rval(cx);
64175 JS::RootedVector<JS::Value> argv(cx);
64176 if (!argv.resize(1)) {
64177 // That threw an exception on the JSContext, and our CallSetup will do
64178 // the right thing with that.
64179 return;
64180 }
64181 unsigned argc = 1;
64182
64183 do {
64184 if (arg.WasPassed()) {
64185 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64186 if (arg.Value().IsNull()) {
64187 argv[0].setNull();
64188 break;
64189 }
64190 if (!arg.Value().Value().ToJSVal(cx, callbackObj, argv[0])) {
64191 aRv.Throw(NS_ERROR_UNEXPECTED);
64192 return;
64193 }
64194 break;
64195 } else if (argc == 1) {
64196 // This is our current trailing argument; reduce argc
64197 --argc;
64198 } else {
64199 argv[0].setUndefined();
64200 }
64201 } while (false);
64202
64203 JS::Rooted<JS::Value> callable(cx);
64204 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64205 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64206 !InitIds(cx, atomsCache)) ||
64207 !GetCallableProperty(cx, atomsCache->passOptionalNullableUnion_id, &callable)) {
64208 aRv.Throw(NS_ERROR_UNEXPECTED);
64209 return;
64210 }
64211 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64212 if (!JS::Call(cx, thisValue, callable,
64213 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64214 aRv.NoteJSContextException(cx);
64215 return;
64216 }
64217}
64218
64219void
64220TestJSImplInterfaceJSImpl::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
64221{
64222 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalNullableUnionWithDefaultValue", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64223 if (aRv.Failed()) {
64224 return;
64225 }
64226 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64226); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64226; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64227 BindingCallContext& cx = s.GetCallContext();
64228
64229 JS::Rooted<JS::Value> rval(cx);
64230 JS::RootedVector<JS::Value> argv(cx);
64231 if (!argv.resize(1)) {
64232 // That threw an exception on the JSContext, and our CallSetup will do
64233 // the right thing with that.
64234 return;
64235 }
64236 unsigned argc = 1;
64237
64238 do {
64239 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64240 if (arg.IsNull()) {
64241 argv[0].setNull();
64242 break;
64243 }
64244 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
64245 aRv.Throw(NS_ERROR_UNEXPECTED);
64246 return;
64247 }
64248 break;
64249 } while (false);
64250
64251 JS::Rooted<JS::Value> callable(cx);
64252 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64253 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64254 !InitIds(cx, atomsCache)) ||
64255 !GetCallableProperty(cx, atomsCache->passOptionalNullableUnionWithDefaultValue_id, &callable)) {
64256 aRv.Throw(NS_ERROR_UNEXPECTED);
64257 return;
64258 }
64259 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64260 if (!JS::Call(cx, thisValue, callable,
64261 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64262 aRv.NoteJSContextException(cx);
64263 return;
64264 }
64265}
64266
64267void
64268TestJSImplInterfaceJSImpl::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
64269{
64270 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64271 if (aRv.Failed()) {
64272 return;
64273 }
64274 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64274); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64274; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64275 BindingCallContext& cx = s.GetCallContext();
64276
64277 JS::Rooted<JS::Value> rval(cx);
64278 JS::RootedVector<JS::Value> argv(cx);
64279 if (!argv.resize(1)) {
64280 // That threw an exception on the JSContext, and our CallSetup will do
64281 // the right thing with that.
64282 return;
64283 }
64284 unsigned argc = 1;
64285
64286 do {
64287 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64288 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64289 aRv.Throw(NS_ERROR_UNEXPECTED);
64290 return;
64291 }
64292 break;
64293 } while (false);
64294
64295 JS::Rooted<JS::Value> callable(cx);
64296 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64297 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64298 !InitIds(cx, atomsCache)) ||
64299 !GetCallableProperty(cx, atomsCache->passUnionWithArrayBuffer_id, &callable)) {
64300 aRv.Throw(NS_ERROR_UNEXPECTED);
64301 return;
64302 }
64303 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64304 if (!JS::Call(cx, thisValue, callable,
64305 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64306 aRv.NoteJSContextException(cx);
64307 return;
64308 }
64309}
64310
64311void
64312TestJSImplInterfaceJSImpl::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
64313{
64314 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithArrayBufferOrNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64315 if (aRv.Failed()) {
64316 return;
64317 }
64318 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64318); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64318; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64319 BindingCallContext& cx = s.GetCallContext();
64320
64321 JS::Rooted<JS::Value> rval(cx);
64322 JS::RootedVector<JS::Value> argv(cx);
64323 if (!argv.resize(1)) {
64324 // That threw an exception on the JSContext, and our CallSetup will do
64325 // the right thing with that.
64326 return;
64327 }
64328 unsigned argc = 1;
64329
64330 do {
64331 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64332 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64333 aRv.Throw(NS_ERROR_UNEXPECTED);
64334 return;
64335 }
64336 break;
64337 } while (false);
64338
64339 JS::Rooted<JS::Value> callable(cx);
64340 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64341 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64342 !InitIds(cx, atomsCache)) ||
64343 !GetCallableProperty(cx, atomsCache->passUnionWithArrayBufferOrNull_id, &callable)) {
64344 aRv.Throw(NS_ERROR_UNEXPECTED);
64345 return;
64346 }
64347 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64348 if (!JS::Call(cx, thisValue, callable,
64349 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64350 aRv.NoteJSContextException(cx);
64351 return;
64352 }
64353}
64354
64355void
64356TestJSImplInterfaceJSImpl::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
64357{
64358 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArrays", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64359 if (aRv.Failed()) {
64360 return;
64361 }
64362 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64362; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64363 BindingCallContext& cx = s.GetCallContext();
64364
64365 JS::Rooted<JS::Value> rval(cx);
64366 JS::RootedVector<JS::Value> argv(cx);
64367 if (!argv.resize(1)) {
64368 // That threw an exception on the JSContext, and our CallSetup will do
64369 // the right thing with that.
64370 return;
64371 }
64372 unsigned argc = 1;
64373
64374 do {
64375 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64376 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64377 aRv.Throw(NS_ERROR_UNEXPECTED);
64378 return;
64379 }
64380 break;
64381 } while (false);
64382
64383 JS::Rooted<JS::Value> callable(cx);
64384 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64385 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64386 !InitIds(cx, atomsCache)) ||
64387 !GetCallableProperty(cx, atomsCache->passUnionWithTypedArrays_id, &callable)) {
64388 aRv.Throw(NS_ERROR_UNEXPECTED);
64389 return;
64390 }
64391 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64392 if (!JS::Call(cx, thisValue, callable,
64393 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64394 aRv.NoteJSContextException(cx);
64395 return;
64396 }
64397}
64398
64399void
64400TestJSImplInterfaceJSImpl::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
64401{
64402 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithTypedArraysOrNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64403 if (aRv.Failed()) {
64404 return;
64405 }
64406 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64406); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64406; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64407 BindingCallContext& cx = s.GetCallContext();
64408
64409 JS::Rooted<JS::Value> rval(cx);
64410 JS::RootedVector<JS::Value> argv(cx);
64411 if (!argv.resize(1)) {
64412 // That threw an exception on the JSContext, and our CallSetup will do
64413 // the right thing with that.
64414 return;
64415 }
64416 unsigned argc = 1;
64417
64418 do {
64419 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64420 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64421 aRv.Throw(NS_ERROR_UNEXPECTED);
64422 return;
64423 }
64424 break;
64425 } while (false);
64426
64427 JS::Rooted<JS::Value> callable(cx);
64428 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64429 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64430 !InitIds(cx, atomsCache)) ||
64431 !GetCallableProperty(cx, atomsCache->passUnionWithTypedArraysOrNull_id, &callable)) {
64432 aRv.Throw(NS_ERROR_UNEXPECTED);
64433 return;
64434 }
64435 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64436 if (!JS::Call(cx, thisValue, callable,
64437 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64438 aRv.NoteJSContextException(cx);
64439 return;
64440 }
64441}
64442
64443void
64444TestJSImplInterfaceJSImpl::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
64445{
64446 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithString", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64447 if (aRv.Failed()) {
64448 return;
64449 }
64450 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64450; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64451 BindingCallContext& cx = s.GetCallContext();
64452
64453 JS::Rooted<JS::Value> rval(cx);
64454 JS::RootedVector<JS::Value> argv(cx);
64455 if (!argv.resize(1)) {
64456 // That threw an exception on the JSContext, and our CallSetup will do
64457 // the right thing with that.
64458 return;
64459 }
64460 unsigned argc = 1;
64461
64462 do {
64463 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64464 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64465 aRv.Throw(NS_ERROR_UNEXPECTED);
64466 return;
64467 }
64468 break;
64469 } while (false);
64470
64471 JS::Rooted<JS::Value> callable(cx);
64472 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64473 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64474 !InitIds(cx, atomsCache)) ||
64475 !GetCallableProperty(cx, atomsCache->passUnionWithString_id, &callable)) {
64476 aRv.Throw(NS_ERROR_UNEXPECTED);
64477 return;
64478 }
64479 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64480 if (!JS::Call(cx, thisValue, callable,
64481 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64482 aRv.NoteJSContextException(cx);
64483 return;
64484 }
64485}
64486
64487void
64488TestJSImplInterfaceJSImpl::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
64489{
64490 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithEnum", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64491 if (aRv.Failed()) {
64492 return;
64493 }
64494 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64494); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64494; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64495 BindingCallContext& cx = s.GetCallContext();
64496
64497 JS::Rooted<JS::Value> rval(cx);
64498 JS::RootedVector<JS::Value> argv(cx);
64499 if (!argv.resize(1)) {
64500 // That threw an exception on the JSContext, and our CallSetup will do
64501 // the right thing with that.
64502 return;
64503 }
64504 unsigned argc = 1;
64505
64506 do {
64507 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64508 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64509 aRv.Throw(NS_ERROR_UNEXPECTED);
64510 return;
64511 }
64512 break;
64513 } while (false);
64514
64515 JS::Rooted<JS::Value> callable(cx);
64516 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64517 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64518 !InitIds(cx, atomsCache)) ||
64519 !GetCallableProperty(cx, atomsCache->passUnionWithEnum_id, &callable)) {
64520 aRv.Throw(NS_ERROR_UNEXPECTED);
64521 return;
64522 }
64523 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64524 if (!JS::Call(cx, thisValue, callable,
64525 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64526 aRv.NoteJSContextException(cx);
64527 return;
64528 }
64529}
64530
64531void
64532TestJSImplInterfaceJSImpl::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
64533{
64534 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithObject", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64535 if (aRv.Failed()) {
64536 return;
64537 }
64538 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64538); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64538; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64539 BindingCallContext& cx = s.GetCallContext();
64540
64541 JS::Rooted<JS::Value> rval(cx);
64542 JS::RootedVector<JS::Value> argv(cx);
64543 if (!argv.resize(1)) {
64544 // That threw an exception on the JSContext, and our CallSetup will do
64545 // the right thing with that.
64546 return;
64547 }
64548 unsigned argc = 1;
64549
64550 do {
64551 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64552 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64553 aRv.Throw(NS_ERROR_UNEXPECTED);
64554 return;
64555 }
64556 break;
64557 } while (false);
64558
64559 JS::Rooted<JS::Value> callable(cx);
64560 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64561 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64562 !InitIds(cx, atomsCache)) ||
64563 !GetCallableProperty(cx, atomsCache->passUnionWithObject_id, &callable)) {
64564 aRv.Throw(NS_ERROR_UNEXPECTED);
64565 return;
64566 }
64567 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64568 if (!JS::Call(cx, thisValue, callable,
64569 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64570 aRv.NoteJSContextException(cx);
64571 return;
64572 }
64573}
64574
64575void
64576TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64577{
64578 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64579 if (aRv.Failed()) {
64580 return;
64581 }
64582 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64582); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64582; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64583 BindingCallContext& cx = s.GetCallContext();
64584
64585 JS::Rooted<JS::Value> rval(cx);
64586 JS::RootedVector<JS::Value> argv(cx);
64587 if (!argv.resize(1)) {
64588 // That threw an exception on the JSContext, and our CallSetup will do
64589 // the right thing with that.
64590 return;
64591 }
64592 unsigned argc = 1;
64593
64594 do {
64595 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64596 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64597 aRv.Throw(NS_ERROR_UNEXPECTED);
64598 return;
64599 }
64600 break;
64601 } while (false);
64602
64603 JS::Rooted<JS::Value> callable(cx);
64604 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64605 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64606 !InitIds(cx, atomsCache)) ||
64607 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue1_id, &callable)) {
64608 aRv.Throw(NS_ERROR_UNEXPECTED);
64609 return;
64610 }
64611 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64612 if (!JS::Call(cx, thisValue, callable,
64613 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64614 aRv.NoteJSContextException(cx);
64615 return;
64616 }
64617}
64618
64619void
64620TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64621{
64622 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64623 if (aRv.Failed()) {
64624 return;
64625 }
64626 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64626); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64626; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64627 BindingCallContext& cx = s.GetCallContext();
64628
64629 JS::Rooted<JS::Value> rval(cx);
64630 JS::RootedVector<JS::Value> argv(cx);
64631 if (!argv.resize(1)) {
64632 // That threw an exception on the JSContext, and our CallSetup will do
64633 // the right thing with that.
64634 return;
64635 }
64636 unsigned argc = 1;
64637
64638 do {
64639 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64640 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64641 aRv.Throw(NS_ERROR_UNEXPECTED);
64642 return;
64643 }
64644 break;
64645 } while (false);
64646
64647 JS::Rooted<JS::Value> callable(cx);
64648 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64649 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64650 !InitIds(cx, atomsCache)) ||
64651 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue2_id, &callable)) {
64652 aRv.Throw(NS_ERROR_UNEXPECTED);
64653 return;
64654 }
64655 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64656 if (!JS::Call(cx, thisValue, callable,
64657 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64658 aRv.NoteJSContextException(cx);
64659 return;
64660 }
64661}
64662
64663void
64664TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64665{
64666 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64667 if (aRv.Failed()) {
64668 return;
64669 }
64670 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64670); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64670; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64671 BindingCallContext& cx = s.GetCallContext();
64672
64673 JS::Rooted<JS::Value> rval(cx);
64674 JS::RootedVector<JS::Value> argv(cx);
64675 if (!argv.resize(1)) {
64676 // That threw an exception on the JSContext, and our CallSetup will do
64677 // the right thing with that.
64678 return;
64679 }
64680 unsigned argc = 1;
64681
64682 do {
64683 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64684 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64685 aRv.Throw(NS_ERROR_UNEXPECTED);
64686 return;
64687 }
64688 break;
64689 } while (false);
64690
64691 JS::Rooted<JS::Value> callable(cx);
64692 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64693 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64694 !InitIds(cx, atomsCache)) ||
64695 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue3_id, &callable)) {
64696 aRv.Throw(NS_ERROR_UNEXPECTED);
64697 return;
64698 }
64699 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64700 if (!JS::Call(cx, thisValue, callable,
64701 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64702 aRv.NoteJSContextException(cx);
64703 return;
64704 }
64705}
64706
64707void
64708TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64709{
64710 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64711 if (aRv.Failed()) {
64712 return;
64713 }
64714 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64714); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64714; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64715 BindingCallContext& cx = s.GetCallContext();
64716
64717 JS::Rooted<JS::Value> rval(cx);
64718 JS::RootedVector<JS::Value> argv(cx);
64719 if (!argv.resize(1)) {
64720 // That threw an exception on the JSContext, and our CallSetup will do
64721 // the right thing with that.
64722 return;
64723 }
64724 unsigned argc = 1;
64725
64726 do {
64727 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64728 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64729 aRv.Throw(NS_ERROR_UNEXPECTED);
64730 return;
64731 }
64732 break;
64733 } while (false);
64734
64735 JS::Rooted<JS::Value> callable(cx);
64736 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64737 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64738 !InitIds(cx, atomsCache)) ||
64739 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue4_id, &callable)) {
64740 aRv.Throw(NS_ERROR_UNEXPECTED);
64741 return;
64742 }
64743 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64744 if (!JS::Call(cx, thisValue, callable,
64745 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64746 aRv.NoteJSContextException(cx);
64747 return;
64748 }
64749}
64750
64751void
64752TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64753{
64754 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64755 if (aRv.Failed()) {
64756 return;
64757 }
64758 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64758); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64758; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64759 BindingCallContext& cx = s.GetCallContext();
64760
64761 JS::Rooted<JS::Value> rval(cx);
64762 JS::RootedVector<JS::Value> argv(cx);
64763 if (!argv.resize(1)) {
64764 // That threw an exception on the JSContext, and our CallSetup will do
64765 // the right thing with that.
64766 return;
64767 }
64768 unsigned argc = 1;
64769
64770 do {
64771 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64772 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64773 aRv.Throw(NS_ERROR_UNEXPECTED);
64774 return;
64775 }
64776 break;
64777 } while (false);
64778
64779 JS::Rooted<JS::Value> callable(cx);
64780 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64781 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64782 !InitIds(cx, atomsCache)) ||
64783 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue5_id, &callable)) {
64784 aRv.Throw(NS_ERROR_UNEXPECTED);
64785 return;
64786 }
64787 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64788 if (!JS::Call(cx, thisValue, callable,
64789 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64790 aRv.NoteJSContextException(cx);
64791 return;
64792 }
64793}
64794
64795void
64796TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64797{
64798 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64799 if (aRv.Failed()) {
64800 return;
64801 }
64802 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64802); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64802; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64803 BindingCallContext& cx = s.GetCallContext();
64804
64805 JS::Rooted<JS::Value> rval(cx);
64806 JS::RootedVector<JS::Value> argv(cx);
64807 if (!argv.resize(1)) {
64808 // That threw an exception on the JSContext, and our CallSetup will do
64809 // the right thing with that.
64810 return;
64811 }
64812 unsigned argc = 1;
64813
64814 do {
64815 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64816 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64817 aRv.Throw(NS_ERROR_UNEXPECTED);
64818 return;
64819 }
64820 break;
64821 } while (false);
64822
64823 JS::Rooted<JS::Value> callable(cx);
64824 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64825 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64826 !InitIds(cx, atomsCache)) ||
64827 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue6_id, &callable)) {
64828 aRv.Throw(NS_ERROR_UNEXPECTED);
64829 return;
64830 }
64831 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64832 if (!JS::Call(cx, thisValue, callable,
64833 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64834 aRv.NoteJSContextException(cx);
64835 return;
64836 }
64837}
64838
64839void
64840TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64841{
64842 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64843 if (aRv.Failed()) {
64844 return;
64845 }
64846 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64846); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64846; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64847 BindingCallContext& cx = s.GetCallContext();
64848
64849 JS::Rooted<JS::Value> rval(cx);
64850 JS::RootedVector<JS::Value> argv(cx);
64851 if (!argv.resize(1)) {
64852 // That threw an exception on the JSContext, and our CallSetup will do
64853 // the right thing with that.
64854 return;
64855 }
64856 unsigned argc = 1;
64857
64858 do {
64859 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64860 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64861 aRv.Throw(NS_ERROR_UNEXPECTED);
64862 return;
64863 }
64864 break;
64865 } while (false);
64866
64867 JS::Rooted<JS::Value> callable(cx);
64868 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64869 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64870 !InitIds(cx, atomsCache)) ||
64871 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue7_id, &callable)) {
64872 aRv.Throw(NS_ERROR_UNEXPECTED);
64873 return;
64874 }
64875 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64876 if (!JS::Call(cx, thisValue, callable,
64877 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64878 aRv.NoteJSContextException(cx);
64879 return;
64880 }
64881}
64882
64883void
64884TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64885{
64886 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64887 if (aRv.Failed()) {
64888 return;
64889 }
64890 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64890); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64890; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64891 BindingCallContext& cx = s.GetCallContext();
64892
64893 JS::Rooted<JS::Value> rval(cx);
64894 JS::RootedVector<JS::Value> argv(cx);
64895 if (!argv.resize(1)) {
64896 // That threw an exception on the JSContext, and our CallSetup will do
64897 // the right thing with that.
64898 return;
64899 }
64900 unsigned argc = 1;
64901
64902 do {
64903 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64904 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64905 aRv.Throw(NS_ERROR_UNEXPECTED);
64906 return;
64907 }
64908 break;
64909 } while (false);
64910
64911 JS::Rooted<JS::Value> callable(cx);
64912 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64913 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64914 !InitIds(cx, atomsCache)) ||
64915 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue8_id, &callable)) {
64916 aRv.Throw(NS_ERROR_UNEXPECTED);
64917 return;
64918 }
64919 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64920 if (!JS::Call(cx, thisValue, callable,
64921 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64922 aRv.NoteJSContextException(cx);
64923 return;
64924 }
64925}
64926
64927void
64928TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64929{
64930 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64931 if (aRv.Failed()) {
64932 return;
64933 }
64934 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64934); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64934; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64935 BindingCallContext& cx = s.GetCallContext();
64936
64937 JS::Rooted<JS::Value> rval(cx);
64938 JS::RootedVector<JS::Value> argv(cx);
64939 if (!argv.resize(1)) {
64940 // That threw an exception on the JSContext, and our CallSetup will do
64941 // the right thing with that.
64942 return;
64943 }
64944 unsigned argc = 1;
64945
64946 do {
64947 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64948 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64949 aRv.Throw(NS_ERROR_UNEXPECTED);
64950 return;
64951 }
64952 break;
64953 } while (false);
64954
64955 JS::Rooted<JS::Value> callable(cx);
64956 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
64957 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
64958 !InitIds(cx, atomsCache)) ||
64959 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue9_id, &callable)) {
64960 aRv.Throw(NS_ERROR_UNEXPECTED);
64961 return;
64962 }
64963 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
64964 if (!JS::Call(cx, thisValue, callable,
64965 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
64966 aRv.NoteJSContextException(cx);
64967 return;
64968 }
64969}
64970
64971void
64972TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
64973{
64974 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
64975 if (aRv.Failed()) {
64976 return;
64977 }
64978 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 64978); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 64978; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
64979 BindingCallContext& cx = s.GetCallContext();
64980
64981 JS::Rooted<JS::Value> rval(cx);
64982 JS::RootedVector<JS::Value> argv(cx);
64983 if (!argv.resize(1)) {
64984 // That threw an exception on the JSContext, and our CallSetup will do
64985 // the right thing with that.
64986 return;
64987 }
64988 unsigned argc = 1;
64989
64990 do {
64991 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
64992 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
64993 aRv.Throw(NS_ERROR_UNEXPECTED);
64994 return;
64995 }
64996 break;
64997 } while (false);
64998
64999 JS::Rooted<JS::Value> callable(cx);
65000 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65001 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65002 !InitIds(cx, atomsCache)) ||
65003 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue10_id, &callable)) {
65004 aRv.Throw(NS_ERROR_UNEXPECTED);
65005 return;
65006 }
65007 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65008 if (!JS::Call(cx, thisValue, callable,
65009 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65010 aRv.NoteJSContextException(cx);
65011 return;
65012 }
65013}
65014
65015void
65016TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65017{
65018 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65019 if (aRv.Failed()) {
65020 return;
65021 }
65022 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65022); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65022; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65023 BindingCallContext& cx = s.GetCallContext();
65024
65025 JS::Rooted<JS::Value> rval(cx);
65026 JS::RootedVector<JS::Value> argv(cx);
65027 if (!argv.resize(1)) {
65028 // That threw an exception on the JSContext, and our CallSetup will do
65029 // the right thing with that.
65030 return;
65031 }
65032 unsigned argc = 1;
65033
65034 do {
65035 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65036 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65037 aRv.Throw(NS_ERROR_UNEXPECTED);
65038 return;
65039 }
65040 break;
65041 } while (false);
65042
65043 JS::Rooted<JS::Value> callable(cx);
65044 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65045 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65046 !InitIds(cx, atomsCache)) ||
65047 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue11_id, &callable)) {
65048 aRv.Throw(NS_ERROR_UNEXPECTED);
65049 return;
65050 }
65051 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65052 if (!JS::Call(cx, thisValue, callable,
65053 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65054 aRv.NoteJSContextException(cx);
65055 return;
65056 }
65057}
65058
65059void
65060TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65061{
65062 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65063 if (aRv.Failed()) {
65064 return;
65065 }
65066 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65066); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65066; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65067 BindingCallContext& cx = s.GetCallContext();
65068
65069 JS::Rooted<JS::Value> rval(cx);
65070 JS::RootedVector<JS::Value> argv(cx);
65071 if (!argv.resize(1)) {
65072 // That threw an exception on the JSContext, and our CallSetup will do
65073 // the right thing with that.
65074 return;
65075 }
65076 unsigned argc = 1;
65077
65078 do {
65079 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65080 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65081 aRv.Throw(NS_ERROR_UNEXPECTED);
65082 return;
65083 }
65084 break;
65085 } while (false);
65086
65087 JS::Rooted<JS::Value> callable(cx);
65088 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65089 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65090 !InitIds(cx, atomsCache)) ||
65091 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue12_id, &callable)) {
65092 aRv.Throw(NS_ERROR_UNEXPECTED);
65093 return;
65094 }
65095 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65096 if (!JS::Call(cx, thisValue, callable,
65097 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65098 aRv.NoteJSContextException(cx);
65099 return;
65100 }
65101}
65102
65103void
65104TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65105{
65106 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65107 if (aRv.Failed()) {
65108 return;
65109 }
65110 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65111 BindingCallContext& cx = s.GetCallContext();
65112
65113 JS::Rooted<JS::Value> rval(cx);
65114 JS::RootedVector<JS::Value> argv(cx);
65115 if (!argv.resize(1)) {
65116 // That threw an exception on the JSContext, and our CallSetup will do
65117 // the right thing with that.
65118 return;
65119 }
65120 unsigned argc = 1;
65121
65122 do {
65123 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65124 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65125 aRv.Throw(NS_ERROR_UNEXPECTED);
65126 return;
65127 }
65128 break;
65129 } while (false);
65130
65131 JS::Rooted<JS::Value> callable(cx);
65132 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65133 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65134 !InitIds(cx, atomsCache)) ||
65135 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue13_id, &callable)) {
65136 aRv.Throw(NS_ERROR_UNEXPECTED);
65137 return;
65138 }
65139 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65140 if (!JS::Call(cx, thisValue, callable,
65141 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65142 aRv.NoteJSContextException(cx);
65143 return;
65144 }
65145}
65146
65147void
65148TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65149{
65150 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65151 if (aRv.Failed()) {
65152 return;
65153 }
65154 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65154); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65154; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65155 BindingCallContext& cx = s.GetCallContext();
65156
65157 JS::Rooted<JS::Value> rval(cx);
65158 JS::RootedVector<JS::Value> argv(cx);
65159 if (!argv.resize(1)) {
65160 // That threw an exception on the JSContext, and our CallSetup will do
65161 // the right thing with that.
65162 return;
65163 }
65164 unsigned argc = 1;
65165
65166 do {
65167 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65168 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65169 aRv.Throw(NS_ERROR_UNEXPECTED);
65170 return;
65171 }
65172 break;
65173 } while (false);
65174
65175 JS::Rooted<JS::Value> callable(cx);
65176 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65177 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65178 !InitIds(cx, atomsCache)) ||
65179 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue14_id, &callable)) {
65180 aRv.Throw(NS_ERROR_UNEXPECTED);
65181 return;
65182 }
65183 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65184 if (!JS::Call(cx, thisValue, callable,
65185 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65186 aRv.NoteJSContextException(cx);
65187 return;
65188 }
65189}
65190
65191void
65192TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65193{
65194 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65195 if (aRv.Failed()) {
65196 return;
65197 }
65198 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65198); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65198; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65199 BindingCallContext& cx = s.GetCallContext();
65200
65201 JS::Rooted<JS::Value> rval(cx);
65202 JS::RootedVector<JS::Value> argv(cx);
65203 if (!argv.resize(1)) {
65204 // That threw an exception on the JSContext, and our CallSetup will do
65205 // the right thing with that.
65206 return;
65207 }
65208 unsigned argc = 1;
65209
65210 do {
65211 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65212 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65213 aRv.Throw(NS_ERROR_UNEXPECTED);
65214 return;
65215 }
65216 break;
65217 } while (false);
65218
65219 JS::Rooted<JS::Value> callable(cx);
65220 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65221 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65222 !InitIds(cx, atomsCache)) ||
65223 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue15_id, &callable)) {
65224 aRv.Throw(NS_ERROR_UNEXPECTED);
65225 return;
65226 }
65227 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65228 if (!JS::Call(cx, thisValue, callable,
65229 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65230 aRv.NoteJSContextException(cx);
65231 return;
65232 }
65233}
65234
65235void
65236TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65237{
65238 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65239 if (aRv.Failed()) {
65240 return;
65241 }
65242 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65242); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65242; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65243 BindingCallContext& cx = s.GetCallContext();
65244
65245 JS::Rooted<JS::Value> rval(cx);
65246 JS::RootedVector<JS::Value> argv(cx);
65247 if (!argv.resize(1)) {
65248 // That threw an exception on the JSContext, and our CallSetup will do
65249 // the right thing with that.
65250 return;
65251 }
65252 unsigned argc = 1;
65253
65254 do {
65255 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65256 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65257 aRv.Throw(NS_ERROR_UNEXPECTED);
65258 return;
65259 }
65260 break;
65261 } while (false);
65262
65263 JS::Rooted<JS::Value> callable(cx);
65264 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65265 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65266 !InitIds(cx, atomsCache)) ||
65267 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue16_id, &callable)) {
65268 aRv.Throw(NS_ERROR_UNEXPECTED);
65269 return;
65270 }
65271 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65272 if (!JS::Call(cx, thisValue, callable,
65273 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65274 aRv.NoteJSContextException(cx);
65275 return;
65276 }
65277}
65278
65279void
65280TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65281{
65282 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65283 if (aRv.Failed()) {
65284 return;
65285 }
65286 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65286); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65286; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65287 BindingCallContext& cx = s.GetCallContext();
65288
65289 JS::Rooted<JS::Value> rval(cx);
65290 JS::RootedVector<JS::Value> argv(cx);
65291 if (!argv.resize(1)) {
65292 // That threw an exception on the JSContext, and our CallSetup will do
65293 // the right thing with that.
65294 return;
65295 }
65296 unsigned argc = 1;
65297
65298 do {
65299 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65300 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65301 aRv.Throw(NS_ERROR_UNEXPECTED);
65302 return;
65303 }
65304 break;
65305 } while (false);
65306
65307 JS::Rooted<JS::Value> callable(cx);
65308 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65309 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65310 !InitIds(cx, atomsCache)) ||
65311 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue17_id, &callable)) {
65312 aRv.Throw(NS_ERROR_UNEXPECTED);
65313 return;
65314 }
65315 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65316 if (!JS::Call(cx, thisValue, callable,
65317 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65318 aRv.NoteJSContextException(cx);
65319 return;
65320 }
65321}
65322
65323void
65324TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65325{
65326 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65327 if (aRv.Failed()) {
65328 return;
65329 }
65330 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65330); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65330; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65331 BindingCallContext& cx = s.GetCallContext();
65332
65333 JS::Rooted<JS::Value> rval(cx);
65334 JS::RootedVector<JS::Value> argv(cx);
65335 if (!argv.resize(1)) {
65336 // That threw an exception on the JSContext, and our CallSetup will do
65337 // the right thing with that.
65338 return;
65339 }
65340 unsigned argc = 1;
65341
65342 do {
65343 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65344 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65345 aRv.Throw(NS_ERROR_UNEXPECTED);
65346 return;
65347 }
65348 break;
65349 } while (false);
65350
65351 JS::Rooted<JS::Value> callable(cx);
65352 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65353 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65354 !InitIds(cx, atomsCache)) ||
65355 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue18_id, &callable)) {
65356 aRv.Throw(NS_ERROR_UNEXPECTED);
65357 return;
65358 }
65359 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65360 if (!JS::Call(cx, thisValue, callable,
65361 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65362 aRv.NoteJSContextException(cx);
65363 return;
65364 }
65365}
65366
65367void
65368TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
65369{
65370 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65371 if (aRv.Failed()) {
65372 return;
65373 }
65374 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65374); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65374; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65375 BindingCallContext& cx = s.GetCallContext();
65376
65377 JS::Rooted<JS::Value> rval(cx);
65378 JS::RootedVector<JS::Value> argv(cx);
65379 if (!argv.resize(1)) {
65380 // That threw an exception on the JSContext, and our CallSetup will do
65381 // the right thing with that.
65382 return;
65383 }
65384 unsigned argc = 1;
65385
65386 do {
65387 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65388 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65389 aRv.Throw(NS_ERROR_UNEXPECTED);
65390 return;
65391 }
65392 break;
65393 } while (false);
65394
65395 JS::Rooted<JS::Value> callable(cx);
65396 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65397 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65398 !InitIds(cx, atomsCache)) ||
65399 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue19_id, &callable)) {
65400 aRv.Throw(NS_ERROR_UNEXPECTED);
65401 return;
65402 }
65403 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65404 if (!JS::Call(cx, thisValue, callable,
65405 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65406 aRv.NoteJSContextException(cx);
65407 return;
65408 }
65409}
65410
65411void
65412TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65413{
65414 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65415 if (aRv.Failed()) {
65416 return;
65417 }
65418 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65418; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65419 BindingCallContext& cx = s.GetCallContext();
65420
65421 JS::Rooted<JS::Value> rval(cx);
65422 JS::RootedVector<JS::Value> argv(cx);
65423 if (!argv.resize(1)) {
65424 // That threw an exception on the JSContext, and our CallSetup will do
65425 // the right thing with that.
65426 return;
65427 }
65428 unsigned argc = 1;
65429
65430 do {
65431 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65432 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65433 aRv.Throw(NS_ERROR_UNEXPECTED);
65434 return;
65435 }
65436 break;
65437 } while (false);
65438
65439 JS::Rooted<JS::Value> callable(cx);
65440 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65441 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65442 !InitIds(cx, atomsCache)) ||
65443 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue20_id, &callable)) {
65444 aRv.Throw(NS_ERROR_UNEXPECTED);
65445 return;
65446 }
65447 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65448 if (!JS::Call(cx, thisValue, callable,
65449 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65450 aRv.NoteJSContextException(cx);
65451 return;
65452 }
65453}
65454
65455void
65456TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65457{
65458 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65459 if (aRv.Failed()) {
65460 return;
65461 }
65462 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65462); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65462; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65463 BindingCallContext& cx = s.GetCallContext();
65464
65465 JS::Rooted<JS::Value> rval(cx);
65466 JS::RootedVector<JS::Value> argv(cx);
65467 if (!argv.resize(1)) {
65468 // That threw an exception on the JSContext, and our CallSetup will do
65469 // the right thing with that.
65470 return;
65471 }
65472 unsigned argc = 1;
65473
65474 do {
65475 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65476 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65477 aRv.Throw(NS_ERROR_UNEXPECTED);
65478 return;
65479 }
65480 break;
65481 } while (false);
65482
65483 JS::Rooted<JS::Value> callable(cx);
65484 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65485 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65486 !InitIds(cx, atomsCache)) ||
65487 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue21_id, &callable)) {
65488 aRv.Throw(NS_ERROR_UNEXPECTED);
65489 return;
65490 }
65491 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65492 if (!JS::Call(cx, thisValue, callable,
65493 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65494 aRv.NoteJSContextException(cx);
65495 return;
65496 }
65497}
65498
65499void
65500TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
65501{
65502 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65503 if (aRv.Failed()) {
65504 return;
65505 }
65506 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65506; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65507 BindingCallContext& cx = s.GetCallContext();
65508
65509 JS::Rooted<JS::Value> rval(cx);
65510 JS::RootedVector<JS::Value> argv(cx);
65511 if (!argv.resize(1)) {
65512 // That threw an exception on the JSContext, and our CallSetup will do
65513 // the right thing with that.
65514 return;
65515 }
65516 unsigned argc = 1;
65517
65518 do {
65519 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65520 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65521 aRv.Throw(NS_ERROR_UNEXPECTED);
65522 return;
65523 }
65524 break;
65525 } while (false);
65526
65527 JS::Rooted<JS::Value> callable(cx);
65528 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65529 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65530 !InitIds(cx, atomsCache)) ||
65531 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue22_id, &callable)) {
65532 aRv.Throw(NS_ERROR_UNEXPECTED);
65533 return;
65534 }
65535 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65536 if (!JS::Call(cx, thisValue, callable,
65537 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65538 aRv.NoteJSContextException(cx);
65539 return;
65540 }
65541}
65542
65543void
65544TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65545{
65546 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65547 if (aRv.Failed()) {
65548 return;
65549 }
65550 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65550); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65550; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65551 BindingCallContext& cx = s.GetCallContext();
65552
65553 JS::Rooted<JS::Value> rval(cx);
65554 JS::RootedVector<JS::Value> argv(cx);
65555 if (!argv.resize(1)) {
65556 // That threw an exception on the JSContext, and our CallSetup will do
65557 // the right thing with that.
65558 return;
65559 }
65560 unsigned argc = 1;
65561
65562 do {
65563 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65564 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65565 aRv.Throw(NS_ERROR_UNEXPECTED);
65566 return;
65567 }
65568 break;
65569 } while (false);
65570
65571 JS::Rooted<JS::Value> callable(cx);
65572 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65573 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65574 !InitIds(cx, atomsCache)) ||
65575 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue23_id, &callable)) {
65576 aRv.Throw(NS_ERROR_UNEXPECTED);
65577 return;
65578 }
65579 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65580 if (!JS::Call(cx, thisValue, callable,
65581 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65582 aRv.NoteJSContextException(cx);
65583 return;
65584 }
65585}
65586
65587void
65588TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65589{
65590 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65591 if (aRv.Failed()) {
65592 return;
65593 }
65594 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65594); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65594; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65595 BindingCallContext& cx = s.GetCallContext();
65596
65597 JS::Rooted<JS::Value> rval(cx);
65598 JS::RootedVector<JS::Value> argv(cx);
65599 if (!argv.resize(1)) {
65600 // That threw an exception on the JSContext, and our CallSetup will do
65601 // the right thing with that.
65602 return;
65603 }
65604 unsigned argc = 1;
65605
65606 do {
65607 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65608 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65609 aRv.Throw(NS_ERROR_UNEXPECTED);
65610 return;
65611 }
65612 break;
65613 } while (false);
65614
65615 JS::Rooted<JS::Value> callable(cx);
65616 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65617 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65618 !InitIds(cx, atomsCache)) ||
65619 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue24_id, &callable)) {
65620 aRv.Throw(NS_ERROR_UNEXPECTED);
65621 return;
65622 }
65623 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65624 if (!JS::Call(cx, thisValue, callable,
65625 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65626 aRv.NoteJSContextException(cx);
65627 return;
65628 }
65629}
65630
65631void
65632TestJSImplInterfaceJSImpl::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
65633{
65634 CallSetup s(this, aRv, "TestJSImplInterface.passUnionWithDefaultValue25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65635 if (aRv.Failed()) {
65636 return;
65637 }
65638 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65638); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65638; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65639 BindingCallContext& cx = s.GetCallContext();
65640
65641 JS::Rooted<JS::Value> rval(cx);
65642 JS::RootedVector<JS::Value> argv(cx);
65643 if (!argv.resize(1)) {
65644 // That threw an exception on the JSContext, and our CallSetup will do
65645 // the right thing with that.
65646 return;
65647 }
65648 unsigned argc = 1;
65649
65650 do {
65651 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65652 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
65653 aRv.Throw(NS_ERROR_UNEXPECTED);
65654 return;
65655 }
65656 break;
65657 } while (false);
65658
65659 JS::Rooted<JS::Value> callable(cx);
65660 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65661 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65662 !InitIds(cx, atomsCache)) ||
65663 !GetCallableProperty(cx, atomsCache->passUnionWithDefaultValue25_id, &callable)) {
65664 aRv.Throw(NS_ERROR_UNEXPECTED);
65665 return;
65666 }
65667 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65668 if (!JS::Call(cx, thisValue, callable,
65669 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65670 aRv.NoteJSContextException(cx);
65671 return;
65672 }
65673}
65674
65675void
65676TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65677{
65678 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65679 if (aRv.Failed()) {
65680 return;
65681 }
65682 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65682); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65682; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65683 BindingCallContext& cx = s.GetCallContext();
65684
65685 JS::Rooted<JS::Value> rval(cx);
65686 JS::RootedVector<JS::Value> argv(cx);
65687 if (!argv.resize(1)) {
65688 // That threw an exception on the JSContext, and our CallSetup will do
65689 // the right thing with that.
65690 return;
65691 }
65692 unsigned argc = 1;
65693
65694 do {
65695 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65696 if (arg.IsNull()) {
65697 argv[0].setNull();
65698 break;
65699 }
65700 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65701 aRv.Throw(NS_ERROR_UNEXPECTED);
65702 return;
65703 }
65704 break;
65705 } while (false);
65706
65707 JS::Rooted<JS::Value> callable(cx);
65708 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65709 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65710 !InitIds(cx, atomsCache)) ||
65711 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue1_id, &callable)) {
65712 aRv.Throw(NS_ERROR_UNEXPECTED);
65713 return;
65714 }
65715 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65716 if (!JS::Call(cx, thisValue, callable,
65717 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65718 aRv.NoteJSContextException(cx);
65719 return;
65720 }
65721}
65722
65723void
65724TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65725{
65726 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65727 if (aRv.Failed()) {
65728 return;
65729 }
65730 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65730); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65730; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65731 BindingCallContext& cx = s.GetCallContext();
65732
65733 JS::Rooted<JS::Value> rval(cx);
65734 JS::RootedVector<JS::Value> argv(cx);
65735 if (!argv.resize(1)) {
65736 // That threw an exception on the JSContext, and our CallSetup will do
65737 // the right thing with that.
65738 return;
65739 }
65740 unsigned argc = 1;
65741
65742 do {
65743 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65744 if (arg.IsNull()) {
65745 argv[0].setNull();
65746 break;
65747 }
65748 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65749 aRv.Throw(NS_ERROR_UNEXPECTED);
65750 return;
65751 }
65752 break;
65753 } while (false);
65754
65755 JS::Rooted<JS::Value> callable(cx);
65756 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65757 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65758 !InitIds(cx, atomsCache)) ||
65759 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue2_id, &callable)) {
65760 aRv.Throw(NS_ERROR_UNEXPECTED);
65761 return;
65762 }
65763 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65764 if (!JS::Call(cx, thisValue, callable,
65765 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65766 aRv.NoteJSContextException(cx);
65767 return;
65768 }
65769}
65770
65771void
65772TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65773{
65774 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65775 if (aRv.Failed()) {
65776 return;
65777 }
65778 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65778); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65778; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65779 BindingCallContext& cx = s.GetCallContext();
65780
65781 JS::Rooted<JS::Value> rval(cx);
65782 JS::RootedVector<JS::Value> argv(cx);
65783 if (!argv.resize(1)) {
65784 // That threw an exception on the JSContext, and our CallSetup will do
65785 // the right thing with that.
65786 return;
65787 }
65788 unsigned argc = 1;
65789
65790 do {
65791 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65792 if (arg.IsNull()) {
65793 argv[0].setNull();
65794 break;
65795 }
65796 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65797 aRv.Throw(NS_ERROR_UNEXPECTED);
65798 return;
65799 }
65800 break;
65801 } while (false);
65802
65803 JS::Rooted<JS::Value> callable(cx);
65804 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65805 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65806 !InitIds(cx, atomsCache)) ||
65807 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue3_id, &callable)) {
65808 aRv.Throw(NS_ERROR_UNEXPECTED);
65809 return;
65810 }
65811 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65812 if (!JS::Call(cx, thisValue, callable,
65813 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65814 aRv.NoteJSContextException(cx);
65815 return;
65816 }
65817}
65818
65819void
65820TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65821{
65822 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65823 if (aRv.Failed()) {
65824 return;
65825 }
65826 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65826; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65827 BindingCallContext& cx = s.GetCallContext();
65828
65829 JS::Rooted<JS::Value> rval(cx);
65830 JS::RootedVector<JS::Value> argv(cx);
65831 if (!argv.resize(1)) {
65832 // That threw an exception on the JSContext, and our CallSetup will do
65833 // the right thing with that.
65834 return;
65835 }
65836 unsigned argc = 1;
65837
65838 do {
65839 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65840 if (arg.IsNull()) {
65841 argv[0].setNull();
65842 break;
65843 }
65844 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65845 aRv.Throw(NS_ERROR_UNEXPECTED);
65846 return;
65847 }
65848 break;
65849 } while (false);
65850
65851 JS::Rooted<JS::Value> callable(cx);
65852 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65853 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65854 !InitIds(cx, atomsCache)) ||
65855 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue4_id, &callable)) {
65856 aRv.Throw(NS_ERROR_UNEXPECTED);
65857 return;
65858 }
65859 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65860 if (!JS::Call(cx, thisValue, callable,
65861 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65862 aRv.NoteJSContextException(cx);
65863 return;
65864 }
65865}
65866
65867void
65868TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65869{
65870 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65871 if (aRv.Failed()) {
65872 return;
65873 }
65874 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65874); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65874; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65875 BindingCallContext& cx = s.GetCallContext();
65876
65877 JS::Rooted<JS::Value> rval(cx);
65878 JS::RootedVector<JS::Value> argv(cx);
65879 if (!argv.resize(1)) {
65880 // That threw an exception on the JSContext, and our CallSetup will do
65881 // the right thing with that.
65882 return;
65883 }
65884 unsigned argc = 1;
65885
65886 do {
65887 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65888 if (arg.IsNull()) {
65889 argv[0].setNull();
65890 break;
65891 }
65892 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65893 aRv.Throw(NS_ERROR_UNEXPECTED);
65894 return;
65895 }
65896 break;
65897 } while (false);
65898
65899 JS::Rooted<JS::Value> callable(cx);
65900 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65901 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65902 !InitIds(cx, atomsCache)) ||
65903 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue5_id, &callable)) {
65904 aRv.Throw(NS_ERROR_UNEXPECTED);
65905 return;
65906 }
65907 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65908 if (!JS::Call(cx, thisValue, callable,
65909 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65910 aRv.NoteJSContextException(cx);
65911 return;
65912 }
65913}
65914
65915void
65916TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65917{
65918 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65919 if (aRv.Failed()) {
65920 return;
65921 }
65922 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65922; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65923 BindingCallContext& cx = s.GetCallContext();
65924
65925 JS::Rooted<JS::Value> rval(cx);
65926 JS::RootedVector<JS::Value> argv(cx);
65927 if (!argv.resize(1)) {
65928 // That threw an exception on the JSContext, and our CallSetup will do
65929 // the right thing with that.
65930 return;
65931 }
65932 unsigned argc = 1;
65933
65934 do {
65935 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65936 if (arg.IsNull()) {
65937 argv[0].setNull();
65938 break;
65939 }
65940 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65941 aRv.Throw(NS_ERROR_UNEXPECTED);
65942 return;
65943 }
65944 break;
65945 } while (false);
65946
65947 JS::Rooted<JS::Value> callable(cx);
65948 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65949 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65950 !InitIds(cx, atomsCache)) ||
65951 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue6_id, &callable)) {
65952 aRv.Throw(NS_ERROR_UNEXPECTED);
65953 return;
65954 }
65955 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
65956 if (!JS::Call(cx, thisValue, callable,
65957 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
65958 aRv.NoteJSContextException(cx);
65959 return;
65960 }
65961}
65962
65963void
65964TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
65965{
65966 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
65967 if (aRv.Failed()) {
65968 return;
65969 }
65970 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 65970); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 65970; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
65971 BindingCallContext& cx = s.GetCallContext();
65972
65973 JS::Rooted<JS::Value> rval(cx);
65974 JS::RootedVector<JS::Value> argv(cx);
65975 if (!argv.resize(1)) {
65976 // That threw an exception on the JSContext, and our CallSetup will do
65977 // the right thing with that.
65978 return;
65979 }
65980 unsigned argc = 1;
65981
65982 do {
65983 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
65984 if (arg.IsNull()) {
65985 argv[0].setNull();
65986 break;
65987 }
65988 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
65989 aRv.Throw(NS_ERROR_UNEXPECTED);
65990 return;
65991 }
65992 break;
65993 } while (false);
65994
65995 JS::Rooted<JS::Value> callable(cx);
65996 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
65997 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
65998 !InitIds(cx, atomsCache)) ||
65999 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue7_id, &callable)) {
66000 aRv.Throw(NS_ERROR_UNEXPECTED);
66001 return;
66002 }
66003 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66004 if (!JS::Call(cx, thisValue, callable,
66005 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66006 aRv.NoteJSContextException(cx);
66007 return;
66008 }
66009}
66010
66011void
66012TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66013{
66014 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66015 if (aRv.Failed()) {
66016 return;
66017 }
66018 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66018); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66018; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66019 BindingCallContext& cx = s.GetCallContext();
66020
66021 JS::Rooted<JS::Value> rval(cx);
66022 JS::RootedVector<JS::Value> argv(cx);
66023 if (!argv.resize(1)) {
66024 // That threw an exception on the JSContext, and our CallSetup will do
66025 // the right thing with that.
66026 return;
66027 }
66028 unsigned argc = 1;
66029
66030 do {
66031 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66032 if (arg.IsNull()) {
66033 argv[0].setNull();
66034 break;
66035 }
66036 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66037 aRv.Throw(NS_ERROR_UNEXPECTED);
66038 return;
66039 }
66040 break;
66041 } while (false);
66042
66043 JS::Rooted<JS::Value> callable(cx);
66044 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66045 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66046 !InitIds(cx, atomsCache)) ||
66047 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue8_id, &callable)) {
66048 aRv.Throw(NS_ERROR_UNEXPECTED);
66049 return;
66050 }
66051 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66052 if (!JS::Call(cx, thisValue, callable,
66053 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66054 aRv.NoteJSContextException(cx);
66055 return;
66056 }
66057}
66058
66059void
66060TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66061{
66062 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66063 if (aRv.Failed()) {
66064 return;
66065 }
66066 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66066); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66066; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66067 BindingCallContext& cx = s.GetCallContext();
66068
66069 JS::Rooted<JS::Value> rval(cx);
66070 JS::RootedVector<JS::Value> argv(cx);
66071 if (!argv.resize(1)) {
66072 // That threw an exception on the JSContext, and our CallSetup will do
66073 // the right thing with that.
66074 return;
66075 }
66076 unsigned argc = 1;
66077
66078 do {
66079 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66080 if (arg.IsNull()) {
66081 argv[0].setNull();
66082 break;
66083 }
66084 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66085 aRv.Throw(NS_ERROR_UNEXPECTED);
66086 return;
66087 }
66088 break;
66089 } while (false);
66090
66091 JS::Rooted<JS::Value> callable(cx);
66092 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66093 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66094 !InitIds(cx, atomsCache)) ||
66095 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue9_id, &callable)) {
66096 aRv.Throw(NS_ERROR_UNEXPECTED);
66097 return;
66098 }
66099 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66100 if (!JS::Call(cx, thisValue, callable,
66101 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66102 aRv.NoteJSContextException(cx);
66103 return;
66104 }
66105}
66106
66107void
66108TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66109{
66110 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66111 if (aRv.Failed()) {
66112 return;
66113 }
66114 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66114); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66114; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66115 BindingCallContext& cx = s.GetCallContext();
66116
66117 JS::Rooted<JS::Value> rval(cx);
66118 JS::RootedVector<JS::Value> argv(cx);
66119 if (!argv.resize(1)) {
66120 // That threw an exception on the JSContext, and our CallSetup will do
66121 // the right thing with that.
66122 return;
66123 }
66124 unsigned argc = 1;
66125
66126 do {
66127 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66128 if (arg.IsNull()) {
66129 argv[0].setNull();
66130 break;
66131 }
66132 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66133 aRv.Throw(NS_ERROR_UNEXPECTED);
66134 return;
66135 }
66136 break;
66137 } while (false);
66138
66139 JS::Rooted<JS::Value> callable(cx);
66140 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66141 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66142 !InitIds(cx, atomsCache)) ||
66143 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue10_id, &callable)) {
66144 aRv.Throw(NS_ERROR_UNEXPECTED);
66145 return;
66146 }
66147 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66148 if (!JS::Call(cx, thisValue, callable,
66149 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66150 aRv.NoteJSContextException(cx);
66151 return;
66152 }
66153}
66154
66155void
66156TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66157{
66158 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66159 if (aRv.Failed()) {
66160 return;
66161 }
66162 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66162); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66162; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66163 BindingCallContext& cx = s.GetCallContext();
66164
66165 JS::Rooted<JS::Value> rval(cx);
66166 JS::RootedVector<JS::Value> argv(cx);
66167 if (!argv.resize(1)) {
66168 // That threw an exception on the JSContext, and our CallSetup will do
66169 // the right thing with that.
66170 return;
66171 }
66172 unsigned argc = 1;
66173
66174 do {
66175 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66176 if (arg.IsNull()) {
66177 argv[0].setNull();
66178 break;
66179 }
66180 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66181 aRv.Throw(NS_ERROR_UNEXPECTED);
66182 return;
66183 }
66184 break;
66185 } while (false);
66186
66187 JS::Rooted<JS::Value> callable(cx);
66188 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66189 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66190 !InitIds(cx, atomsCache)) ||
66191 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue11_id, &callable)) {
66192 aRv.Throw(NS_ERROR_UNEXPECTED);
66193 return;
66194 }
66195 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66196 if (!JS::Call(cx, thisValue, callable,
66197 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66198 aRv.NoteJSContextException(cx);
66199 return;
66200 }
66201}
66202
66203void
66204TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66205{
66206 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66207 if (aRv.Failed()) {
66208 return;
66209 }
66210 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66210); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66210; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66211 BindingCallContext& cx = s.GetCallContext();
66212
66213 JS::Rooted<JS::Value> rval(cx);
66214 JS::RootedVector<JS::Value> argv(cx);
66215 if (!argv.resize(1)) {
66216 // That threw an exception on the JSContext, and our CallSetup will do
66217 // the right thing with that.
66218 return;
66219 }
66220 unsigned argc = 1;
66221
66222 do {
66223 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66224 if (arg.IsNull()) {
66225 argv[0].setNull();
66226 break;
66227 }
66228 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66229 aRv.Throw(NS_ERROR_UNEXPECTED);
66230 return;
66231 }
66232 break;
66233 } while (false);
66234
66235 JS::Rooted<JS::Value> callable(cx);
66236 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66237 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66238 !InitIds(cx, atomsCache)) ||
66239 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue12_id, &callable)) {
66240 aRv.Throw(NS_ERROR_UNEXPECTED);
66241 return;
66242 }
66243 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66244 if (!JS::Call(cx, thisValue, callable,
66245 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66246 aRv.NoteJSContextException(cx);
66247 return;
66248 }
66249}
66250
66251void
66252TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66253{
66254 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66255 if (aRv.Failed()) {
66256 return;
66257 }
66258 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66258); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66258; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66259 BindingCallContext& cx = s.GetCallContext();
66260
66261 JS::Rooted<JS::Value> rval(cx);
66262 JS::RootedVector<JS::Value> argv(cx);
66263 if (!argv.resize(1)) {
66264 // That threw an exception on the JSContext, and our CallSetup will do
66265 // the right thing with that.
66266 return;
66267 }
66268 unsigned argc = 1;
66269
66270 do {
66271 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66272 if (arg.IsNull()) {
66273 argv[0].setNull();
66274 break;
66275 }
66276 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66277 aRv.Throw(NS_ERROR_UNEXPECTED);
66278 return;
66279 }
66280 break;
66281 } while (false);
66282
66283 JS::Rooted<JS::Value> callable(cx);
66284 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66285 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66286 !InitIds(cx, atomsCache)) ||
66287 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue13_id, &callable)) {
66288 aRv.Throw(NS_ERROR_UNEXPECTED);
66289 return;
66290 }
66291 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66292 if (!JS::Call(cx, thisValue, callable,
66293 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66294 aRv.NoteJSContextException(cx);
66295 return;
66296 }
66297}
66298
66299void
66300TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66301{
66302 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66303 if (aRv.Failed()) {
66304 return;
66305 }
66306 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66306); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66306; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66307 BindingCallContext& cx = s.GetCallContext();
66308
66309 JS::Rooted<JS::Value> rval(cx);
66310 JS::RootedVector<JS::Value> argv(cx);
66311 if (!argv.resize(1)) {
66312 // That threw an exception on the JSContext, and our CallSetup will do
66313 // the right thing with that.
66314 return;
66315 }
66316 unsigned argc = 1;
66317
66318 do {
66319 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66320 if (arg.IsNull()) {
66321 argv[0].setNull();
66322 break;
66323 }
66324 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66325 aRv.Throw(NS_ERROR_UNEXPECTED);
66326 return;
66327 }
66328 break;
66329 } while (false);
66330
66331 JS::Rooted<JS::Value> callable(cx);
66332 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66333 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66334 !InitIds(cx, atomsCache)) ||
66335 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue14_id, &callable)) {
66336 aRv.Throw(NS_ERROR_UNEXPECTED);
66337 return;
66338 }
66339 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66340 if (!JS::Call(cx, thisValue, callable,
66341 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66342 aRv.NoteJSContextException(cx);
66343 return;
66344 }
66345}
66346
66347void
66348TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66349{
66350 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66351 if (aRv.Failed()) {
66352 return;
66353 }
66354 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66354); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66354; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66355 BindingCallContext& cx = s.GetCallContext();
66356
66357 JS::Rooted<JS::Value> rval(cx);
66358 JS::RootedVector<JS::Value> argv(cx);
66359 if (!argv.resize(1)) {
66360 // That threw an exception on the JSContext, and our CallSetup will do
66361 // the right thing with that.
66362 return;
66363 }
66364 unsigned argc = 1;
66365
66366 do {
66367 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66368 if (arg.IsNull()) {
66369 argv[0].setNull();
66370 break;
66371 }
66372 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66373 aRv.Throw(NS_ERROR_UNEXPECTED);
66374 return;
66375 }
66376 break;
66377 } while (false);
66378
66379 JS::Rooted<JS::Value> callable(cx);
66380 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66381 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66382 !InitIds(cx, atomsCache)) ||
66383 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue15_id, &callable)) {
66384 aRv.Throw(NS_ERROR_UNEXPECTED);
66385 return;
66386 }
66387 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66388 if (!JS::Call(cx, thisValue, callable,
66389 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66390 aRv.NoteJSContextException(cx);
66391 return;
66392 }
66393}
66394
66395void
66396TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66397{
66398 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66399 if (aRv.Failed()) {
66400 return;
66401 }
66402 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66402); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66402; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66403 BindingCallContext& cx = s.GetCallContext();
66404
66405 JS::Rooted<JS::Value> rval(cx);
66406 JS::RootedVector<JS::Value> argv(cx);
66407 if (!argv.resize(1)) {
66408 // That threw an exception on the JSContext, and our CallSetup will do
66409 // the right thing with that.
66410 return;
66411 }
66412 unsigned argc = 1;
66413
66414 do {
66415 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66416 if (arg.IsNull()) {
66417 argv[0].setNull();
66418 break;
66419 }
66420 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66421 aRv.Throw(NS_ERROR_UNEXPECTED);
66422 return;
66423 }
66424 break;
66425 } while (false);
66426
66427 JS::Rooted<JS::Value> callable(cx);
66428 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66429 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66430 !InitIds(cx, atomsCache)) ||
66431 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue16_id, &callable)) {
66432 aRv.Throw(NS_ERROR_UNEXPECTED);
66433 return;
66434 }
66435 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66436 if (!JS::Call(cx, thisValue, callable,
66437 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66438 aRv.NoteJSContextException(cx);
66439 return;
66440 }
66441}
66442
66443void
66444TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66445{
66446 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66447 if (aRv.Failed()) {
66448 return;
66449 }
66450 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66450; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66451 BindingCallContext& cx = s.GetCallContext();
66452
66453 JS::Rooted<JS::Value> rval(cx);
66454 JS::RootedVector<JS::Value> argv(cx);
66455 if (!argv.resize(1)) {
66456 // That threw an exception on the JSContext, and our CallSetup will do
66457 // the right thing with that.
66458 return;
66459 }
66460 unsigned argc = 1;
66461
66462 do {
66463 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66464 if (arg.IsNull()) {
66465 argv[0].setNull();
66466 break;
66467 }
66468 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66469 aRv.Throw(NS_ERROR_UNEXPECTED);
66470 return;
66471 }
66472 break;
66473 } while (false);
66474
66475 JS::Rooted<JS::Value> callable(cx);
66476 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66477 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66478 !InitIds(cx, atomsCache)) ||
66479 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue17_id, &callable)) {
66480 aRv.Throw(NS_ERROR_UNEXPECTED);
66481 return;
66482 }
66483 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66484 if (!JS::Call(cx, thisValue, callable,
66485 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66486 aRv.NoteJSContextException(cx);
66487 return;
66488 }
66489}
66490
66491void
66492TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66493{
66494 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66495 if (aRv.Failed()) {
66496 return;
66497 }
66498 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66498); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66498; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66499 BindingCallContext& cx = s.GetCallContext();
66500
66501 JS::Rooted<JS::Value> rval(cx);
66502 JS::RootedVector<JS::Value> argv(cx);
66503 if (!argv.resize(1)) {
66504 // That threw an exception on the JSContext, and our CallSetup will do
66505 // the right thing with that.
66506 return;
66507 }
66508 unsigned argc = 1;
66509
66510 do {
66511 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66512 if (arg.IsNull()) {
66513 argv[0].setNull();
66514 break;
66515 }
66516 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66517 aRv.Throw(NS_ERROR_UNEXPECTED);
66518 return;
66519 }
66520 break;
66521 } while (false);
66522
66523 JS::Rooted<JS::Value> callable(cx);
66524 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66525 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66526 !InitIds(cx, atomsCache)) ||
66527 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue18_id, &callable)) {
66528 aRv.Throw(NS_ERROR_UNEXPECTED);
66529 return;
66530 }
66531 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66532 if (!JS::Call(cx, thisValue, callable,
66533 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66534 aRv.NoteJSContextException(cx);
66535 return;
66536 }
66537}
66538
66539void
66540TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66541{
66542 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66543 if (aRv.Failed()) {
66544 return;
66545 }
66546 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66546); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66546; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66547 BindingCallContext& cx = s.GetCallContext();
66548
66549 JS::Rooted<JS::Value> rval(cx);
66550 JS::RootedVector<JS::Value> argv(cx);
66551 if (!argv.resize(1)) {
66552 // That threw an exception on the JSContext, and our CallSetup will do
66553 // the right thing with that.
66554 return;
66555 }
66556 unsigned argc = 1;
66557
66558 do {
66559 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66560 if (arg.IsNull()) {
66561 argv[0].setNull();
66562 break;
66563 }
66564 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66565 aRv.Throw(NS_ERROR_UNEXPECTED);
66566 return;
66567 }
66568 break;
66569 } while (false);
66570
66571 JS::Rooted<JS::Value> callable(cx);
66572 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66573 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66574 !InitIds(cx, atomsCache)) ||
66575 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue19_id, &callable)) {
66576 aRv.Throw(NS_ERROR_UNEXPECTED);
66577 return;
66578 }
66579 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66580 if (!JS::Call(cx, thisValue, callable,
66581 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66582 aRv.NoteJSContextException(cx);
66583 return;
66584 }
66585}
66586
66587void
66588TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66589{
66590 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66591 if (aRv.Failed()) {
66592 return;
66593 }
66594 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66594); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66594; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66595 BindingCallContext& cx = s.GetCallContext();
66596
66597 JS::Rooted<JS::Value> rval(cx);
66598 JS::RootedVector<JS::Value> argv(cx);
66599 if (!argv.resize(1)) {
66600 // That threw an exception on the JSContext, and our CallSetup will do
66601 // the right thing with that.
66602 return;
66603 }
66604 unsigned argc = 1;
66605
66606 do {
66607 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66608 if (arg.IsNull()) {
66609 argv[0].setNull();
66610 break;
66611 }
66612 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66613 aRv.Throw(NS_ERROR_UNEXPECTED);
66614 return;
66615 }
66616 break;
66617 } while (false);
66618
66619 JS::Rooted<JS::Value> callable(cx);
66620 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66621 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66622 !InitIds(cx, atomsCache)) ||
66623 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue20_id, &callable)) {
66624 aRv.Throw(NS_ERROR_UNEXPECTED);
66625 return;
66626 }
66627 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66628 if (!JS::Call(cx, thisValue, callable,
66629 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66630 aRv.NoteJSContextException(cx);
66631 return;
66632 }
66633}
66634
66635void
66636TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66637{
66638 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue21", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66639 if (aRv.Failed()) {
66640 return;
66641 }
66642 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66642); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66642; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66643 BindingCallContext& cx = s.GetCallContext();
66644
66645 JS::Rooted<JS::Value> rval(cx);
66646 JS::RootedVector<JS::Value> argv(cx);
66647 if (!argv.resize(1)) {
66648 // That threw an exception on the JSContext, and our CallSetup will do
66649 // the right thing with that.
66650 return;
66651 }
66652 unsigned argc = 1;
66653
66654 do {
66655 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66656 if (arg.IsNull()) {
66657 argv[0].setNull();
66658 break;
66659 }
66660 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66661 aRv.Throw(NS_ERROR_UNEXPECTED);
66662 return;
66663 }
66664 break;
66665 } while (false);
66666
66667 JS::Rooted<JS::Value> callable(cx);
66668 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66669 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66670 !InitIds(cx, atomsCache)) ||
66671 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue21_id, &callable)) {
66672 aRv.Throw(NS_ERROR_UNEXPECTED);
66673 return;
66674 }
66675 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66676 if (!JS::Call(cx, thisValue, callable,
66677 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66678 aRv.NoteJSContextException(cx);
66679 return;
66680 }
66681}
66682
66683void
66684TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66685{
66686 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue22", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66687 if (aRv.Failed()) {
66688 return;
66689 }
66690 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66690); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66690; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66691 BindingCallContext& cx = s.GetCallContext();
66692
66693 JS::Rooted<JS::Value> rval(cx);
66694 JS::RootedVector<JS::Value> argv(cx);
66695 if (!argv.resize(1)) {
66696 // That threw an exception on the JSContext, and our CallSetup will do
66697 // the right thing with that.
66698 return;
66699 }
66700 unsigned argc = 1;
66701
66702 do {
66703 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66704 if (arg.IsNull()) {
66705 argv[0].setNull();
66706 break;
66707 }
66708 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66709 aRv.Throw(NS_ERROR_UNEXPECTED);
66710 return;
66711 }
66712 break;
66713 } while (false);
66714
66715 JS::Rooted<JS::Value> callable(cx);
66716 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66717 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66718 !InitIds(cx, atomsCache)) ||
66719 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue22_id, &callable)) {
66720 aRv.Throw(NS_ERROR_UNEXPECTED);
66721 return;
66722 }
66723 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66724 if (!JS::Call(cx, thisValue, callable,
66725 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66726 aRv.NoteJSContextException(cx);
66727 return;
66728 }
66729}
66730
66731void
66732TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66733{
66734 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue23", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66735 if (aRv.Failed()) {
66736 return;
66737 }
66738 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66738); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66738; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66739 BindingCallContext& cx = s.GetCallContext();
66740
66741 JS::Rooted<JS::Value> rval(cx);
66742 JS::RootedVector<JS::Value> argv(cx);
66743 if (!argv.resize(1)) {
66744 // That threw an exception on the JSContext, and our CallSetup will do
66745 // the right thing with that.
66746 return;
66747 }
66748 unsigned argc = 1;
66749
66750 do {
66751 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66752 if (arg.IsNull()) {
66753 argv[0].setNull();
66754 break;
66755 }
66756 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66757 aRv.Throw(NS_ERROR_UNEXPECTED);
66758 return;
66759 }
66760 break;
66761 } while (false);
66762
66763 JS::Rooted<JS::Value> callable(cx);
66764 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66765 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66766 !InitIds(cx, atomsCache)) ||
66767 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue23_id, &callable)) {
66768 aRv.Throw(NS_ERROR_UNEXPECTED);
66769 return;
66770 }
66771 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66772 if (!JS::Call(cx, thisValue, callable,
66773 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66774 aRv.NoteJSContextException(cx);
66775 return;
66776 }
66777}
66778
66779void
66780TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66781{
66782 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue24", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66783 if (aRv.Failed()) {
66784 return;
66785 }
66786 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66786); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66786; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66787 BindingCallContext& cx = s.GetCallContext();
66788
66789 JS::Rooted<JS::Value> rval(cx);
66790 JS::RootedVector<JS::Value> argv(cx);
66791 if (!argv.resize(1)) {
66792 // That threw an exception on the JSContext, and our CallSetup will do
66793 // the right thing with that.
66794 return;
66795 }
66796 unsigned argc = 1;
66797
66798 do {
66799 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66800 if (arg.IsNull()) {
66801 argv[0].setNull();
66802 break;
66803 }
66804 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66805 aRv.Throw(NS_ERROR_UNEXPECTED);
66806 return;
66807 }
66808 break;
66809 } while (false);
66810
66811 JS::Rooted<JS::Value> callable(cx);
66812 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66813 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66814 !InitIds(cx, atomsCache)) ||
66815 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue24_id, &callable)) {
66816 aRv.Throw(NS_ERROR_UNEXPECTED);
66817 return;
66818 }
66819 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66820 if (!JS::Call(cx, thisValue, callable,
66821 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66822 aRv.NoteJSContextException(cx);
66823 return;
66824 }
66825}
66826
66827void
66828TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66829{
66830 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue25", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66831 if (aRv.Failed()) {
66832 return;
66833 }
66834 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66834; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66835 BindingCallContext& cx = s.GetCallContext();
66836
66837 JS::Rooted<JS::Value> rval(cx);
66838 JS::RootedVector<JS::Value> argv(cx);
66839 if (!argv.resize(1)) {
66840 // That threw an exception on the JSContext, and our CallSetup will do
66841 // the right thing with that.
66842 return;
66843 }
66844 unsigned argc = 1;
66845
66846 do {
66847 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66848 if (arg.IsNull()) {
66849 argv[0].setNull();
66850 break;
66851 }
66852 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66853 aRv.Throw(NS_ERROR_UNEXPECTED);
66854 return;
66855 }
66856 break;
66857 } while (false);
66858
66859 JS::Rooted<JS::Value> callable(cx);
66860 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66861 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66862 !InitIds(cx, atomsCache)) ||
66863 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue25_id, &callable)) {
66864 aRv.Throw(NS_ERROR_UNEXPECTED);
66865 return;
66866 }
66867 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66868 if (!JS::Call(cx, thisValue, callable,
66869 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66870 aRv.NoteJSContextException(cx);
66871 return;
66872 }
66873}
66874
66875void
66876TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66877{
66878 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue26", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66879 if (aRv.Failed()) {
66880 return;
66881 }
66882 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66882); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66882; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66883 BindingCallContext& cx = s.GetCallContext();
66884
66885 JS::Rooted<JS::Value> rval(cx);
66886 JS::RootedVector<JS::Value> argv(cx);
66887 if (!argv.resize(1)) {
66888 // That threw an exception on the JSContext, and our CallSetup will do
66889 // the right thing with that.
66890 return;
66891 }
66892 unsigned argc = 1;
66893
66894 do {
66895 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66896 if (arg.IsNull()) {
66897 argv[0].setNull();
66898 break;
66899 }
66900 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66901 aRv.Throw(NS_ERROR_UNEXPECTED);
66902 return;
66903 }
66904 break;
66905 } while (false);
66906
66907 JS::Rooted<JS::Value> callable(cx);
66908 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66909 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66910 !InitIds(cx, atomsCache)) ||
66911 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue26_id, &callable)) {
66912 aRv.Throw(NS_ERROR_UNEXPECTED);
66913 return;
66914 }
66915 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66916 if (!JS::Call(cx, thisValue, callable,
66917 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66918 aRv.NoteJSContextException(cx);
66919 return;
66920 }
66921}
66922
66923void
66924TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66925{
66926 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue27", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66927 if (aRv.Failed()) {
66928 return;
66929 }
66930 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66930); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66930; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66931 BindingCallContext& cx = s.GetCallContext();
66932
66933 JS::Rooted<JS::Value> rval(cx);
66934 JS::RootedVector<JS::Value> argv(cx);
66935 if (!argv.resize(1)) {
66936 // That threw an exception on the JSContext, and our CallSetup will do
66937 // the right thing with that.
66938 return;
66939 }
66940 unsigned argc = 1;
66941
66942 do {
66943 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66944 if (arg.IsNull()) {
66945 argv[0].setNull();
66946 break;
66947 }
66948 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66949 aRv.Throw(NS_ERROR_UNEXPECTED);
66950 return;
66951 }
66952 break;
66953 } while (false);
66954
66955 JS::Rooted<JS::Value> callable(cx);
66956 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
66957 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
66958 !InitIds(cx, atomsCache)) ||
66959 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue27_id, &callable)) {
66960 aRv.Throw(NS_ERROR_UNEXPECTED);
66961 return;
66962 }
66963 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
66964 if (!JS::Call(cx, thisValue, callable,
66965 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
66966 aRv.NoteJSContextException(cx);
66967 return;
66968 }
66969}
66970
66971void
66972TestJSImplInterfaceJSImpl::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
66973{
66974 CallSetup s(this, aRv, "TestJSImplInterface.passNullableUnionWithDefaultValue28", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
66975 if (aRv.Failed()) {
66976 return;
66977 }
66978 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 66978); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 66978; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
66979 BindingCallContext& cx = s.GetCallContext();
66980
66981 JS::Rooted<JS::Value> rval(cx);
66982 JS::RootedVector<JS::Value> argv(cx);
66983 if (!argv.resize(1)) {
66984 // That threw an exception on the JSContext, and our CallSetup will do
66985 // the right thing with that.
66986 return;
66987 }
66988 unsigned argc = 1;
66989
66990 do {
66991 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
66992 if (arg.IsNull()) {
66993 argv[0].setNull();
66994 break;
66995 }
66996 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
66997 aRv.Throw(NS_ERROR_UNEXPECTED);
66998 return;
66999 }
67000 break;
67001 } while (false);
67002
67003 JS::Rooted<JS::Value> callable(cx);
67004 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67005 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67006 !InitIds(cx, atomsCache)) ||
67007 !GetCallableProperty(cx, atomsCache->passNullableUnionWithDefaultValue28_id, &callable)) {
67008 aRv.Throw(NS_ERROR_UNEXPECTED);
67009 return;
67010 }
67011 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67012 if (!JS::Call(cx, thisValue, callable,
67013 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67014 aRv.NoteJSContextException(cx);
67015 return;
67016 }
67017}
67018
67019void
67020TestJSImplInterfaceJSImpl::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67021{
67022 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67023 if (aRv.Failed()) {
67024 return;
67025 }
67026 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67026; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67027 BindingCallContext& cx = s.GetCallContext();
67028
67029 JS::Rooted<JS::Value> rval(cx);
67030 JS::RootedVector<JS::Value> argv(cx);
67031 if (!argv.resize(1)) {
67032 // That threw an exception on the JSContext, and our CallSetup will do
67033 // the right thing with that.
67034 return;
67035 }
67036 unsigned argc = 1;
67037
67038 do {
67039
67040 uint32_t length = arg.Length();
67041 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67042 if (!returnArray) {
67043 aRv.Throw(NS_ERROR_UNEXPECTED);
67044 return;
67045 }
67046 // Scope for 'tmp'
67047 {
67048 JS::Rooted<JS::Value> tmp(cx);
67049 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67050 // Control block to let us common up the JS_DefineElement calls when there
67051 // are different ways to succeed at wrapping the object.
67052 do {
67053 if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) {
67054 aRv.Throw(NS_ERROR_UNEXPECTED);
67055 return;
67056 }
67057 break;
67058 } while (false);
67059 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67060 JSPROP_ENUMERATE)) {
67061 aRv.Throw(NS_ERROR_UNEXPECTED);
67062 return;
67063 }
67064 }
67065 }
67066 argv[0].setObject(*returnArray);
67067 break;
67068 } while (false);
67069
67070 JS::Rooted<JS::Value> callable(cx);
67071 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67072 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67073 !InitIds(cx, atomsCache)) ||
67074 !GetCallableProperty(cx, atomsCache->passSequenceOfUnions_id, &callable)) {
67075 aRv.Throw(NS_ERROR_UNEXPECTED);
67076 return;
67077 }
67078 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67079 if (!JS::Call(cx, thisValue, callable,
67080 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67081 aRv.NoteJSContextException(cx);
67082 return;
67083 }
67084}
67085
67086void
67087TestJSImplInterfaceJSImpl::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67088{
67089 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfUnions2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67090 if (aRv.Failed()) {
67091 return;
67092 }
67093 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67093); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67093; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67094 BindingCallContext& cx = s.GetCallContext();
67095
67096 JS::Rooted<JS::Value> rval(cx);
67097 JS::RootedVector<JS::Value> argv(cx);
67098 if (!argv.resize(1)) {
67099 // That threw an exception on the JSContext, and our CallSetup will do
67100 // the right thing with that.
67101 return;
67102 }
67103 unsigned argc = 1;
67104
67105 do {
67106
67107 uint32_t length = arg.Length();
67108 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67109 if (!returnArray) {
67110 aRv.Throw(NS_ERROR_UNEXPECTED);
67111 return;
67112 }
67113 // Scope for 'tmp'
67114 {
67115 JS::Rooted<JS::Value> tmp(cx);
67116 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67117 // Control block to let us common up the JS_DefineElement calls when there
67118 // are different ways to succeed at wrapping the object.
67119 do {
67120 if (!arg[sequenceIdx0].ToJSVal(cx, returnArray, &tmp)) {
67121 aRv.Throw(NS_ERROR_UNEXPECTED);
67122 return;
67123 }
67124 break;
67125 } while (false);
67126 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67127 JSPROP_ENUMERATE)) {
67128 aRv.Throw(NS_ERROR_UNEXPECTED);
67129 return;
67130 }
67131 }
67132 }
67133 argv[0].setObject(*returnArray);
67134 break;
67135 } while (false);
67136
67137 JS::Rooted<JS::Value> callable(cx);
67138 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67139 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67140 !InitIds(cx, atomsCache)) ||
67141 !GetCallableProperty(cx, atomsCache->passSequenceOfUnions2_id, &callable)) {
67142 aRv.Throw(NS_ERROR_UNEXPECTED);
67143 return;
67144 }
67145 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67146 if (!JS::Call(cx, thisValue, callable,
67147 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67148 aRv.NoteJSContextException(cx);
67149 return;
67150 }
67151}
67152
67153void
67154TestJSImplInterfaceJSImpl::PassVariadicUnion(const nsTArray<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67155{
67156 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67157 if (aRv.Failed()) {
67158 return;
67159 }
67160 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67160; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67161 BindingCallContext& cx = s.GetCallContext();
67162
67163 JS::Rooted<JS::Value> rval(cx);
67164 JS::RootedVector<JS::Value> argv(cx);
67165 if (!argv.resize((1 - 1) + arg.Length())) {
67166 // That threw an exception on the JSContext, and our CallSetup will do
67167 // the right thing with that.
67168 return;
67169 }
67170 unsigned argc = (1 - 1) + arg.Length();
67171
67172 do {
67173 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
67174 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67175 if (!arg[idx].ToJSVal(cx, callbackObj, argv[0 + idx])) {
67176 aRv.Throw(NS_ERROR_UNEXPECTED);
67177 return;
67178 }
67179 continue;
67180 }
67181 break;
67182 } while (false);
67183
67184 JS::Rooted<JS::Value> callable(cx);
67185 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67186 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67187 !InitIds(cx, atomsCache)) ||
67188 !GetCallableProperty(cx, atomsCache->passVariadicUnion_id, &callable)) {
67189 aRv.Throw(NS_ERROR_UNEXPECTED);
67190 return;
67191 }
67192 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67193 if (!JS::Call(cx, thisValue, callable,
67194 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67195 aRv.NoteJSContextException(cx);
67196 return;
67197 }
67198}
67199
67200void
67201TestJSImplInterfaceJSImpl::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67202{
67203 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfNullableUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67204 if (aRv.Failed()) {
67205 return;
67206 }
67207 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67207); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67207; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67208 BindingCallContext& cx = s.GetCallContext();
67209
67210 JS::Rooted<JS::Value> rval(cx);
67211 JS::RootedVector<JS::Value> argv(cx);
67212 if (!argv.resize(1)) {
67213 // That threw an exception on the JSContext, and our CallSetup will do
67214 // the right thing with that.
67215 return;
67216 }
67217 unsigned argc = 1;
67218
67219 do {
67220
67221 uint32_t length = arg.Length();
67222 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67223 if (!returnArray) {
67224 aRv.Throw(NS_ERROR_UNEXPECTED);
67225 return;
67226 }
67227 // Scope for 'tmp'
67228 {
67229 JS::Rooted<JS::Value> tmp(cx);
67230 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67231 // Control block to let us common up the JS_DefineElement calls when there
67232 // are different ways to succeed at wrapping the object.
67233 do {
67234 if (arg[sequenceIdx0].IsNull()) {
67235 tmp.setNull();
67236 break;
67237 }
67238 if (!arg[sequenceIdx0].Value().ToJSVal(cx, returnArray, &tmp)) {
67239 aRv.Throw(NS_ERROR_UNEXPECTED);
67240 return;
67241 }
67242 break;
67243 } while (false);
67244 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67245 JSPROP_ENUMERATE)) {
67246 aRv.Throw(NS_ERROR_UNEXPECTED);
67247 return;
67248 }
67249 }
67250 }
67251 argv[0].setObject(*returnArray);
67252 break;
67253 } while (false);
67254
67255 JS::Rooted<JS::Value> callable(cx);
67256 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67257 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67258 !InitIds(cx, atomsCache)) ||
67259 !GetCallableProperty(cx, atomsCache->passSequenceOfNullableUnions_id, &callable)) {
67260 aRv.Throw(NS_ERROR_UNEXPECTED);
67261 return;
67262 }
67263 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67264 if (!JS::Call(cx, thisValue, callable,
67265 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67266 aRv.NoteJSContextException(cx);
67267 return;
67268 }
67269}
67270
67271void
67272TestJSImplInterfaceJSImpl::PassVariadicNullableUnion(const nsTArray<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67273{
67274 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67275 if (aRv.Failed()) {
67276 return;
67277 }
67278 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67278); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67278; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67279 BindingCallContext& cx = s.GetCallContext();
67280
67281 JS::Rooted<JS::Value> rval(cx);
67282 JS::RootedVector<JS::Value> argv(cx);
67283 if (!argv.resize((1 - 1) + arg.Length())) {
67284 // That threw an exception on the JSContext, and our CallSetup will do
67285 // the right thing with that.
67286 return;
67287 }
67288 unsigned argc = (1 - 1) + arg.Length();
67289
67290 do {
67291 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
67292 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
67293 if (arg[idx].IsNull()) {
67294 argv[0 + idx].setNull();
67295 continue;
67296 }
67297 if (!arg[idx].Value().ToJSVal(cx, callbackObj, argv[0 + idx])) {
67298 aRv.Throw(NS_ERROR_UNEXPECTED);
67299 return;
67300 }
67301 continue;
67302 }
67303 break;
67304 } while (false);
67305
67306 JS::Rooted<JS::Value> callable(cx);
67307 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67308 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67309 !InitIds(cx, atomsCache)) ||
67310 !GetCallableProperty(cx, atomsCache->passVariadicNullableUnion_id, &callable)) {
67311 aRv.Throw(NS_ERROR_UNEXPECTED);
67312 return;
67313 }
67314 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67315 if (!JS::Call(cx, thisValue, callable,
67316 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67317 aRv.NoteJSContextException(cx);
67318 return;
67319 }
67320}
67321
67322void
67323TestJSImplInterfaceJSImpl::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67324{
67325 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfUnions", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67326 if (aRv.Failed()) {
67327 return;
67328 }
67329 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67329); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67329; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67330 BindingCallContext& cx = s.GetCallContext();
67331
67332 JS::Rooted<JS::Value> rval(cx);
67333 JS::RootedVector<JS::Value> argv(cx);
67334 if (!argv.resize(1)) {
67335 // That threw an exception on the JSContext, and our CallSetup will do
67336 // the right thing with that.
67337 return;
67338 }
67339 unsigned argc = 1;
67340
67341 do {
67342
67343 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
67344 if (!returnObj) {
67345 aRv.Throw(NS_ERROR_UNEXPECTED);
67346 return;
67347 }
67348 // Scope for 'tmp'
67349 {
67350 JS::Rooted<JS::Value> tmp(cx);
67351 for (auto& entry : arg.Entries()) {
67352 auto& recordValue0 = entry.mValue;
67353 // Control block to let us common up the JS_DefineUCProperty calls when there
67354 // are different ways to succeed at wrapping the value.
67355 do {
67356 if (!recordValue0.ToJSVal(cx, returnObj, &tmp)) {
67357 aRv.Throw(NS_ERROR_UNEXPECTED);
67358 return;
67359 }
67360 break;
67361 } while (false);
67362 if (!JS_DefineUCProperty(cx, returnObj,
67363 entry.mKey.BeginReading(),
67364 entry.mKey.Length(), tmp,
67365 JSPROP_ENUMERATE)) {
67366 aRv.Throw(NS_ERROR_UNEXPECTED);
67367 return;
67368 }
67369 }
67370 }
67371 argv[0].setObject(*returnObj);
67372 break;
67373 } while (false);
67374
67375 JS::Rooted<JS::Value> callable(cx);
67376 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67377 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67378 !InitIds(cx, atomsCache)) ||
67379 !GetCallableProperty(cx, atomsCache->passRecordOfUnions_id, &callable)) {
67380 aRv.Throw(NS_ERROR_UNEXPECTED);
67381 return;
67382 }
67383 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67384 if (!JS::Call(cx, thisValue, callable,
67385 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67386 aRv.NoteJSContextException(cx);
67387 return;
67388 }
67389}
67390
67391void
67392TestJSImplInterfaceJSImpl::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67393{
67394 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67395 if (aRv.Failed()) {
67396 return;
67397 }
67398 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67398); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67398; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67399 BindingCallContext& cx = s.GetCallContext();
67400
67401 JS::Rooted<JS::Value> rval(cx);
67402
67403 JS::Rooted<JS::Value> callable(cx);
67404 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67405 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67406 !InitIds(cx, atomsCache)) ||
67407 !GetCallableProperty(cx, atomsCache->receiveUnion_id, &callable)) {
67408 aRv.Throw(NS_ERROR_UNEXPECTED);
67409 return;
67410 }
67411 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67412 if (!JS::Call(cx, thisValue, callable,
67413 JS::HandleValueArray::empty(), &rval)) {
67414 aRv.NoteJSContextException(cx);
67415 return;
67416 }
67417 OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal);
67418 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion", false)) {
67419 aRv.Throw(NS_ERROR_UNEXPECTED);
67420 return;
67421 }
67422}
67423
67424void
67425TestJSImplInterfaceJSImpl::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67426{
67427 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67428 if (aRv.Failed()) {
67429 return;
67430 }
67431 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67431); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67431; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67432 BindingCallContext& cx = s.GetCallContext();
67433
67434 JS::Rooted<JS::Value> rval(cx);
67435
67436 JS::Rooted<JS::Value> callable(cx);
67437 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67438 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67439 !InitIds(cx, atomsCache)) ||
67440 !GetCallableProperty(cx, atomsCache->receiveUnion2_id, &callable)) {
67441 aRv.Throw(NS_ERROR_UNEXPECTED);
67442 return;
67443 }
67444 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67445 if (!JS::Call(cx, thisValue, callable,
67446 JS::HandleValueArray::empty(), &rval)) {
67447 aRv.NoteJSContextException(cx);
67448 return;
67449 }
67450 OwningObjectOrLong& rvalDecl(aRetVal);
67451 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnion2", false)) {
67452 aRv.Throw(NS_ERROR_UNEXPECTED);
67453 return;
67454 }
67455}
67456
67457void
67458TestJSImplInterfaceJSImpl::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67459{
67460 CallSetup s(this, aRv, "TestJSImplInterface.receiveUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67461 if (aRv.Failed()) {
67462 return;
67463 }
67464 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67464); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67464; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67465 BindingCallContext& cx = s.GetCallContext();
67466
67467 JS::Rooted<JS::Value> rval(cx);
67468
67469 JS::Rooted<JS::Value> callable(cx);
67470 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67471 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67472 !InitIds(cx, atomsCache)) ||
67473 !GetCallableProperty(cx, atomsCache->receiveUnionContainingNull_id, &callable)) {
67474 aRv.Throw(NS_ERROR_UNEXPECTED);
67475 return;
67476 }
67477 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67478 if (!JS::Call(cx, thisValue, callable,
67479 JS::HandleValueArray::empty(), &rval)) {
67480 aRv.NoteJSContextException(cx);
67481 return;
67482 }
67483 OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal);
67484 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveUnionContainingNull", false)) {
67485 aRv.Throw(NS_ERROR_UNEXPECTED);
67486 return;
67487 }
67488}
67489
67490void
67491TestJSImplInterfaceJSImpl::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67492{
67493 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67494 if (aRv.Failed()) {
67495 return;
67496 }
67497 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67497); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67497; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67498 BindingCallContext& cx = s.GetCallContext();
67499
67500 JS::Rooted<JS::Value> rval(cx);
67501
67502 JS::Rooted<JS::Value> callable(cx);
67503 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67504 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67505 !InitIds(cx, atomsCache)) ||
67506 !GetCallableProperty(cx, atomsCache->receiveNullableUnion_id, &callable)) {
67507 aRv.Throw(NS_ERROR_UNEXPECTED);
67508 return;
67509 }
67510 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67511 if (!JS::Call(cx, thisValue, callable,
67512 JS::HandleValueArray::empty(), &rval)) {
67513 aRv.NoteJSContextException(cx);
67514 return;
67515 }
67516 Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal);
67517 if (rval.isNullOrUndefined()) {
67518 rvalDecl.SetNull();
67519 } else {
67520 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion", false)) {
67521 aRv.Throw(NS_ERROR_UNEXPECTED);
67522 return;
67523 }
67524 }
67525}
67526
67527void
67528TestJSImplInterfaceJSImpl::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
67529{
67530 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableUnion2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67531 if (aRv.Failed()) {
67532 return;
67533 }
67534 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67534); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67534; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67535 BindingCallContext& cx = s.GetCallContext();
67536
67537 JS::Rooted<JS::Value> rval(cx);
67538
67539 JS::Rooted<JS::Value> callable(cx);
67540 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67541 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67542 !InitIds(cx, atomsCache)) ||
67543 !GetCallableProperty(cx, atomsCache->receiveNullableUnion2_id, &callable)) {
67544 aRv.Throw(NS_ERROR_UNEXPECTED);
67545 return;
67546 }
67547 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67548 if (!JS::Call(cx, thisValue, callable,
67549 JS::HandleValueArray::empty(), &rval)) {
67550 aRv.NoteJSContextException(cx);
67551 return;
67552 }
67553 Nullable<OwningObjectOrLong >& rvalDecl(aRetVal);
67554 if (rval.isNullOrUndefined()) {
67555 rvalDecl.SetNull();
67556 } else {
67557 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableUnion2", false)) {
67558 aRv.Throw(NS_ERROR_UNEXPECTED);
67559 return;
67560 }
67561 }
67562}
67563
67564void
67565TestJSImplInterfaceJSImpl::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm)
67566{
67567 CallSetup s(this, aRv, "TestJSImplInterface.passPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67568 if (aRv.Failed()) {
67569 return;
67570 }
67571 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67571); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67571; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67572 BindingCallContext& cx = s.GetCallContext();
67573
67574 JS::Rooted<JS::Value> rval(cx);
67575 JS::RootedVector<JS::Value> argv(cx);
67576 if (!argv.resize(1)) {
67577 // That threw an exception on the JSContext, and our CallSetup will do
67578 // the right thing with that.
67579 return;
67580 }
67581 unsigned argc = 1;
67582
67583 do {
67584 if (!ToJSValue(cx, arg, argv[0])) {
67585 aRv.Throw(NS_ERROR_UNEXPECTED);
67586 return;
67587 }
67588 break;
67589 } while (false);
67590
67591 JS::Rooted<JS::Value> callable(cx);
67592 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67593 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67594 !InitIds(cx, atomsCache)) ||
67595 !GetCallableProperty(cx, atomsCache->passPromise_id, &callable)) {
67596 aRv.Throw(NS_ERROR_UNEXPECTED);
67597 return;
67598 }
67599 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67600 if (!JS::Call(cx, thisValue, callable,
67601 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67602 aRv.NoteJSContextException(cx);
67603 return;
67604 }
67605}
67606
67607void
67608TestJSImplInterfaceJSImpl::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67609{
67610 CallSetup s(this, aRv, "TestJSImplInterface.passOptionalPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67611 if (aRv.Failed()) {
67612 return;
67613 }
67614 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67614); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67614; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67615 BindingCallContext& cx = s.GetCallContext();
67616
67617 JS::Rooted<JS::Value> rval(cx);
67618 JS::RootedVector<JS::Value> argv(cx);
67619 if (!argv.resize(1)) {
67620 // That threw an exception on the JSContext, and our CallSetup will do
67621 // the right thing with that.
67622 return;
67623 }
67624 unsigned argc = 1;
67625
67626 do {
67627 if (arg.WasPassed()) {
67628 if (!ToJSValue(cx, arg.Value(), argv[0])) {
67629 aRv.Throw(NS_ERROR_UNEXPECTED);
67630 return;
67631 }
67632 break;
67633 } else if (argc == 1) {
67634 // This is our current trailing argument; reduce argc
67635 --argc;
67636 } else {
67637 argv[0].setUndefined();
67638 }
67639 } while (false);
67640
67641 JS::Rooted<JS::Value> callable(cx);
67642 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67643 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67644 !InitIds(cx, atomsCache)) ||
67645 !GetCallableProperty(cx, atomsCache->passOptionalPromise_id, &callable)) {
67646 aRv.Throw(NS_ERROR_UNEXPECTED);
67647 return;
67648 }
67649 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67650 if (!JS::Call(cx, thisValue, callable,
67651 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67652 aRv.NoteJSContextException(cx);
67653 return;
67654 }
67655}
67656
67657void
67658TestJSImplInterfaceJSImpl::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
67659{
67660 CallSetup s(this, aRv, "TestJSImplInterface.passPromiseSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67661 if (aRv.Failed()) {
67662 return;
67663 }
67664 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67664); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67664; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67665 BindingCallContext& cx = s.GetCallContext();
67666
67667 JS::Rooted<JS::Value> rval(cx);
67668 JS::RootedVector<JS::Value> argv(cx);
67669 if (!argv.resize(1)) {
67670 // That threw an exception on the JSContext, and our CallSetup will do
67671 // the right thing with that.
67672 return;
67673 }
67674 unsigned argc = 1;
67675
67676 do {
67677
67678 uint32_t length = arg.Length();
67679 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
67680 if (!returnArray) {
67681 aRv.Throw(NS_ERROR_UNEXPECTED);
67682 return;
67683 }
67684 // Scope for 'tmp'
67685 {
67686 JS::Rooted<JS::Value> tmp(cx);
67687 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
67688 // Control block to let us common up the JS_DefineElement calls when there
67689 // are different ways to succeed at wrapping the object.
67690 do {
67691 if (!ToJSValue(cx, arg[sequenceIdx0], &tmp)) {
67692 aRv.Throw(NS_ERROR_UNEXPECTED);
67693 return;
67694 }
67695 break;
67696 } while (false);
67697 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
67698 JSPROP_ENUMERATE)) {
67699 aRv.Throw(NS_ERROR_UNEXPECTED);
67700 return;
67701 }
67702 }
67703 }
67704 argv[0].setObject(*returnArray);
67705 break;
67706 } while (false);
67707
67708 JS::Rooted<JS::Value> callable(cx);
67709 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67710 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67711 !InitIds(cx, atomsCache)) ||
67712 !GetCallableProperty(cx, atomsCache->passPromiseSequence_id, &callable)) {
67713 aRv.Throw(NS_ERROR_UNEXPECTED);
67714 return;
67715 }
67716 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67717 if (!JS::Call(cx, thisValue, callable,
67718 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67719 aRv.NoteJSContextException(cx);
67720 return;
67721 }
67722}
67723
67724already_AddRefed<Promise>
67725TestJSImplInterfaceJSImpl::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm)
67726{
67727 CallSetup s(this, aRv, "TestJSImplInterface.receivePromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67728 if (aRv.Failed()) {
67729 return nullptr;
67730 }
67731 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67731); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67731; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67732 BindingCallContext& cx = s.GetCallContext();
67733
67734 JS::Rooted<JS::Value> rval(cx);
67735
67736 JS::Rooted<JS::Value> callable(cx);
67737 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67738 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67739 !InitIds(cx, atomsCache)) ||
67740 !GetCallableProperty(cx, atomsCache->receivePromise_id, &callable)) {
67741 aRv.Throw(NS_ERROR_UNEXPECTED);
67742 return nullptr;
67743 }
67744 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67745 if (!JS::Call(cx, thisValue, callable,
67746 JS::HandleValueArray::empty(), &rval)) {
67747 aRv.NoteJSContextException(cx);
67748 return nullptr;
67749 }
67750 RefPtr<Promise> rvalDecl;
67751 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
67752 // etc.
67753
67754 JS::Rooted<JSObject*> globalObj(cx);
67755 if (!rval.isObject()) {
67756 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise");
67757 return nullptr;
67758 }
67759 JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject());
67760 if (!unwrappedVal) {
67761 // A slight lie, but not much of one, for a dead object wrapper.
67762 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receivePromise");
67763 return nullptr;
67764 }
67765 globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal);
67766 JSAutoRealm ar(cx, globalObj);
67767 GlobalObject promiseGlobal(cx, globalObj);
67768 if (promiseGlobal.Failed()) {
67769 aRv.Throw(NS_ERROR_UNEXPECTED);
67770 return nullptr;
67771 }
67772
67773 JS::Rooted<JS::Value> valueToResolve(cx, rval);
67774 if (!JS_WrapValue(cx, &valueToResolve)) {
67775 aRv.Throw(NS_ERROR_UNEXPECTED);
67776 return nullptr;
67777 }
67778 binding_detail::FastErrorResult promiseRv;
67779 nsCOMPtr<nsIGlobalObject> global =
67780 do_QueryInterface(promiseGlobal.GetAsSupports());
67781 if (!global) {
67782 promiseRv.Throw(NS_ERROR_UNEXPECTED);
67783 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "promiseRv.MaybeSetPendingException(cx)"
")", "../TestJSImplGenBinding.cpp", 67783); AnnotateMozCrashReason
("MOZ_DIAGNOSTIC_ASSERT" "(" "false" ") (" "promiseRv.MaybeSetPendingException(cx)"
")"); do { *((volatile int*)__null) = 67783; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
67784 aRv.Throw(NS_ERROR_UNEXPECTED);
67785 return nullptr;
67786 }
67787 rvalDecl = Promise::Resolve(global, cx, valueToResolve,
67788 promiseRv);
67789 if (promiseRv.MaybeSetPendingException(cx)) {
67790 aRv.Throw(NS_ERROR_UNEXPECTED);
67791 return nullptr;
67792 }
67793 }
67794 return rvalDecl.forget();
67795}
67796
67797already_AddRefed<Promise>
67798TestJSImplInterfaceJSImpl::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm)
67799{
67800 CallSetup s(this, aRv, "TestJSImplInterface.receiveAddrefedPromise", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67801 if (aRv.Failed()) {
67802 return nullptr;
67803 }
67804 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67804); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67804; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67805 BindingCallContext& cx = s.GetCallContext();
67806
67807 JS::Rooted<JS::Value> rval(cx);
67808
67809 JS::Rooted<JS::Value> callable(cx);
67810 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67811 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67812 !InitIds(cx, atomsCache)) ||
67813 !GetCallableProperty(cx, atomsCache->receiveAddrefedPromise_id, &callable)) {
67814 aRv.Throw(NS_ERROR_UNEXPECTED);
67815 return nullptr;
67816 }
67817 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67818 if (!JS::Call(cx, thisValue, callable,
67819 JS::HandleValueArray::empty(), &rval)) {
67820 aRv.NoteJSContextException(cx);
67821 return nullptr;
67822 }
67823 RefPtr<Promise> rvalDecl;
67824 { // Scope for our GlobalObject, FastErrorResult, JSAutoRealm,
67825 // etc.
67826
67827 JS::Rooted<JSObject*> globalObj(cx);
67828 if (!rval.isObject()) {
67829 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise");
67830 return nullptr;
67831 }
67832 JSObject* unwrappedVal = js::CheckedUnwrapStatic(&rval.toObject());
67833 if (!unwrappedVal) {
67834 // A slight lie, but not much of one, for a dead object wrapper.
67835 aRv.ThrowTypeError<MSG_NOT_OBJECT>("return value of TestJSImplInterface.receiveAddrefedPromise");
67836 return nullptr;
67837 }
67838 globalObj = JS::GetNonCCWObjectGlobal(unwrappedVal);
67839 JSAutoRealm ar(cx, globalObj);
67840 GlobalObject promiseGlobal(cx, globalObj);
67841 if (promiseGlobal.Failed()) {
67842 aRv.Throw(NS_ERROR_UNEXPECTED);
67843 return nullptr;
67844 }
67845
67846 JS::Rooted<JS::Value> valueToResolve(cx, rval);
67847 if (!JS_WrapValue(cx, &valueToResolve)) {
67848 aRv.Throw(NS_ERROR_UNEXPECTED);
67849 return nullptr;
67850 }
67851 binding_detail::FastErrorResult promiseRv;
67852 nsCOMPtr<nsIGlobalObject> global =
67853 do_QueryInterface(promiseGlobal.GetAsSupports());
67854 if (!global) {
67855 promiseRv.Throw(NS_ERROR_UNEXPECTED);
67856 MOZ_ALWAYS_TRUE(promiseRv.MaybeSetPendingException(cx))do { if ((__builtin_expect(!!(promiseRv.MaybeSetPendingException
(cx)), 1))) { } else { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(false)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(false))), 0))) { do { } while
(false); MOZ_ReportAssertionFailure("false" " (" "promiseRv.MaybeSetPendingException(cx)"
")", "../TestJSImplGenBinding.cpp", 67856); AnnotateMozCrashReason
("MOZ_DIAGNOSTIC_ASSERT" "(" "false" ") (" "promiseRv.MaybeSetPendingException(cx)"
")"); do { *((volatile int*)__null) = 67856; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); } } while
(false)
;
67857 aRv.Throw(NS_ERROR_UNEXPECTED);
67858 return nullptr;
67859 }
67860 rvalDecl = Promise::Resolve(global, cx, valueToResolve,
67861 promiseRv);
67862 if (promiseRv.MaybeSetPendingException(cx)) {
67863 aRv.Throw(NS_ERROR_UNEXPECTED);
67864 return nullptr;
67865 }
67866 }
67867 return rvalDecl.forget();
67868}
67869
67870void
67871TestJSImplInterfaceJSImpl::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
67872{
67873 CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67874 if (aRv.Failed()) {
67875 return;
67876 }
67877 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67877); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67877; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67878 BindingCallContext& cx = s.GetCallContext();
67879
67880 JS::Rooted<JS::Value> rval(cx);
67881
67882 JS::Rooted<JS::Value> callable(cx);
67883 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67884 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67885 !InitIds(cx, atomsCache)) ||
67886 !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) {
67887 aRv.Throw(NS_ERROR_UNEXPECTED);
67888 return;
67889 }
67890 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67891 if (!JS::Call(cx, thisValue, callable,
67892 JS::HandleValueArray::empty(), &rval)) {
67893 aRv.NoteJSContextException(cx);
67894 return;
67895 }
67896}
67897
67898void
67899TestJSImplInterfaceJSImpl::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm)
67900{
67901 CallSetup s(this, aRv, "TestJSImplInterface.methodRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67902 if (aRv.Failed()) {
67903 return;
67904 }
67905 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67905); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67905; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67906 BindingCallContext& cx = s.GetCallContext();
67907
67908 JS::Rooted<JS::Value> rval(cx);
67909 JS::RootedVector<JS::Value> argv(cx);
67910 if (!argv.resize(1)) {
67911 // That threw an exception on the JSContext, and our CallSetup will do
67912 // the right thing with that.
67913 return;
67914 }
67915 unsigned argc = 1;
67916
67917 do {
67918 argv[0].setInt32(int32_t(argument));
67919 break;
67920 } while (false);
67921
67922 JS::Rooted<JS::Value> callable(cx);
67923 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67924 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67925 !InitIds(cx, atomsCache)) ||
67926 !GetCallableProperty(cx, atomsCache->methodRenamedTo_id, &callable)) {
67927 aRv.Throw(NS_ERROR_UNEXPECTED);
67928 return;
67929 }
67930 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67931 if (!JS::Call(cx, thisValue, callable,
67932 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67933 aRv.NoteJSContextException(cx);
67934 return;
67935 }
67936}
67937
67938void
67939TestJSImplInterfaceJSImpl::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
67940{
67941 CallSetup s(this, aRv, "TestJSImplInterface.passDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67942 if (aRv.Failed()) {
67943 return;
67944 }
67945 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67945); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67945; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67946 BindingCallContext& cx = s.GetCallContext();
67947
67948 JS::Rooted<JS::Value> rval(cx);
67949 JS::RootedVector<JS::Value> argv(cx);
67950 if (!argv.resize(1)) {
67951 // That threw an exception on the JSContext, and our CallSetup will do
67952 // the right thing with that.
67953 return;
67954 }
67955 unsigned argc = 1;
67956
67957 do {
67958 if (!x.ToObjectInternal(cx, argv[0])) {
67959 aRv.Throw(NS_ERROR_UNEXPECTED);
67960 return;
67961 }
67962 break;
67963 } while (false);
67964
67965 JS::Rooted<JS::Value> callable(cx);
67966 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
67967 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
67968 !InitIds(cx, atomsCache)) ||
67969 !GetCallableProperty(cx, atomsCache->passDictionary_id, &callable)) {
67970 aRv.Throw(NS_ERROR_UNEXPECTED);
67971 return;
67972 }
67973 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
67974 if (!JS::Call(cx, thisValue, callable,
67975 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
67976 aRv.NoteJSContextException(cx);
67977 return;
67978 }
67979}
67980
67981void
67982TestJSImplInterfaceJSImpl::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
67983{
67984 CallSetup s(this, aRv, "TestJSImplInterface.passDictionary2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
67985 if (aRv.Failed()) {
67986 return;
67987 }
67988 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 67988); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 67988; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
67989 BindingCallContext& cx = s.GetCallContext();
67990
67991 JS::Rooted<JS::Value> rval(cx);
67992 JS::RootedVector<JS::Value> argv(cx);
67993 if (!argv.resize(1)) {
67994 // That threw an exception on the JSContext, and our CallSetup will do
67995 // the right thing with that.
67996 return;
67997 }
67998 unsigned argc = 1;
67999
68000 do {
68001 if (!x.ToObjectInternal(cx, argv[0])) {
68002 aRv.Throw(NS_ERROR_UNEXPECTED);
68003 return;
68004 }
68005 break;
68006 } while (false);
68007
68008 JS::Rooted<JS::Value> callable(cx);
68009 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68010 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68011 !InitIds(cx, atomsCache)) ||
68012 !GetCallableProperty(cx, atomsCache->passDictionary2_id, &callable)) {
68013 aRv.Throw(NS_ERROR_UNEXPECTED);
68014 return;
68015 }
68016 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68017 if (!JS::Call(cx, thisValue, callable,
68018 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68019 aRv.NoteJSContextException(cx);
68020 return;
68021 }
68022}
68023
68024void
68025TestJSImplInterfaceJSImpl::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68026{
68027 CallSetup s(this, aRv, "TestJSImplInterface.receiveDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68028 if (aRv.Failed()) {
68029 return;
68030 }
68031 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68031); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68031; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68032 BindingCallContext& cx = s.GetCallContext();
68033
68034 JS::Rooted<JS::Value> rval(cx);
68035
68036 JS::Rooted<JS::Value> callable(cx);
68037 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68038 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68039 !InitIds(cx, atomsCache)) ||
68040 !GetCallableProperty(cx, atomsCache->receiveDictionary_id, &callable)) {
68041 aRv.Throw(NS_ERROR_UNEXPECTED);
68042 return;
68043 }
68044 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68045 if (!JS::Call(cx, thisValue, callable,
68046 JS::HandleValueArray::empty(), &rval)) {
68047 aRv.NoteJSContextException(cx);
68048 return;
68049 }
68050 Dict& rvalDecl(aRetVal);
68051 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictionary", false)) {
68052 aRv.Throw(NS_ERROR_UNEXPECTED);
68053 return;
68054 }
68055}
68056
68057void
68058TestJSImplInterfaceJSImpl::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68059{
68060 CallSetup s(this, aRv, "TestJSImplInterface.receiveNullableDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68061 if (aRv.Failed()) {
68062 return;
68063 }
68064 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68064; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68065 BindingCallContext& cx = s.GetCallContext();
68066
68067 JS::Rooted<JS::Value> rval(cx);
68068
68069 JS::Rooted<JS::Value> callable(cx);
68070 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68071 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68072 !InitIds(cx, atomsCache)) ||
68073 !GetCallableProperty(cx, atomsCache->receiveNullableDictionary_id, &callable)) {
68074 aRv.Throw(NS_ERROR_UNEXPECTED);
68075 return;
68076 }
68077 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68078 if (!JS::Call(cx, thisValue, callable,
68079 JS::HandleValueArray::empty(), &rval)) {
68080 aRv.NoteJSContextException(cx);
68081 return;
68082 }
68083 Nullable<Dict>& rvalDecl(aRetVal);
68084 if (rval.isNullOrUndefined()) {
68085 rvalDecl.SetNull();
68086 } else {
68087 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.receiveNullableDictionary", false)) {
68088 aRv.Throw(NS_ERROR_UNEXPECTED);
68089 return;
68090 }
68091 }
68092}
68093
68094void
68095TestJSImplInterfaceJSImpl::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm)
68096{
68097 CallSetup s(this, aRv, "TestJSImplInterface.passOtherDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68098 if (aRv.Failed()) {
68099 return;
68100 }
68101 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68101); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68101; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68102 BindingCallContext& cx = s.GetCallContext();
68103
68104 JS::Rooted<JS::Value> rval(cx);
68105 JS::RootedVector<JS::Value> argv(cx);
68106 if (!argv.resize(1)) {
68107 // That threw an exception on the JSContext, and our CallSetup will do
68108 // the right thing with that.
68109 return;
68110 }
68111 unsigned argc = 1;
68112
68113 do {
68114 if (!x.ToObjectInternal(cx, argv[0])) {
68115 aRv.Throw(NS_ERROR_UNEXPECTED);
68116 return;
68117 }
68118 break;
68119 } while (false);
68120
68121 JS::Rooted<JS::Value> callable(cx);
68122 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68123 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68124 !InitIds(cx, atomsCache)) ||
68125 !GetCallableProperty(cx, atomsCache->passOtherDictionary_id, &callable)) {
68126 aRv.Throw(NS_ERROR_UNEXPECTED);
68127 return;
68128 }
68129 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68130 if (!JS::Call(cx, thisValue, callable,
68131 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68132 aRv.NoteJSContextException(cx);
68133 return;
68134 }
68135}
68136
68137void
68138TestJSImplInterfaceJSImpl::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm)
68139{
68140 CallSetup s(this, aRv, "TestJSImplInterface.passSequenceOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68141 if (aRv.Failed()) {
68142 return;
68143 }
68144 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68144); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68144; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68145 BindingCallContext& cx = s.GetCallContext();
68146
68147 JS::Rooted<JS::Value> rval(cx);
68148 JS::RootedVector<JS::Value> argv(cx);
68149 if (!argv.resize(1)) {
68150 // That threw an exception on the JSContext, and our CallSetup will do
68151 // the right thing with that.
68152 return;
68153 }
68154 unsigned argc = 1;
68155
68156 do {
68157
68158 uint32_t length = x.Length();
68159 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
68160 if (!returnArray) {
68161 aRv.Throw(NS_ERROR_UNEXPECTED);
68162 return;
68163 }
68164 // Scope for 'tmp'
68165 {
68166 JS::Rooted<JS::Value> tmp(cx);
68167 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
68168 // Control block to let us common up the JS_DefineElement calls when there
68169 // are different ways to succeed at wrapping the object.
68170 do {
68171 if (!x[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
68172 aRv.Throw(NS_ERROR_UNEXPECTED);
68173 return;
68174 }
68175 break;
68176 } while (false);
68177 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
68178 JSPROP_ENUMERATE)) {
68179 aRv.Throw(NS_ERROR_UNEXPECTED);
68180 return;
68181 }
68182 }
68183 }
68184 argv[0].setObject(*returnArray);
68185 break;
68186 } while (false);
68187
68188 JS::Rooted<JS::Value> callable(cx);
68189 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68190 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68191 !InitIds(cx, atomsCache)) ||
68192 !GetCallableProperty(cx, atomsCache->passSequenceOfDictionaries_id, &callable)) {
68193 aRv.Throw(NS_ERROR_UNEXPECTED);
68194 return;
68195 }
68196 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68197 if (!JS::Call(cx, thisValue, callable,
68198 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68199 aRv.NoteJSContextException(cx);
68200 return;
68201 }
68202}
68203
68204void
68205TestJSImplInterfaceJSImpl::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm)
68206{
68207 CallSetup s(this, aRv, "TestJSImplInterface.passRecordOfDictionaries", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68208 if (aRv.Failed()) {
68209 return;
68210 }
68211 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68211); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68211; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68212 BindingCallContext& cx = s.GetCallContext();
68213
68214 JS::Rooted<JS::Value> rval(cx);
68215 JS::RootedVector<JS::Value> argv(cx);
68216 if (!argv.resize(1)) {
68217 // That threw an exception on the JSContext, and our CallSetup will do
68218 // the right thing with that.
68219 return;
68220 }
68221 unsigned argc = 1;
68222
68223 do {
68224
68225 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
68226 if (!returnObj) {
68227 aRv.Throw(NS_ERROR_UNEXPECTED);
68228 return;
68229 }
68230 // Scope for 'tmp'
68231 {
68232 JS::Rooted<JS::Value> tmp(cx);
68233 for (auto& entry : x.Entries()) {
68234 auto& recordValue0 = entry.mValue;
68235 // Control block to let us common up the JS_DefineUCProperty calls when there
68236 // are different ways to succeed at wrapping the value.
68237 do {
68238 if (!recordValue0.ToObjectInternal(cx, &tmp)) {
68239 aRv.Throw(NS_ERROR_UNEXPECTED);
68240 return;
68241 }
68242 break;
68243 } while (false);
68244 if (!JS_DefineUCProperty(cx, returnObj,
68245 entry.mKey.BeginReading(),
68246 entry.mKey.Length(), tmp,
68247 JSPROP_ENUMERATE)) {
68248 aRv.Throw(NS_ERROR_UNEXPECTED);
68249 return;
68250 }
68251 }
68252 }
68253 argv[0].setObject(*returnObj);
68254 break;
68255 } while (false);
68256
68257 JS::Rooted<JS::Value> callable(cx);
68258 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68259 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68260 !InitIds(cx, atomsCache)) ||
68261 !GetCallableProperty(cx, atomsCache->passRecordOfDictionaries_id, &callable)) {
68262 aRv.Throw(NS_ERROR_UNEXPECTED);
68263 return;
68264 }
68265 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68266 if (!JS::Call(cx, thisValue, callable,
68267 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68268 aRv.NoteJSContextException(cx);
68269 return;
68270 }
68271}
68272
68273void
68274TestJSImplInterfaceJSImpl::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
68275{
68276 CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68277 if (aRv.Failed()) {
68278 return;
68279 }
68280 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68280); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68280; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68281 BindingCallContext& cx = s.GetCallContext();
68282
68283 JS::Rooted<JS::Value> rval(cx);
68284 JS::RootedVector<JS::Value> argv(cx);
68285 if (!argv.resize(1)) {
68286 // That threw an exception on the JSContext, and our CallSetup will do
68287 // the right thing with that.
68288 return;
68289 }
68290 unsigned argc = 1;
68291
68292 do {
68293 if (!x.ToObjectInternal(cx, argv[0])) {
68294 aRv.Throw(NS_ERROR_UNEXPECTED);
68295 return;
68296 }
68297 break;
68298 } while (false);
68299
68300 JS::Rooted<JS::Value> callable(cx);
68301 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68302 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68303 !InitIds(cx, atomsCache)) ||
68304 !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) {
68305 aRv.Throw(NS_ERROR_UNEXPECTED);
68306 return;
68307 }
68308 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68309 if (!JS::Call(cx, thisValue, callable,
68310 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68311 aRv.NoteJSContextException(cx);
68312 return;
68313 }
68314}
68315
68316void
68317TestJSImplInterfaceJSImpl::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm)
68318{
68319 CallSetup s(this, aRv, "TestJSImplInterface.passDictionaryOrLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68320 if (aRv.Failed()) {
68321 return;
68322 }
68323 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68323); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68323; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68324 BindingCallContext& cx = s.GetCallContext();
68325
68326 JS::Rooted<JS::Value> rval(cx);
68327 JS::RootedVector<JS::Value> argv(cx);
68328 if (!argv.resize(1)) {
68329 // That threw an exception on the JSContext, and our CallSetup will do
68330 // the right thing with that.
68331 return;
68332 }
68333 unsigned argc = 1;
68334
68335 do {
68336 argv[0].setInt32(int32_t(x));
68337 break;
68338 } while (false);
68339
68340 JS::Rooted<JS::Value> callable(cx);
68341 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68342 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68343 !InitIds(cx, atomsCache)) ||
68344 !GetCallableProperty(cx, atomsCache->passDictionaryOrLong_id, &callable)) {
68345 aRv.Throw(NS_ERROR_UNEXPECTED);
68346 return;
68347 }
68348 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68349 if (!JS::Call(cx, thisValue, callable,
68350 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68351 aRv.NoteJSContextException(cx);
68352 return;
68353 }
68354}
68355
68356void
68357TestJSImplInterfaceJSImpl::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm)
68358{
68359 CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingDict", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68360 if (aRv.Failed()) {
68361 return;
68362 }
68363 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68363); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68363; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68364 BindingCallContext& cx = s.GetCallContext();
68365
68366 JS::Rooted<JS::Value> rval(cx);
68367 JS::RootedVector<JS::Value> argv(cx);
68368 if (!argv.resize(1)) {
68369 // That threw an exception on the JSContext, and our CallSetup will do
68370 // the right thing with that.
68371 return;
68372 }
68373 unsigned argc = 1;
68374
68375 do {
68376 if (!arg.ToObjectInternal(cx, argv[0])) {
68377 aRv.Throw(NS_ERROR_UNEXPECTED);
68378 return;
68379 }
68380 break;
68381 } while (false);
68382
68383 JS::Rooted<JS::Value> callable(cx);
68384 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68385 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68386 !InitIds(cx, atomsCache)) ||
68387 !GetCallableProperty(cx, atomsCache->passDictContainingDict_id, &callable)) {
68388 aRv.Throw(NS_ERROR_UNEXPECTED);
68389 return;
68390 }
68391 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68392 if (!JS::Call(cx, thisValue, callable,
68393 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68394 aRv.NoteJSContextException(cx);
68395 return;
68396 }
68397}
68398
68399void
68400TestJSImplInterfaceJSImpl::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
68401{
68402 CallSetup s(this, aRv, "TestJSImplInterface.passDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68403 if (aRv.Failed()) {
68404 return;
68405 }
68406 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68406); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68406; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68407 BindingCallContext& cx = s.GetCallContext();
68408
68409 JS::Rooted<JS::Value> rval(cx);
68410 JS::RootedVector<JS::Value> argv(cx);
68411 if (!argv.resize(1)) {
68412 // That threw an exception on the JSContext, and our CallSetup will do
68413 // the right thing with that.
68414 return;
68415 }
68416 unsigned argc = 1;
68417
68418 do {
68419 if (!arg.ToObjectInternal(cx, argv[0])) {
68420 aRv.Throw(NS_ERROR_UNEXPECTED);
68421 return;
68422 }
68423 break;
68424 } while (false);
68425
68426 JS::Rooted<JS::Value> callable(cx);
68427 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68428 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68429 !InitIds(cx, atomsCache)) ||
68430 !GetCallableProperty(cx, atomsCache->passDictContainingSequence_id, &callable)) {
68431 aRv.Throw(NS_ERROR_UNEXPECTED);
68432 return;
68433 }
68434 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68435 if (!JS::Call(cx, thisValue, callable,
68436 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68437 aRv.NoteJSContextException(cx);
68438 return;
68439 }
68440}
68441
68442void
68443TestJSImplInterfaceJSImpl::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
68444{
68445 CallSetup s(this, aRv, "TestJSImplInterface.receiveDictContainingSequence", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68446 if (aRv.Failed()) {
68447 return;
68448 }
68449 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68449); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68449; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68450 BindingCallContext& cx = s.GetCallContext();
68451
68452 JS::Rooted<JS::Value> rval(cx);
68453
68454 JS::Rooted<JS::Value> callable(cx);
68455 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68456 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68457 !InitIds(cx, atomsCache)) ||
68458 !GetCallableProperty(cx, atomsCache->receiveDictContainingSequence_id, &callable)) {
68459 aRv.Throw(NS_ERROR_UNEXPECTED);
68460 return;
68461 }
68462 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68463 if (!JS::Call(cx, thisValue, callable,
68464 JS::HandleValueArray::empty(), &rval)) {
68465 aRv.NoteJSContextException(cx);
68466 return;
68467 }
68468 DictContainingSequence& rvalDecl(aRetVal);
68469 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.receiveDictContainingSequence", false)) {
68470 aRv.Throw(NS_ERROR_UNEXPECTED);
68471 return;
68472 }
68473}
68474
68475void
68476TestJSImplInterfaceJSImpl::PassVariadicDictionary(const nsTArray<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68477{
68478 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicDictionary", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68479 if (aRv.Failed()) {
68480 return;
68481 }
68482 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68482); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68482; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68483 BindingCallContext& cx = s.GetCallContext();
68484
68485 JS::Rooted<JS::Value> rval(cx);
68486 JS::RootedVector<JS::Value> argv(cx);
68487 if (!argv.resize((1 - 1) + arg.Length())) {
68488 // That threw an exception on the JSContext, and our CallSetup will do
68489 // the right thing with that.
68490 return;
68491 }
68492 unsigned argc = (1 - 1) + arg.Length();
68493
68494 do {
68495 for (uint32_t idx = 0; idx < arg.Length(); ++idx) {
68496 if (!arg[idx].ToObjectInternal(cx, argv[0 + idx])) {
68497 aRv.Throw(NS_ERROR_UNEXPECTED);
68498 return;
68499 }
68500 continue;
68501 }
68502 break;
68503 } while (false);
68504
68505 JS::Rooted<JS::Value> callable(cx);
68506 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68507 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68508 !InitIds(cx, atomsCache)) ||
68509 !GetCallableProperty(cx, atomsCache->passVariadicDictionary_id, &callable)) {
68510 aRv.Throw(NS_ERROR_UNEXPECTED);
68511 return;
68512 }
68513 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68514 if (!JS::Call(cx, thisValue, callable,
68515 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68516 aRv.NoteJSContextException(cx);
68517 return;
68518 }
68519}
68520
68521void
68522TestJSImplInterfaceJSImpl::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68523{
68524 CallSetup s(this, aRv, "TestJSImplInterface.dontEnforceRangeOrClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68525 if (aRv.Failed()) {
68526 return;
68527 }
68528 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68528); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68528; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68529 BindingCallContext& cx = s.GetCallContext();
68530
68531 JS::Rooted<JS::Value> rval(cx);
68532 JS::RootedVector<JS::Value> argv(cx);
68533 if (!argv.resize(1)) {
68534 // That threw an exception on the JSContext, and our CallSetup will do
68535 // the right thing with that.
68536 return;
68537 }
68538 unsigned argc = 1;
68539
68540 do {
68541 argv[0].setInt32(int32_t(arg));
68542 break;
68543 } while (false);
68544
68545 JS::Rooted<JS::Value> callable(cx);
68546 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68547 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68548 !InitIds(cx, atomsCache)) ||
68549 !GetCallableProperty(cx, atomsCache->dontEnforceRangeOrClamp_id, &callable)) {
68550 aRv.Throw(NS_ERROR_UNEXPECTED);
68551 return;
68552 }
68553 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68554 if (!JS::Call(cx, thisValue, callable,
68555 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68556 aRv.NoteJSContextException(cx);
68557 return;
68558 }
68559}
68560
68561void
68562TestJSImplInterfaceJSImpl::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68563{
68564 CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRange", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68565 if (aRv.Failed()) {
68566 return;
68567 }
68568 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68568); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68568; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68569 BindingCallContext& cx = s.GetCallContext();
68570
68571 JS::Rooted<JS::Value> rval(cx);
68572 JS::RootedVector<JS::Value> argv(cx);
68573 if (!argv.resize(1)) {
68574 // That threw an exception on the JSContext, and our CallSetup will do
68575 // the right thing with that.
68576 return;
68577 }
68578 unsigned argc = 1;
68579
68580 do {
68581 argv[0].setInt32(int32_t(arg));
68582 break;
68583 } while (false);
68584
68585 JS::Rooted<JS::Value> callable(cx);
68586 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68587 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68588 !InitIds(cx, atomsCache)) ||
68589 !GetCallableProperty(cx, atomsCache->doEnforceRange_id, &callable)) {
68590 aRv.Throw(NS_ERROR_UNEXPECTED);
68591 return;
68592 }
68593 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68594 if (!JS::Call(cx, thisValue, callable,
68595 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68596 aRv.NoteJSContextException(cx);
68597 return;
68598 }
68599}
68600
68601void
68602TestJSImplInterfaceJSImpl::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68603{
68604 CallSetup s(this, aRv, "TestJSImplInterface.doEnforceRangeNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68605 if (aRv.Failed()) {
68606 return;
68607 }
68608 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68608); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68608; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68609 BindingCallContext& cx = s.GetCallContext();
68610
68611 JS::Rooted<JS::Value> rval(cx);
68612 JS::RootedVector<JS::Value> argv(cx);
68613 if (!argv.resize(1)) {
68614 // That threw an exception on the JSContext, and our CallSetup will do
68615 // the right thing with that.
68616 return;
68617 }
68618 unsigned argc = 1;
68619
68620 do {
68621 if (arg.IsNull()) {
68622 argv[0].setNull();
68623 break;
68624 }
68625 argv[0].setInt32(int32_t(arg.Value()));
68626 break;
68627 } while (false);
68628
68629 JS::Rooted<JS::Value> callable(cx);
68630 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68631 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68632 !InitIds(cx, atomsCache)) ||
68633 !GetCallableProperty(cx, atomsCache->doEnforceRangeNullable_id, &callable)) {
68634 aRv.Throw(NS_ERROR_UNEXPECTED);
68635 return;
68636 }
68637 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68638 if (!JS::Call(cx, thisValue, callable,
68639 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68640 aRv.NoteJSContextException(cx);
68641 return;
68642 }
68643}
68644
68645void
68646TestJSImplInterfaceJSImpl::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
68647{
68648 CallSetup s(this, aRv, "TestJSImplInterface.doClamp", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68649 if (aRv.Failed()) {
68650 return;
68651 }
68652 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68652); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68652; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68653 BindingCallContext& cx = s.GetCallContext();
68654
68655 JS::Rooted<JS::Value> rval(cx);
68656 JS::RootedVector<JS::Value> argv(cx);
68657 if (!argv.resize(1)) {
68658 // That threw an exception on the JSContext, and our CallSetup will do
68659 // the right thing with that.
68660 return;
68661 }
68662 unsigned argc = 1;
68663
68664 do {
68665 argv[0].setInt32(int32_t(arg));
68666 break;
68667 } while (false);
68668
68669 JS::Rooted<JS::Value> callable(cx);
68670 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68671 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68672 !InitIds(cx, atomsCache)) ||
68673 !GetCallableProperty(cx, atomsCache->doClamp_id, &callable)) {
68674 aRv.Throw(NS_ERROR_UNEXPECTED);
68675 return;
68676 }
68677 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68678 if (!JS::Call(cx, thisValue, callable,
68679 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68680 aRv.NoteJSContextException(cx);
68681 return;
68682 }
68683}
68684
68685void
68686TestJSImplInterfaceJSImpl::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
68687{
68688 CallSetup s(this, aRv, "TestJSImplInterface.doClampNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68689 if (aRv.Failed()) {
68690 return;
68691 }
68692 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68692); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68692; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68693 BindingCallContext& cx = s.GetCallContext();
68694
68695 JS::Rooted<JS::Value> rval(cx);
68696 JS::RootedVector<JS::Value> argv(cx);
68697 if (!argv.resize(1)) {
68698 // That threw an exception on the JSContext, and our CallSetup will do
68699 // the right thing with that.
68700 return;
68701 }
68702 unsigned argc = 1;
68703
68704 do {
68705 if (arg.IsNull()) {
68706 argv[0].setNull();
68707 break;
68708 }
68709 argv[0].setInt32(int32_t(arg.Value()));
68710 break;
68711 } while (false);
68712
68713 JS::Rooted<JS::Value> callable(cx);
68714 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68715 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68716 !InitIds(cx, atomsCache)) ||
68717 !GetCallableProperty(cx, atomsCache->doClampNullable_id, &callable)) {
68718 aRv.Throw(NS_ERROR_UNEXPECTED);
68719 return;
68720 }
68721 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68722 if (!JS::Call(cx, thisValue, callable,
68723 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68724 aRv.NoteJSContextException(cx);
68725 return;
68726 }
68727}
68728
68729void
68730TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
68731{
68732 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68733 if (aRv.Failed()) {
68734 return;
68735 }
68736 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68736); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68736; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68737 BindingCallContext& cx = s.GetCallContext();
68738
68739 JS::Rooted<JS::Value> rval(cx);
68740 JS::RootedVector<JS::Value> argv(cx);
68741 if (!argv.resize(1)) {
68742 // That threw an exception on the JSContext, and our CallSetup will do
68743 // the right thing with that.
68744 return;
68745 }
68746 unsigned argc = 1;
68747
68748 do {
68749 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
68750 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 68750); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 68750; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68751 aRv.Throw(NS_ERROR_UNEXPECTED);
68752 return;
68753 }
68754 break;
68755 } while (false);
68756
68757 JS::Rooted<JS::Value> callable(cx);
68758 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68759 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68760 !InitIds(cx, atomsCache)) ||
68761 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces1_id, &callable)) {
68762 aRv.Throw(NS_ERROR_UNEXPECTED);
68763 return;
68764 }
68765 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68766 if (!JS::Call(cx, thisValue, callable,
68767 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68768 aRv.NoteJSContextException(cx);
68769 return;
68770 }
68771}
68772
68773already_AddRefed<TestJSImplInterface>
68774TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
68775{
68776 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68777 if (aRv.Failed()) {
68778 return nullptr;
68779 }
68780 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68780); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68780; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68781 BindingCallContext& cx = s.GetCallContext();
68782
68783 JS::Rooted<JS::Value> rval(cx);
68784 JS::RootedVector<JS::Value> argv(cx);
68785 if (!argv.resize(1)) {
68786 // That threw an exception on the JSContext, and our CallSetup will do
68787 // the right thing with that.
68788 return nullptr;
68789 }
68790 unsigned argc = 1;
68791
68792 do {
68793 if (!arg) {
68794 argv[0].setNull();
68795 break;
68796 }
68797 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
68798 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 68798); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 68798; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68799 aRv.Throw(NS_ERROR_UNEXPECTED);
68800 return nullptr;
68801 }
68802 break;
68803 } while (false);
68804
68805 JS::Rooted<JS::Value> callable(cx);
68806 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68807 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68808 !InitIds(cx, atomsCache)) ||
68809 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces2_id, &callable)) {
68810 aRv.Throw(NS_ERROR_UNEXPECTED);
68811 return nullptr;
68812 }
68813 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68814 if (!JS::Call(cx, thisValue, callable,
68815 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68816 aRv.NoteJSContextException(cx);
68817 return nullptr;
68818 }
68819 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
68820 if (rval.isObject()) {
68821 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
68822 {
68823 // Our JSContext should be in the right global to do unwrapping in.
68824 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
68825 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
68826 // Be careful to not wrap random DOM objects here, even if
68827 // they're wrapped in opaque security wrappers for some reason.
68828 // XXXbz Wish we could check for a JS-implemented object
68829 // that already has a content reflection...
68830 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
68831 nsCOMPtr<nsIGlobalObject> contentGlobal;
68832 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
68833 if (!callback ||
68834 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
68835 aRv.Throw(NS_ERROR_UNEXPECTED);
68836 return nullptr;
68837 }
68838 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
68839 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 68840); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 68840; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
68840 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 68840); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 68840; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
68841 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
68842 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
68843 } else {
68844 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2", "TestJSImplInterface");
68845 aRv.Throw(NS_ERROR_UNEXPECTED);
68846 return nullptr;
68847 }
68848 }
68849 }
68850 } else {
68851 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.exerciseTypedefInterfaces2");
68852 aRv.Throw(NS_ERROR_UNEXPECTED);
68853 return nullptr;
68854 }
68855 return rvalDecl.forget();
68856}
68857
68858void
68859TestJSImplInterfaceJSImpl::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
68860{
68861 CallSetup s(this, aRv, "TestJSImplInterface.exerciseTypedefInterfaces3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68862 if (aRv.Failed()) {
68863 return;
68864 }
68865 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68865); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68865; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68866 BindingCallContext& cx = s.GetCallContext();
68867
68868 JS::Rooted<JS::Value> rval(cx);
68869 JS::RootedVector<JS::Value> argv(cx);
68870 if (!argv.resize(1)) {
68871 // That threw an exception on the JSContext, and our CallSetup will do
68872 // the right thing with that.
68873 return;
68874 }
68875 unsigned argc = 1;
68876
68877 do {
68878 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
68879 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 68879); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 68879; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68880 aRv.Throw(NS_ERROR_UNEXPECTED);
68881 return;
68882 }
68883 break;
68884 } while (false);
68885
68886 JS::Rooted<JS::Value> callable(cx);
68887 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68888 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68889 !InitIds(cx, atomsCache)) ||
68890 !GetCallableProperty(cx, atomsCache->exerciseTypedefInterfaces3_id, &callable)) {
68891 aRv.Throw(NS_ERROR_UNEXPECTED);
68892 return;
68893 }
68894 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68895 if (!JS::Call(cx, thisValue, callable,
68896 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68897 aRv.NoteJSContextException(cx);
68898 return;
68899 }
68900}
68901
68902int8_t
68903TestJSImplInterfaceJSImpl::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm)
68904{
68905 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68906 if (aRv.Failed()) {
68907 return int8_t(0);
68908 }
68909 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68909); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68909; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68910 BindingCallContext& cx = s.GetCallContext();
68911
68912 JS::Rooted<JS::Value> rval(cx);
68913
68914 JS::Rooted<JS::Value> callable(cx);
68915 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68916 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68917 !InitIds(cx, atomsCache)) ||
68918 !GetCallableProperty(cx, atomsCache->deprecatedMethod_id, &callable)) {
68919 aRv.Throw(NS_ERROR_UNEXPECTED);
68920 return int8_t(0);
68921 }
68922 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68923 if (!JS::Call(cx, thisValue, callable,
68924 JS::HandleValueArray::empty(), &rval)) {
68925 aRv.NoteJSContextException(cx);
68926 return int8_t(0);
68927 }
68928 int8_t rvalDecl;
68929 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedMethod", &rvalDecl)) {
68930 aRv.Throw(NS_ERROR_UNEXPECTED);
68931 return int8_t(0);
68932 }
68933 return rvalDecl;
68934}
68935
68936void
68937TestJSImplInterfaceJSImpl::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
68938{
68939 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedMethodWithContext", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68940 if (aRv.Failed()) {
68941 return;
68942 }
68943 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68943); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68943; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68944 BindingCallContext& cx = s.GetCallContext();
68945
68946 JS::Rooted<JS::Value> rval(cx);
68947 JS::RootedVector<JS::Value> argv(cx);
68948 if (!argv.resize(1)) {
68949 // That threw an exception on the JSContext, and our CallSetup will do
68950 // the right thing with that.
68951 return;
68952 }
68953 unsigned argc = 1;
68954
68955 do {
68956 JS::ExposeValueToActiveJS(arg);
68957 argv[0].set(arg);
68958 if (!MaybeWrapValue(cx, argv[0])) {
68959 aRv.Throw(NS_ERROR_UNEXPECTED);
68960 return;
68961 }
68962 break;
68963 } while (false);
68964
68965 JS::Rooted<JS::Value> callable(cx);
68966 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
68967 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
68968 !InitIds(cx, atomsCache)) ||
68969 !GetCallableProperty(cx, atomsCache->deprecatedMethodWithContext_id, &callable)) {
68970 aRv.Throw(NS_ERROR_UNEXPECTED);
68971 return;
68972 }
68973 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
68974 if (!JS::Call(cx, thisValue, callable,
68975 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
68976 aRv.NoteJSContextException(cx);
68977 return;
68978 }
68979}
68980
68981bool
68982TestJSImplInterfaceJSImpl::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
68983{
68984 CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
68985 if (aRv.Failed()) {
68986 return bool(0);
68987 }
68988 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 68988); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 68988; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
68989 BindingCallContext& cx = s.GetCallContext();
68990
68991 JS::Rooted<JS::Value> rval(cx);
68992 JS::RootedVector<JS::Value> argv(cx);
68993 if (!argv.resize(1)) {
68994 // That threw an exception on the JSContext, and our CallSetup will do
68995 // the right thing with that.
68996 return bool(0);
68997 }
68998 unsigned argc = 1;
68999
69000 do {
69001 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69002 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69002); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69002; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69003 aRv.Throw(NS_ERROR_UNEXPECTED);
69004 return bool(0);
69005 }
69006 break;
69007 } while (false);
69008
69009 JS::Rooted<JS::Value> callable(cx);
69010 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69011 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69012 !InitIds(cx, atomsCache)) ||
69013 !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) {
69014 aRv.Throw(NS_ERROR_UNEXPECTED);
69015 return bool(0);
69016 }
69017 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69018 if (!JS::Call(cx, thisValue, callable,
69019 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69020 aRv.NoteJSContextException(cx);
69021 return bool(0);
69022 }
69023 bool rvalDecl;
69024 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.overload1", &rvalDecl)) {
69025 aRv.Throw(NS_ERROR_UNEXPECTED);
69026 return bool(0);
69027 }
69028 return rvalDecl;
69029}
69030
69031already_AddRefed<TestJSImplInterface>
69032TestJSImplInterfaceJSImpl::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69033{
69034 CallSetup s(this, aRv, "TestJSImplInterface.overload1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69035 if (aRv.Failed()) {
69036 return nullptr;
69037 }
69038 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69038); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69038; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69039 BindingCallContext& cx = s.GetCallContext();
69040
69041 JS::Rooted<JS::Value> rval(cx);
69042 JS::RootedVector<JS::Value> argv(cx);
69043 if (!argv.resize(2)) {
69044 // That threw an exception on the JSContext, and our CallSetup will do
69045 // the right thing with that.
69046 return nullptr;
69047 }
69048 unsigned argc = 2;
69049
69050 do {
69051 if (!GetOrCreateDOMReflector(cx, arg, argv[1])) {
69052 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69052); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69052; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69053 aRv.Throw(NS_ERROR_UNEXPECTED);
69054 return nullptr;
69055 }
69056 break;
69057 } while (false);
69058
69059 do {
69060 if (!xpc::NonVoidStringToJsval(cx, strs, argv[0])) {
69061 aRv.Throw(NS_ERROR_UNEXPECTED);
69062 return nullptr;
69063 }
69064 break;
69065 } while (false);
69066
69067 JS::Rooted<JS::Value> callable(cx);
69068 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69069 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69070 !InitIds(cx, atomsCache)) ||
69071 !GetCallableProperty(cx, atomsCache->overload1_id, &callable)) {
69072 aRv.Throw(NS_ERROR_UNEXPECTED);
69073 return nullptr;
69074 }
69075 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69076 if (!JS::Call(cx, thisValue, callable,
69077 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69078 aRv.NoteJSContextException(cx);
69079 return nullptr;
69080 }
69081 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
69082 if (rval.isObject()) {
69083 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
69084 {
69085 // Our JSContext should be in the right global to do unwrapping in.
69086 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
69087 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
69088 // Be careful to not wrap random DOM objects here, even if
69089 // they're wrapped in opaque security wrappers for some reason.
69090 // XXXbz Wish we could check for a JS-implemented object
69091 // that already has a content reflection...
69092 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
69093 nsCOMPtr<nsIGlobalObject> contentGlobal;
69094 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
69095 if (!callback ||
69096 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
69097 aRv.Throw(NS_ERROR_UNEXPECTED);
69098 return nullptr;
69099 }
69100 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
69101 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 69102); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 69102; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
69102 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 69102); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 69102; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
69103 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
69104 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
69105 } else {
69106 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.overload1", "TestJSImplInterface");
69107 aRv.Throw(NS_ERROR_UNEXPECTED);
69108 return nullptr;
69109 }
69110 }
69111 }
69112 } else {
69113 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.overload1");
69114 aRv.Throw(NS_ERROR_UNEXPECTED);
69115 return nullptr;
69116 }
69117 return rvalDecl.forget();
69118}
69119
69120void
69121TestJSImplInterfaceJSImpl::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69122{
69123 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69124 if (aRv.Failed()) {
69125 return;
69126 }
69127 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69127); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69127; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69128 BindingCallContext& cx = s.GetCallContext();
69129
69130 JS::Rooted<JS::Value> rval(cx);
69131 JS::RootedVector<JS::Value> argv(cx);
69132 if (!argv.resize(1)) {
69133 // That threw an exception on the JSContext, and our CallSetup will do
69134 // the right thing with that.
69135 return;
69136 }
69137 unsigned argc = 1;
69138
69139 do {
69140 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69141 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69141); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69141; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69142 aRv.Throw(NS_ERROR_UNEXPECTED);
69143 return;
69144 }
69145 break;
69146 } while (false);
69147
69148 JS::Rooted<JS::Value> callable(cx);
69149 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69150 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69151 !InitIds(cx, atomsCache)) ||
69152 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69153 aRv.Throw(NS_ERROR_UNEXPECTED);
69154 return;
69155 }
69156 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69157 if (!JS::Call(cx, thisValue, callable,
69158 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69159 aRv.NoteJSContextException(cx);
69160 return;
69161 }
69162}
69163
69164void
69165TestJSImplInterfaceJSImpl::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
69166{
69167 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69168 if (aRv.Failed()) {
69169 return;
69170 }
69171 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69171); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69171; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69172 BindingCallContext& cx = s.GetCallContext();
69173
69174 JS::Rooted<JS::Value> rval(cx);
69175 JS::RootedVector<JS::Value> argv(cx);
69176 if (!argv.resize(1)) {
69177 // That threw an exception on the JSContext, and our CallSetup will do
69178 // the right thing with that.
69179 return;
69180 }
69181 unsigned argc = 1;
69182
69183 do {
69184 if (!arg.ToObjectInternal(cx, argv[0])) {
69185 aRv.Throw(NS_ERROR_UNEXPECTED);
69186 return;
69187 }
69188 break;
69189 } while (false);
69190
69191 JS::Rooted<JS::Value> callable(cx);
69192 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69193 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69194 !InitIds(cx, atomsCache)) ||
69195 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69196 aRv.Throw(NS_ERROR_UNEXPECTED);
69197 return;
69198 }
69199 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69200 if (!JS::Call(cx, thisValue, callable,
69201 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69202 aRv.NoteJSContextException(cx);
69203 return;
69204 }
69205}
69206
69207void
69208TestJSImplInterfaceJSImpl::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69209{
69210 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69211 if (aRv.Failed()) {
69212 return;
69213 }
69214 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69214); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69214; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69215 BindingCallContext& cx = s.GetCallContext();
69216
69217 JS::Rooted<JS::Value> rval(cx);
69218 JS::RootedVector<JS::Value> argv(cx);
69219 if (!argv.resize(1)) {
69220 // That threw an exception on the JSContext, and our CallSetup will do
69221 // the right thing with that.
69222 return;
69223 }
69224 unsigned argc = 1;
69225
69226 do {
69227 argv[0].setBoolean(arg);
69228 break;
69229 } while (false);
69230
69231 JS::Rooted<JS::Value> callable(cx);
69232 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69233 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69234 !InitIds(cx, atomsCache)) ||
69235 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69236 aRv.Throw(NS_ERROR_UNEXPECTED);
69237 return;
69238 }
69239 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69240 if (!JS::Call(cx, thisValue, callable,
69241 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69242 aRv.NoteJSContextException(cx);
69243 return;
69244 }
69245}
69246
69247void
69248TestJSImplInterfaceJSImpl::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69249{
69250 CallSetup s(this, aRv, "TestJSImplInterface.overload2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69251 if (aRv.Failed()) {
69252 return;
69253 }
69254 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69254); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69254; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69255 BindingCallContext& cx = s.GetCallContext();
69256
69257 JS::Rooted<JS::Value> rval(cx);
69258 JS::RootedVector<JS::Value> argv(cx);
69259 if (!argv.resize(1)) {
69260 // That threw an exception on the JSContext, and our CallSetup will do
69261 // the right thing with that.
69262 return;
69263 }
69264 unsigned argc = 1;
69265
69266 do {
69267 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
69268 aRv.Throw(NS_ERROR_UNEXPECTED);
69269 return;
69270 }
69271 break;
69272 } while (false);
69273
69274 JS::Rooted<JS::Value> callable(cx);
69275 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69276 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69277 !InitIds(cx, atomsCache)) ||
69278 !GetCallableProperty(cx, atomsCache->overload2_id, &callable)) {
69279 aRv.Throw(NS_ERROR_UNEXPECTED);
69280 return;
69281 }
69282 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69283 if (!JS::Call(cx, thisValue, callable,
69284 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69285 aRv.NoteJSContextException(cx);
69286 return;
69287 }
69288}
69289
69290void
69291TestJSImplInterfaceJSImpl::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69292{
69293 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69294 if (aRv.Failed()) {
69295 return;
69296 }
69297 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69297); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69297; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69298 BindingCallContext& cx = s.GetCallContext();
69299
69300 JS::Rooted<JS::Value> rval(cx);
69301 JS::RootedVector<JS::Value> argv(cx);
69302 if (!argv.resize(1)) {
69303 // That threw an exception on the JSContext, and our CallSetup will do
69304 // the right thing with that.
69305 return;
69306 }
69307 unsigned argc = 1;
69308
69309 do {
69310 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69311 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69311); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69311; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69312 aRv.Throw(NS_ERROR_UNEXPECTED);
69313 return;
69314 }
69315 break;
69316 } while (false);
69317
69318 JS::Rooted<JS::Value> callable(cx);
69319 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69320 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69321 !InitIds(cx, atomsCache)) ||
69322 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69323 aRv.Throw(NS_ERROR_UNEXPECTED);
69324 return;
69325 }
69326 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69327 if (!JS::Call(cx, thisValue, callable,
69328 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69329 aRv.NoteJSContextException(cx);
69330 return;
69331 }
69332}
69333
69334void
69335TestJSImplInterfaceJSImpl::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
69336{
69337 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69338 if (aRv.Failed()) {
69339 return;
69340 }
69341 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69341); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69341; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69342 BindingCallContext& cx = s.GetCallContext();
69343
69344 JS::Rooted<JS::Value> rval(cx);
69345 JS::RootedVector<JS::Value> argv(cx);
69346 if (!argv.resize(1)) {
69347 // That threw an exception on the JSContext, and our CallSetup will do
69348 // the right thing with that.
69349 return;
69350 }
69351 unsigned argc = 1;
69352
69353 do {
69354 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
69355 if (!MaybeWrapObjectValue(cx, argv[0])) {
69356 aRv.Throw(NS_ERROR_UNEXPECTED);
69357 return;
69358 }
69359 break;
69360 } while (false);
69361
69362 JS::Rooted<JS::Value> callable(cx);
69363 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69364 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69365 !InitIds(cx, atomsCache)) ||
69366 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69367 aRv.Throw(NS_ERROR_UNEXPECTED);
69368 return;
69369 }
69370 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69371 if (!JS::Call(cx, thisValue, callable,
69372 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69373 aRv.NoteJSContextException(cx);
69374 return;
69375 }
69376}
69377
69378void
69379TestJSImplInterfaceJSImpl::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69380{
69381 CallSetup s(this, aRv, "TestJSImplInterface.overload3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69382 if (aRv.Failed()) {
69383 return;
69384 }
69385 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69385); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69385; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69386 BindingCallContext& cx = s.GetCallContext();
69387
69388 JS::Rooted<JS::Value> rval(cx);
69389 JS::RootedVector<JS::Value> argv(cx);
69390 if (!argv.resize(1)) {
69391 // That threw an exception on the JSContext, and our CallSetup will do
69392 // the right thing with that.
69393 return;
69394 }
69395 unsigned argc = 1;
69396
69397 do {
69398 argv[0].setBoolean(arg);
69399 break;
69400 } while (false);
69401
69402 JS::Rooted<JS::Value> callable(cx);
69403 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69404 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69405 !InitIds(cx, atomsCache)) ||
69406 !GetCallableProperty(cx, atomsCache->overload3_id, &callable)) {
69407 aRv.Throw(NS_ERROR_UNEXPECTED);
69408 return;
69409 }
69410 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69411 if (!JS::Call(cx, thisValue, callable,
69412 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69413 aRv.NoteJSContextException(cx);
69414 return;
69415 }
69416}
69417
69418void
69419TestJSImplInterfaceJSImpl::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69420{
69421 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69422 if (aRv.Failed()) {
69423 return;
69424 }
69425 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69425); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69425; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69426 BindingCallContext& cx = s.GetCallContext();
69427
69428 JS::Rooted<JS::Value> rval(cx);
69429 JS::RootedVector<JS::Value> argv(cx);
69430 if (!argv.resize(1)) {
69431 // That threw an exception on the JSContext, and our CallSetup will do
69432 // the right thing with that.
69433 return;
69434 }
69435 unsigned argc = 1;
69436
69437 do {
69438 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69439 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69439); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69439; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69440 aRv.Throw(NS_ERROR_UNEXPECTED);
69441 return;
69442 }
69443 break;
69444 } while (false);
69445
69446 JS::Rooted<JS::Value> callable(cx);
69447 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69448 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69449 !InitIds(cx, atomsCache)) ||
69450 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69451 aRv.Throw(NS_ERROR_UNEXPECTED);
69452 return;
69453 }
69454 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69455 if (!JS::Call(cx, thisValue, callable,
69456 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69457 aRv.NoteJSContextException(cx);
69458 return;
69459 }
69460}
69461
69462void
69463TestJSImplInterfaceJSImpl::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69464{
69465 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69466 if (aRv.Failed()) {
69467 return;
69468 }
69469 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69469); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69469; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69470 BindingCallContext& cx = s.GetCallContext();
69471
69472 JS::Rooted<JS::Value> rval(cx);
69473 JS::RootedVector<JS::Value> argv(cx);
69474 if (!argv.resize(1)) {
69475 // That threw an exception on the JSContext, and our CallSetup will do
69476 // the right thing with that.
69477 return;
69478 }
69479 unsigned argc = 1;
69480
69481 do {
69482 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
69483 if (!MaybeWrapObjectValue(cx, argv[0])) {
69484 aRv.Throw(NS_ERROR_UNEXPECTED);
69485 return;
69486 }
69487 break;
69488 } while (false);
69489
69490 JS::Rooted<JS::Value> callable(cx);
69491 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69492 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69493 !InitIds(cx, atomsCache)) ||
69494 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69495 aRv.Throw(NS_ERROR_UNEXPECTED);
69496 return;
69497 }
69498 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69499 if (!JS::Call(cx, thisValue, callable,
69500 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69501 aRv.NoteJSContextException(cx);
69502 return;
69503 }
69504}
69505
69506void
69507TestJSImplInterfaceJSImpl::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69508{
69509 CallSetup s(this, aRv, "TestJSImplInterface.overload4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69510 if (aRv.Failed()) {
69511 return;
69512 }
69513 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69513); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69513; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69514 BindingCallContext& cx = s.GetCallContext();
69515
69516 JS::Rooted<JS::Value> rval(cx);
69517 JS::RootedVector<JS::Value> argv(cx);
69518 if (!argv.resize(1)) {
69519 // That threw an exception on the JSContext, and our CallSetup will do
69520 // the right thing with that.
69521 return;
69522 }
69523 unsigned argc = 1;
69524
69525 do {
69526 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
69527 aRv.Throw(NS_ERROR_UNEXPECTED);
69528 return;
69529 }
69530 break;
69531 } while (false);
69532
69533 JS::Rooted<JS::Value> callable(cx);
69534 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69535 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69536 !InitIds(cx, atomsCache)) ||
69537 !GetCallableProperty(cx, atomsCache->overload4_id, &callable)) {
69538 aRv.Throw(NS_ERROR_UNEXPECTED);
69539 return;
69540 }
69541 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69542 if (!JS::Call(cx, thisValue, callable,
69543 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69544 aRv.NoteJSContextException(cx);
69545 return;
69546 }
69547}
69548
69549void
69550TestJSImplInterfaceJSImpl::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69551{
69552 CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69553 if (aRv.Failed()) {
69554 return;
69555 }
69556 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69556); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69556; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69557 BindingCallContext& cx = s.GetCallContext();
69558
69559 JS::Rooted<JS::Value> rval(cx);
69560 JS::RootedVector<JS::Value> argv(cx);
69561 if (!argv.resize(1)) {
69562 // That threw an exception on the JSContext, and our CallSetup will do
69563 // the right thing with that.
69564 return;
69565 }
69566 unsigned argc = 1;
69567
69568 do {
69569 argv[0].setInt32(int32_t(arg));
69570 break;
69571 } while (false);
69572
69573 JS::Rooted<JS::Value> callable(cx);
69574 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69575 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69576 !InitIds(cx, atomsCache)) ||
69577 !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) {
69578 aRv.Throw(NS_ERROR_UNEXPECTED);
69579 return;
69580 }
69581 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69582 if (!JS::Call(cx, thisValue, callable,
69583 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69584 aRv.NoteJSContextException(cx);
69585 return;
69586 }
69587}
69588
69589void
69590TestJSImplInterfaceJSImpl::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
69591{
69592 CallSetup s(this, aRv, "TestJSImplInterface.overload5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69593 if (aRv.Failed()) {
69594 return;
69595 }
69596 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69596); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69596; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69597 BindingCallContext& cx = s.GetCallContext();
69598
69599 JS::Rooted<JS::Value> rval(cx);
69600 JS::RootedVector<JS::Value> argv(cx);
69601 if (!argv.resize(1)) {
69602 // That threw an exception on the JSContext, and our CallSetup will do
69603 // the right thing with that.
69604 return;
69605 }
69606 unsigned argc = 1;
69607
69608 do {
69609 if (!ToJSValue(cx, arg, argv[0])) {
69610 aRv.Throw(NS_ERROR_UNEXPECTED);
69611 return;
69612 }
69613 break;
69614 } while (false);
69615
69616 JS::Rooted<JS::Value> callable(cx);
69617 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69618 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69619 !InitIds(cx, atomsCache)) ||
69620 !GetCallableProperty(cx, atomsCache->overload5_id, &callable)) {
69621 aRv.Throw(NS_ERROR_UNEXPECTED);
69622 return;
69623 }
69624 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69625 if (!JS::Call(cx, thisValue, callable,
69626 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69627 aRv.NoteJSContextException(cx);
69628 return;
69629 }
69630}
69631
69632void
69633TestJSImplInterfaceJSImpl::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69634{
69635 CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69636 if (aRv.Failed()) {
69637 return;
69638 }
69639 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69639); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69639; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69640 BindingCallContext& cx = s.GetCallContext();
69641
69642 JS::Rooted<JS::Value> rval(cx);
69643 JS::RootedVector<JS::Value> argv(cx);
69644 if (!argv.resize(1)) {
69645 // That threw an exception on the JSContext, and our CallSetup will do
69646 // the right thing with that.
69647 return;
69648 }
69649 unsigned argc = 1;
69650
69651 do {
69652 argv[0].setInt32(int32_t(arg));
69653 break;
69654 } while (false);
69655
69656 JS::Rooted<JS::Value> callable(cx);
69657 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69658 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69659 !InitIds(cx, atomsCache)) ||
69660 !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) {
69661 aRv.Throw(NS_ERROR_UNEXPECTED);
69662 return;
69663 }
69664 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69665 if (!JS::Call(cx, thisValue, callable,
69666 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69667 aRv.NoteJSContextException(cx);
69668 return;
69669 }
69670}
69671
69672void
69673TestJSImplInterfaceJSImpl::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69674{
69675 CallSetup s(this, aRv, "TestJSImplInterface.overload6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69676 if (aRv.Failed()) {
69677 return;
69678 }
69679 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69679); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69679; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69680 BindingCallContext& cx = s.GetCallContext();
69681
69682 JS::Rooted<JS::Value> rval(cx);
69683 JS::RootedVector<JS::Value> argv(cx);
69684 if (!argv.resize(1)) {
69685 // That threw an exception on the JSContext, and our CallSetup will do
69686 // the right thing with that.
69687 return;
69688 }
69689 unsigned argc = 1;
69690
69691 do {
69692 argv[0].setBoolean(arg);
69693 break;
69694 } while (false);
69695
69696 JS::Rooted<JS::Value> callable(cx);
69697 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69698 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69699 !InitIds(cx, atomsCache)) ||
69700 !GetCallableProperty(cx, atomsCache->overload6_id, &callable)) {
69701 aRv.Throw(NS_ERROR_UNEXPECTED);
69702 return;
69703 }
69704 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69705 if (!JS::Call(cx, thisValue, callable,
69706 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69707 aRv.NoteJSContextException(cx);
69708 return;
69709 }
69710}
69711
69712void
69713TestJSImplInterfaceJSImpl::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69714{
69715 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69716 if (aRv.Failed()) {
69717 return;
69718 }
69719 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69719); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69719; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69720 BindingCallContext& cx = s.GetCallContext();
69721
69722 JS::Rooted<JS::Value> rval(cx);
69723 JS::RootedVector<JS::Value> argv(cx);
69724 if (!argv.resize(1)) {
69725 // That threw an exception on the JSContext, and our CallSetup will do
69726 // the right thing with that.
69727 return;
69728 }
69729 unsigned argc = 1;
69730
69731 do {
69732 argv[0].setInt32(int32_t(arg));
69733 break;
69734 } while (false);
69735
69736 JS::Rooted<JS::Value> callable(cx);
69737 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69738 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69739 !InitIds(cx, atomsCache)) ||
69740 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69741 aRv.Throw(NS_ERROR_UNEXPECTED);
69742 return;
69743 }
69744 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69745 if (!JS::Call(cx, thisValue, callable,
69746 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69747 aRv.NoteJSContextException(cx);
69748 return;
69749 }
69750}
69751
69752void
69753TestJSImplInterfaceJSImpl::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
69754{
69755 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69756 if (aRv.Failed()) {
69757 return;
69758 }
69759 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69759); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69759; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69760 BindingCallContext& cx = s.GetCallContext();
69761
69762 JS::Rooted<JS::Value> rval(cx);
69763 JS::RootedVector<JS::Value> argv(cx);
69764 if (!argv.resize(1)) {
69765 // That threw an exception on the JSContext, and our CallSetup will do
69766 // the right thing with that.
69767 return;
69768 }
69769 unsigned argc = 1;
69770
69771 do {
69772 argv[0].setBoolean(arg);
69773 break;
69774 } while (false);
69775
69776 JS::Rooted<JS::Value> callable(cx);
69777 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69778 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69779 !InitIds(cx, atomsCache)) ||
69780 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69781 aRv.Throw(NS_ERROR_UNEXPECTED);
69782 return;
69783 }
69784 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69785 if (!JS::Call(cx, thisValue, callable,
69786 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69787 aRv.NoteJSContextException(cx);
69788 return;
69789 }
69790}
69791
69792void
69793TestJSImplInterfaceJSImpl::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69794{
69795 CallSetup s(this, aRv, "TestJSImplInterface.overload7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69796 if (aRv.Failed()) {
69797 return;
69798 }
69799 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69799); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69799; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69800 BindingCallContext& cx = s.GetCallContext();
69801
69802 JS::Rooted<JS::Value> rval(cx);
69803 JS::RootedVector<JS::Value> argv(cx);
69804 if (!argv.resize(1)) {
69805 // That threw an exception on the JSContext, and our CallSetup will do
69806 // the right thing with that.
69807 return;
69808 }
69809 unsigned argc = 1;
69810
69811 do {
69812 if (!NonVoidByteStringToJsval(cx, arg, argv[0])) {
69813 aRv.Throw(NS_ERROR_UNEXPECTED);
69814 return;
69815 }
69816 break;
69817 } while (false);
69818
69819 JS::Rooted<JS::Value> callable(cx);
69820 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69821 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69822 !InitIds(cx, atomsCache)) ||
69823 !GetCallableProperty(cx, atomsCache->overload7_id, &callable)) {
69824 aRv.Throw(NS_ERROR_UNEXPECTED);
69825 return;
69826 }
69827 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69828 if (!JS::Call(cx, thisValue, callable,
69829 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69830 aRv.NoteJSContextException(cx);
69831 return;
69832 }
69833}
69834
69835void
69836TestJSImplInterfaceJSImpl::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
69837{
69838 CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69839 if (aRv.Failed()) {
69840 return;
69841 }
69842 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69842); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69842; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69843 BindingCallContext& cx = s.GetCallContext();
69844
69845 JS::Rooted<JS::Value> rval(cx);
69846 JS::RootedVector<JS::Value> argv(cx);
69847 if (!argv.resize(1)) {
69848 // That threw an exception on the JSContext, and our CallSetup will do
69849 // the right thing with that.
69850 return;
69851 }
69852 unsigned argc = 1;
69853
69854 do {
69855 argv[0].setInt32(int32_t(arg));
69856 break;
69857 } while (false);
69858
69859 JS::Rooted<JS::Value> callable(cx);
69860 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69861 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69862 !InitIds(cx, atomsCache)) ||
69863 !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) {
69864 aRv.Throw(NS_ERROR_UNEXPECTED);
69865 return;
69866 }
69867 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69868 if (!JS::Call(cx, thisValue, callable,
69869 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69870 aRv.NoteJSContextException(cx);
69871 return;
69872 }
69873}
69874
69875void
69876TestJSImplInterfaceJSImpl::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
69877{
69878 CallSetup s(this, aRv, "TestJSImplInterface.overload8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69879 if (aRv.Failed()) {
69880 return;
69881 }
69882 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69882); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69882; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69883 BindingCallContext& cx = s.GetCallContext();
69884
69885 JS::Rooted<JS::Value> rval(cx);
69886 JS::RootedVector<JS::Value> argv(cx);
69887 if (!argv.resize(1)) {
69888 // That threw an exception on the JSContext, and our CallSetup will do
69889 // the right thing with that.
69890 return;
69891 }
69892 unsigned argc = 1;
69893
69894 do {
69895 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
69896 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 69896); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 69896; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69897 aRv.Throw(NS_ERROR_UNEXPECTED);
69898 return;
69899 }
69900 break;
69901 } while (false);
69902
69903 JS::Rooted<JS::Value> callable(cx);
69904 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69905 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69906 !InitIds(cx, atomsCache)) ||
69907 !GetCallableProperty(cx, atomsCache->overload8_id, &callable)) {
69908 aRv.Throw(NS_ERROR_UNEXPECTED);
69909 return;
69910 }
69911 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69912 if (!JS::Call(cx, thisValue, callable,
69913 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69914 aRv.NoteJSContextException(cx);
69915 return;
69916 }
69917}
69918
69919void
69920TestJSImplInterfaceJSImpl::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
69921{
69922 CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69923 if (aRv.Failed()) {
69924 return;
69925 }
69926 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69926); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69926; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69927 BindingCallContext& cx = s.GetCallContext();
69928
69929 JS::Rooted<JS::Value> rval(cx);
69930 JS::RootedVector<JS::Value> argv(cx);
69931 if (!argv.resize(1)) {
69932 // That threw an exception on the JSContext, and our CallSetup will do
69933 // the right thing with that.
69934 return;
69935 }
69936 unsigned argc = 1;
69937
69938 do {
69939 if (arg.IsNull()) {
69940 argv[0].setNull();
69941 break;
69942 }
69943 argv[0].setInt32(int32_t(arg.Value()));
69944 break;
69945 } while (false);
69946
69947 JS::Rooted<JS::Value> callable(cx);
69948 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69949 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69950 !InitIds(cx, atomsCache)) ||
69951 !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) {
69952 aRv.Throw(NS_ERROR_UNEXPECTED);
69953 return;
69954 }
69955 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69956 if (!JS::Call(cx, thisValue, callable,
69957 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
69958 aRv.NoteJSContextException(cx);
69959 return;
69960 }
69961}
69962
69963void
69964TestJSImplInterfaceJSImpl::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
69965{
69966 CallSetup s(this, aRv, "TestJSImplInterface.overload9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
69967 if (aRv.Failed()) {
69968 return;
69969 }
69970 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 69970); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 69970; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
69971 BindingCallContext& cx = s.GetCallContext();
69972
69973 JS::Rooted<JS::Value> rval(cx);
69974 JS::RootedVector<JS::Value> argv(cx);
69975 if (!argv.resize(1)) {
69976 // That threw an exception on the JSContext, and our CallSetup will do
69977 // the right thing with that.
69978 return;
69979 }
69980 unsigned argc = 1;
69981
69982 do {
69983 if (!xpc::NonVoidStringToJsval(cx, arg, argv[0])) {
69984 aRv.Throw(NS_ERROR_UNEXPECTED);
69985 return;
69986 }
69987 break;
69988 } while (false);
69989
69990 JS::Rooted<JS::Value> callable(cx);
69991 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
69992 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
69993 !InitIds(cx, atomsCache)) ||
69994 !GetCallableProperty(cx, atomsCache->overload9_id, &callable)) {
69995 aRv.Throw(NS_ERROR_UNEXPECTED);
69996 return;
69997 }
69998 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
69999 if (!JS::Call(cx, thisValue, callable,
70000 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70001 aRv.NoteJSContextException(cx);
70002 return;
70003 }
70004}
70005
70006void
70007TestJSImplInterfaceJSImpl::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70008{
70009 CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70010 if (aRv.Failed()) {
70011 return;
70012 }
70013 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70013); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70013; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70014 BindingCallContext& cx = s.GetCallContext();
70015
70016 JS::Rooted<JS::Value> rval(cx);
70017 JS::RootedVector<JS::Value> argv(cx);
70018 if (!argv.resize(1)) {
70019 // That threw an exception on the JSContext, and our CallSetup will do
70020 // the right thing with that.
70021 return;
70022 }
70023 unsigned argc = 1;
70024
70025 do {
70026 if (arg.IsNull()) {
70027 argv[0].setNull();
70028 break;
70029 }
70030 argv[0].setInt32(int32_t(arg.Value()));
70031 break;
70032 } while (false);
70033
70034 JS::Rooted<JS::Value> callable(cx);
70035 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70036 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70037 !InitIds(cx, atomsCache)) ||
70038 !GetCallableProperty(cx, atomsCache->overload10_id, &callable)) {
70039 aRv.Throw(NS_ERROR_UNEXPECTED);
70040 return;
70041 }
70042 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70043 if (!JS::Call(cx, thisValue, callable,
70044 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70045 aRv.NoteJSContextException(cx);
70046 return;
70047 }
70048}
70049
70050void
70051TestJSImplInterfaceJSImpl::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
70052{
70053 CallSetup s(this, aRv, "TestJSImplInterface.overload10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70054 if (aRv.Failed()) {
70055 return;
70056 }
70057 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70057); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70057; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70058 BindingCallContext& cx = s.GetCallContext();
70059
70060 JS::Rooted<JS::Value> rval(cx);
70061 JS::RootedVector<JS::Value> argv(cx);
70062 if (!argv.resize(1)) {
70063 // That threw an exception on the JSContext, and our CallSetup will do
70064 // the right thing with that.
70065 return;
70066 }
70067 unsigned argc = 1;
70068
70069 do {
70070 JS::ExposeObjectToActiveJS(arg);
70071 argv[0].setObject(*arg);
70072 if (!MaybeWrapObjectValue(cx, argv[0])) {
70073 aRv.Throw(NS_ERROR_UNEXPECTED);
70074 return;
70075 }
70076 break;
70077 } while (false);
70078
70079 JS::Rooted<JS::Value> callable(cx);
70080 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70081 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70082 !InitIds(cx, atomsCache)) ||
70083 !GetCallableProperty(cx, atomsCache->overload10_id, &callable)) {
70084 aRv.Throw(NS_ERROR_UNEXPECTED);
70085 return;
70086 }
70087 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70088 if (!JS::Call(cx, thisValue, callable,
70089 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70090 aRv.NoteJSContextException(cx);
70091 return;
70092 }
70093}
70094
70095void
70096TestJSImplInterfaceJSImpl::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70097{
70098 CallSetup s(this, aRv, "TestJSImplInterface.overload11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70099 if (aRv.Failed()) {
70100 return;
70101 }
70102 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70102); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70102; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70103 BindingCallContext& cx = s.GetCallContext();
70104
70105 JS::Rooted<JS::Value> rval(cx);
70106 JS::RootedVector<JS::Value> argv(cx);
70107 if (!argv.resize(1)) {
70108 // That threw an exception on the JSContext, and our CallSetup will do
70109 // the right thing with that.
70110 return;
70111 }
70112 unsigned argc = 1;
70113
70114 do {
70115 argv[0].setInt32(int32_t(arg));
70116 break;
70117 } while (false);
70118
70119 JS::Rooted<JS::Value> callable(cx);
70120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70122 !InitIds(cx, atomsCache)) ||
70123 !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) {
70124 aRv.Throw(NS_ERROR_UNEXPECTED);
70125 return;
70126 }
70127 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70128 if (!JS::Call(cx, thisValue, callable,
70129 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70130 aRv.NoteJSContextException(cx);
70131 return;
70132 }
70133}
70134
70135void
70136TestJSImplInterfaceJSImpl::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
70137{
70138 CallSetup s(this, aRv, "TestJSImplInterface.overload11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70139 if (aRv.Failed()) {
70140 return;
70141 }
70142 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70142; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70143 BindingCallContext& cx = s.GetCallContext();
70144
70145 JS::Rooted<JS::Value> rval(cx);
70146 JS::RootedVector<JS::Value> argv(cx);
70147 if (!argv.resize(1)) {
70148 // That threw an exception on the JSContext, and our CallSetup will do
70149 // the right thing with that.
70150 return;
70151 }
70152 unsigned argc = 1;
70153
70154 do {
70155 if (!xpc::StringToJsval(cx, arg, argv[0])) {
70156 aRv.Throw(NS_ERROR_UNEXPECTED);
70157 return;
70158 }
70159 break;
70160 } while (false);
70161
70162 JS::Rooted<JS::Value> callable(cx);
70163 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70164 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70165 !InitIds(cx, atomsCache)) ||
70166 !GetCallableProperty(cx, atomsCache->overload11_id, &callable)) {
70167 aRv.Throw(NS_ERROR_UNEXPECTED);
70168 return;
70169 }
70170 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70171 if (!JS::Call(cx, thisValue, callable,
70172 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70173 aRv.NoteJSContextException(cx);
70174 return;
70175 }
70176}
70177
70178void
70179TestJSImplInterfaceJSImpl::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70180{
70181 CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70182 if (aRv.Failed()) {
70183 return;
70184 }
70185 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70185); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70185; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70186 BindingCallContext& cx = s.GetCallContext();
70187
70188 JS::Rooted<JS::Value> rval(cx);
70189 JS::RootedVector<JS::Value> argv(cx);
70190 if (!argv.resize(1)) {
70191 // That threw an exception on the JSContext, and our CallSetup will do
70192 // the right thing with that.
70193 return;
70194 }
70195 unsigned argc = 1;
70196
70197 do {
70198 argv[0].setInt32(int32_t(arg));
70199 break;
70200 } while (false);
70201
70202 JS::Rooted<JS::Value> callable(cx);
70203 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70204 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70205 !InitIds(cx, atomsCache)) ||
70206 !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) {
70207 aRv.Throw(NS_ERROR_UNEXPECTED);
70208 return;
70209 }
70210 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70211 if (!JS::Call(cx, thisValue, callable,
70212 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70213 aRv.NoteJSContextException(cx);
70214 return;
70215 }
70216}
70217
70218void
70219TestJSImplInterfaceJSImpl::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70220{
70221 CallSetup s(this, aRv, "TestJSImplInterface.overload12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70222 if (aRv.Failed()) {
70223 return;
70224 }
70225 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70225); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70225; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70226 BindingCallContext& cx = s.GetCallContext();
70227
70228 JS::Rooted<JS::Value> rval(cx);
70229 JS::RootedVector<JS::Value> argv(cx);
70230 if (!argv.resize(1)) {
70231 // That threw an exception on the JSContext, and our CallSetup will do
70232 // the right thing with that.
70233 return;
70234 }
70235 unsigned argc = 1;
70236
70237 do {
70238 if (arg.IsNull()) {
70239 argv[0].setNull();
70240 break;
70241 }
70242 argv[0].setBoolean(arg.Value());
70243 break;
70244 } while (false);
70245
70246 JS::Rooted<JS::Value> callable(cx);
70247 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70248 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70249 !InitIds(cx, atomsCache)) ||
70250 !GetCallableProperty(cx, atomsCache->overload12_id, &callable)) {
70251 aRv.Throw(NS_ERROR_UNEXPECTED);
70252 return;
70253 }
70254 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70255 if (!JS::Call(cx, thisValue, callable,
70256 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70257 aRv.NoteJSContextException(cx);
70258 return;
70259 }
70260}
70261
70262void
70263TestJSImplInterfaceJSImpl::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70264{
70265 CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70266 if (aRv.Failed()) {
70267 return;
70268 }
70269 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70269); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70269; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70270 BindingCallContext& cx = s.GetCallContext();
70271
70272 JS::Rooted<JS::Value> rval(cx);
70273 JS::RootedVector<JS::Value> argv(cx);
70274 if (!argv.resize(1)) {
70275 // That threw an exception on the JSContext, and our CallSetup will do
70276 // the right thing with that.
70277 return;
70278 }
70279 unsigned argc = 1;
70280
70281 do {
70282 if (arg.IsNull()) {
70283 argv[0].setNull();
70284 break;
70285 }
70286 argv[0].setInt32(int32_t(arg.Value()));
70287 break;
70288 } while (false);
70289
70290 JS::Rooted<JS::Value> callable(cx);
70291 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70292 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70293 !InitIds(cx, atomsCache)) ||
70294 !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) {
70295 aRv.Throw(NS_ERROR_UNEXPECTED);
70296 return;
70297 }
70298 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70299 if (!JS::Call(cx, thisValue, callable,
70300 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70301 aRv.NoteJSContextException(cx);
70302 return;
70303 }
70304}
70305
70306void
70307TestJSImplInterfaceJSImpl::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
70308{
70309 CallSetup s(this, aRv, "TestJSImplInterface.overload13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70310 if (aRv.Failed()) {
70311 return;
70312 }
70313 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70313); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70313; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70314 BindingCallContext& cx = s.GetCallContext();
70315
70316 JS::Rooted<JS::Value> rval(cx);
70317 JS::RootedVector<JS::Value> argv(cx);
70318 if (!argv.resize(1)) {
70319 // That threw an exception on the JSContext, and our CallSetup will do
70320 // the right thing with that.
70321 return;
70322 }
70323 unsigned argc = 1;
70324
70325 do {
70326 argv[0].setBoolean(arg);
70327 break;
70328 } while (false);
70329
70330 JS::Rooted<JS::Value> callable(cx);
70331 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70332 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70333 !InitIds(cx, atomsCache)) ||
70334 !GetCallableProperty(cx, atomsCache->overload13_id, &callable)) {
70335 aRv.Throw(NS_ERROR_UNEXPECTED);
70336 return;
70337 }
70338 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70339 if (!JS::Call(cx, thisValue, callable,
70340 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70341 aRv.NoteJSContextException(cx);
70342 return;
70343 }
70344}
70345
70346void
70347TestJSImplInterfaceJSImpl::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70348{
70349 CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70350 if (aRv.Failed()) {
70351 return;
70352 }
70353 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70353); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70353; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70354 BindingCallContext& cx = s.GetCallContext();
70355
70356 JS::Rooted<JS::Value> rval(cx);
70357 JS::RootedVector<JS::Value> argv(cx);
70358 if (!argv.resize(1)) {
70359 // That threw an exception on the JSContext, and our CallSetup will do
70360 // the right thing with that.
70361 return;
70362 }
70363 unsigned argc = 1;
70364
70365 do {
70366 if (arg.WasPassed()) {
70367 argv[0].setInt32(int32_t(arg.Value()));
70368 break;
70369 } else if (argc == 1) {
70370 // This is our current trailing argument; reduce argc
70371 --argc;
70372 } else {
70373 argv[0].setUndefined();
70374 }
70375 } while (false);
70376
70377 JS::Rooted<JS::Value> callable(cx);
70378 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70379 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70380 !InitIds(cx, atomsCache)) ||
70381 !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) {
70382 aRv.Throw(NS_ERROR_UNEXPECTED);
70383 return;
70384 }
70385 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70386 if (!JS::Call(cx, thisValue, callable,
70387 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70388 aRv.NoteJSContextException(cx);
70389 return;
70390 }
70391}
70392
70393void
70394TestJSImplInterfaceJSImpl::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
70395{
70396 CallSetup s(this, aRv, "TestJSImplInterface.overload14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70397 if (aRv.Failed()) {
70398 return;
70399 }
70400 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70400); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70400; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70401 BindingCallContext& cx = s.GetCallContext();
70402
70403 JS::Rooted<JS::Value> rval(cx);
70404 JS::RootedVector<JS::Value> argv(cx);
70405 if (!argv.resize(1)) {
70406 // That threw an exception on the JSContext, and our CallSetup will do
70407 // the right thing with that.
70408 return;
70409 }
70410 unsigned argc = 1;
70411
70412 do {
70413 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
70414 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70414); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 70414; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70415 aRv.Throw(NS_ERROR_UNEXPECTED);
70416 return;
70417 }
70418 break;
70419 } while (false);
70420
70421 JS::Rooted<JS::Value> callable(cx);
70422 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70423 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70424 !InitIds(cx, atomsCache)) ||
70425 !GetCallableProperty(cx, atomsCache->overload14_id, &callable)) {
70426 aRv.Throw(NS_ERROR_UNEXPECTED);
70427 return;
70428 }
70429 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70430 if (!JS::Call(cx, thisValue, callable,
70431 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70432 aRv.NoteJSContextException(cx);
70433 return;
70434 }
70435}
70436
70437void
70438TestJSImplInterfaceJSImpl::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70439{
70440 CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70441 if (aRv.Failed()) {
70442 return;
70443 }
70444 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70444); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70444; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70445 BindingCallContext& cx = s.GetCallContext();
70446
70447 JS::Rooted<JS::Value> rval(cx);
70448 JS::RootedVector<JS::Value> argv(cx);
70449 if (!argv.resize(1)) {
70450 // That threw an exception on the JSContext, and our CallSetup will do
70451 // the right thing with that.
70452 return;
70453 }
70454 unsigned argc = 1;
70455
70456 do {
70457 argv[0].setInt32(int32_t(arg));
70458 break;
70459 } while (false);
70460
70461 JS::Rooted<JS::Value> callable(cx);
70462 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70463 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70464 !InitIds(cx, atomsCache)) ||
70465 !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) {
70466 aRv.Throw(NS_ERROR_UNEXPECTED);
70467 return;
70468 }
70469 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70470 if (!JS::Call(cx, thisValue, callable,
70471 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70472 aRv.NoteJSContextException(cx);
70473 return;
70474 }
70475}
70476
70477void
70478TestJSImplInterfaceJSImpl::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70479{
70480 CallSetup s(this, aRv, "TestJSImplInterface.overload15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70481 if (aRv.Failed()) {
70482 return;
70483 }
70484 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70484); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70484; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70485 BindingCallContext& cx = s.GetCallContext();
70486
70487 JS::Rooted<JS::Value> rval(cx);
70488 JS::RootedVector<JS::Value> argv(cx);
70489 if (!argv.resize(1)) {
70490 // That threw an exception on the JSContext, and our CallSetup will do
70491 // the right thing with that.
70492 return;
70493 }
70494 unsigned argc = 1;
70495
70496 do {
70497 if (arg.WasPassed()) {
70498 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
70499 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70499); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 70499; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70500 aRv.Throw(NS_ERROR_UNEXPECTED);
70501 return;
70502 }
70503 break;
70504 } else if (argc == 1) {
70505 // This is our current trailing argument; reduce argc
70506 --argc;
70507 } else {
70508 argv[0].setUndefined();
70509 }
70510 } while (false);
70511
70512 JS::Rooted<JS::Value> callable(cx);
70513 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70514 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70515 !InitIds(cx, atomsCache)) ||
70516 !GetCallableProperty(cx, atomsCache->overload15_id, &callable)) {
70517 aRv.Throw(NS_ERROR_UNEXPECTED);
70518 return;
70519 }
70520 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70521 if (!JS::Call(cx, thisValue, callable,
70522 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70523 aRv.NoteJSContextException(cx);
70524 return;
70525 }
70526}
70527
70528void
70529TestJSImplInterfaceJSImpl::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
70530{
70531 CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70532 if (aRv.Failed()) {
70533 return;
70534 }
70535 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70535); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70535; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70536 BindingCallContext& cx = s.GetCallContext();
70537
70538 JS::Rooted<JS::Value> rval(cx);
70539 JS::RootedVector<JS::Value> argv(cx);
70540 if (!argv.resize(1)) {
70541 // That threw an exception on the JSContext, and our CallSetup will do
70542 // the right thing with that.
70543 return;
70544 }
70545 unsigned argc = 1;
70546
70547 do {
70548 argv[0].setInt32(int32_t(arg));
70549 break;
70550 } while (false);
70551
70552 JS::Rooted<JS::Value> callable(cx);
70553 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70554 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70555 !InitIds(cx, atomsCache)) ||
70556 !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) {
70557 aRv.Throw(NS_ERROR_UNEXPECTED);
70558 return;
70559 }
70560 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70561 if (!JS::Call(cx, thisValue, callable,
70562 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70563 aRv.NoteJSContextException(cx);
70564 return;
70565 }
70566}
70567
70568void
70569TestJSImplInterfaceJSImpl::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70570{
70571 CallSetup s(this, aRv, "TestJSImplInterface.overload16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70572 if (aRv.Failed()) {
70573 return;
70574 }
70575 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70575; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70576 BindingCallContext& cx = s.GetCallContext();
70577
70578 JS::Rooted<JS::Value> rval(cx);
70579 JS::RootedVector<JS::Value> argv(cx);
70580 if (!argv.resize(1)) {
70581 // That threw an exception on the JSContext, and our CallSetup will do
70582 // the right thing with that.
70583 return;
70584 }
70585 unsigned argc = 1;
70586
70587 do {
70588 if (arg.WasPassed()) {
70589 if (!arg.Value()) {
70590 argv[0].setNull();
70591 break;
70592 }
70593 if (!GetOrCreateDOMReflector(cx, arg.Value(), argv[0])) {
70594 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 70594); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 70594; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70595 aRv.Throw(NS_ERROR_UNEXPECTED);
70596 return;
70597 }
70598 break;
70599 } else if (argc == 1) {
70600 // This is our current trailing argument; reduce argc
70601 --argc;
70602 } else {
70603 argv[0].setUndefined();
70604 }
70605 } while (false);
70606
70607 JS::Rooted<JS::Value> callable(cx);
70608 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70609 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70610 !InitIds(cx, atomsCache)) ||
70611 !GetCallableProperty(cx, atomsCache->overload16_id, &callable)) {
70612 aRv.Throw(NS_ERROR_UNEXPECTED);
70613 return;
70614 }
70615 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70616 if (!JS::Call(cx, thisValue, callable,
70617 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70618 aRv.NoteJSContextException(cx);
70619 return;
70620 }
70621}
70622
70623void
70624TestJSImplInterfaceJSImpl::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70625{
70626 CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70627 if (aRv.Failed()) {
70628 return;
70629 }
70630 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70630); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70630; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70631 BindingCallContext& cx = s.GetCallContext();
70632
70633 JS::Rooted<JS::Value> rval(cx);
70634 JS::RootedVector<JS::Value> argv(cx);
70635 if (!argv.resize(1)) {
70636 // That threw an exception on the JSContext, and our CallSetup will do
70637 // the right thing with that.
70638 return;
70639 }
70640 unsigned argc = 1;
70641
70642 do {
70643
70644 uint32_t length = arg.Length();
70645 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
70646 if (!returnArray) {
70647 aRv.Throw(NS_ERROR_UNEXPECTED);
70648 return;
70649 }
70650 // Scope for 'tmp'
70651 {
70652 JS::Rooted<JS::Value> tmp(cx);
70653 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
70654 // Control block to let us common up the JS_DefineElement calls when there
70655 // are different ways to succeed at wrapping the object.
70656 do {
70657 tmp.setInt32(int32_t(arg[sequenceIdx0]));
70658 break;
70659 } while (false);
70660 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
70661 JSPROP_ENUMERATE)) {
70662 aRv.Throw(NS_ERROR_UNEXPECTED);
70663 return;
70664 }
70665 }
70666 }
70667 argv[0].setObject(*returnArray);
70668 break;
70669 } while (false);
70670
70671 JS::Rooted<JS::Value> callable(cx);
70672 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70673 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70674 !InitIds(cx, atomsCache)) ||
70675 !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) {
70676 aRv.Throw(NS_ERROR_UNEXPECTED);
70677 return;
70678 }
70679 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70680 if (!JS::Call(cx, thisValue, callable,
70681 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70682 aRv.NoteJSContextException(cx);
70683 return;
70684 }
70685}
70686
70687void
70688TestJSImplInterfaceJSImpl::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70689{
70690 CallSetup s(this, aRv, "TestJSImplInterface.overload17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70691 if (aRv.Failed()) {
70692 return;
70693 }
70694 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70694); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70694; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70695 BindingCallContext& cx = s.GetCallContext();
70696
70697 JS::Rooted<JS::Value> rval(cx);
70698 JS::RootedVector<JS::Value> argv(cx);
70699 if (!argv.resize(1)) {
70700 // That threw an exception on the JSContext, and our CallSetup will do
70701 // the right thing with that.
70702 return;
70703 }
70704 unsigned argc = 1;
70705
70706 do {
70707
70708 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
70709 if (!returnObj) {
70710 aRv.Throw(NS_ERROR_UNEXPECTED);
70711 return;
70712 }
70713 // Scope for 'tmp'
70714 {
70715 JS::Rooted<JS::Value> tmp(cx);
70716 for (auto& entry : arg.Entries()) {
70717 auto& recordValue0 = entry.mValue;
70718 // Control block to let us common up the JS_DefineUCProperty calls when there
70719 // are different ways to succeed at wrapping the value.
70720 do {
70721 tmp.setInt32(int32_t(recordValue0));
70722 break;
70723 } while (false);
70724 if (!JS_DefineUCProperty(cx, returnObj,
70725 entry.mKey.BeginReading(),
70726 entry.mKey.Length(), tmp,
70727 JSPROP_ENUMERATE)) {
70728 aRv.Throw(NS_ERROR_UNEXPECTED);
70729 return;
70730 }
70731 }
70732 }
70733 argv[0].setObject(*returnObj);
70734 break;
70735 } while (false);
70736
70737 JS::Rooted<JS::Value> callable(cx);
70738 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70739 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70740 !InitIds(cx, atomsCache)) ||
70741 !GetCallableProperty(cx, atomsCache->overload17_id, &callable)) {
70742 aRv.Throw(NS_ERROR_UNEXPECTED);
70743 return;
70744 }
70745 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70746 if (!JS::Call(cx, thisValue, callable,
70747 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70748 aRv.NoteJSContextException(cx);
70749 return;
70750 }
70751}
70752
70753void
70754TestJSImplInterfaceJSImpl::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70755{
70756 CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70757 if (aRv.Failed()) {
70758 return;
70759 }
70760 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70760); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70760; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70761 BindingCallContext& cx = s.GetCallContext();
70762
70763 JS::Rooted<JS::Value> rval(cx);
70764 JS::RootedVector<JS::Value> argv(cx);
70765 if (!argv.resize(1)) {
70766 // That threw an exception on the JSContext, and our CallSetup will do
70767 // the right thing with that.
70768 return;
70769 }
70770 unsigned argc = 1;
70771
70772 do {
70773
70774 JS::Rooted<JSObject*> returnObj(cx, JS_NewPlainObject(cx));
70775 if (!returnObj) {
70776 aRv.Throw(NS_ERROR_UNEXPECTED);
70777 return;
70778 }
70779 // Scope for 'tmp'
70780 {
70781 JS::Rooted<JS::Value> tmp(cx);
70782 for (auto& entry : arg.Entries()) {
70783 auto& recordValue0 = entry.mValue;
70784 // Control block to let us common up the JS_DefineUCProperty calls when there
70785 // are different ways to succeed at wrapping the value.
70786 do {
70787 if (!xpc::NonVoidStringToJsval(cx, recordValue0, &tmp)) {
70788 aRv.Throw(NS_ERROR_UNEXPECTED);
70789 return;
70790 }
70791 break;
70792 } while (false);
70793 if (!JS_DefineUCProperty(cx, returnObj,
70794 entry.mKey.BeginReading(),
70795 entry.mKey.Length(), tmp,
70796 JSPROP_ENUMERATE)) {
70797 aRv.Throw(NS_ERROR_UNEXPECTED);
70798 return;
70799 }
70800 }
70801 }
70802 argv[0].setObject(*returnObj);
70803 break;
70804 } while (false);
70805
70806 JS::Rooted<JS::Value> callable(cx);
70807 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70808 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70809 !InitIds(cx, atomsCache)) ||
70810 !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) {
70811 aRv.Throw(NS_ERROR_UNEXPECTED);
70812 return;
70813 }
70814 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70815 if (!JS::Call(cx, thisValue, callable,
70816 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70817 aRv.NoteJSContextException(cx);
70818 return;
70819 }
70820}
70821
70822void
70823TestJSImplInterfaceJSImpl::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70824{
70825 CallSetup s(this, aRv, "TestJSImplInterface.overload18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70826 if (aRv.Failed()) {
70827 return;
70828 }
70829 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70829); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70829; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70830 BindingCallContext& cx = s.GetCallContext();
70831
70832 JS::Rooted<JS::Value> rval(cx);
70833 JS::RootedVector<JS::Value> argv(cx);
70834 if (!argv.resize(1)) {
70835 // That threw an exception on the JSContext, and our CallSetup will do
70836 // the right thing with that.
70837 return;
70838 }
70839 unsigned argc = 1;
70840
70841 do {
70842
70843 uint32_t length = arg.Length();
70844 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
70845 if (!returnArray) {
70846 aRv.Throw(NS_ERROR_UNEXPECTED);
70847 return;
70848 }
70849 // Scope for 'tmp'
70850 {
70851 JS::Rooted<JS::Value> tmp(cx);
70852 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
70853 // Control block to let us common up the JS_DefineElement calls when there
70854 // are different ways to succeed at wrapping the object.
70855 do {
70856 if (!xpc::NonVoidStringToJsval(cx, arg[sequenceIdx0], &tmp)) {
70857 aRv.Throw(NS_ERROR_UNEXPECTED);
70858 return;
70859 }
70860 break;
70861 } while (false);
70862 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
70863 JSPROP_ENUMERATE)) {
70864 aRv.Throw(NS_ERROR_UNEXPECTED);
70865 return;
70866 }
70867 }
70868 }
70869 argv[0].setObject(*returnArray);
70870 break;
70871 } while (false);
70872
70873 JS::Rooted<JS::Value> callable(cx);
70874 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70875 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70876 !InitIds(cx, atomsCache)) ||
70877 !GetCallableProperty(cx, atomsCache->overload18_id, &callable)) {
70878 aRv.Throw(NS_ERROR_UNEXPECTED);
70879 return;
70880 }
70881 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70882 if (!JS::Call(cx, thisValue, callable,
70883 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70884 aRv.NoteJSContextException(cx);
70885 return;
70886 }
70887}
70888
70889void
70890TestJSImplInterfaceJSImpl::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
70891{
70892 CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70893 if (aRv.Failed()) {
70894 return;
70895 }
70896 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70896); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70896; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70897 BindingCallContext& cx = s.GetCallContext();
70898
70899 JS::Rooted<JS::Value> rval(cx);
70900 JS::RootedVector<JS::Value> argv(cx);
70901 if (!argv.resize(1)) {
70902 // That threw an exception on the JSContext, and our CallSetup will do
70903 // the right thing with that.
70904 return;
70905 }
70906 unsigned argc = 1;
70907
70908 do {
70909
70910 uint32_t length = arg.Length();
70911 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
70912 if (!returnArray) {
70913 aRv.Throw(NS_ERROR_UNEXPECTED);
70914 return;
70915 }
70916 // Scope for 'tmp'
70917 {
70918 JS::Rooted<JS::Value> tmp(cx);
70919 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
70920 // Control block to let us common up the JS_DefineElement calls when there
70921 // are different ways to succeed at wrapping the object.
70922 do {
70923 tmp.setInt32(int32_t(arg[sequenceIdx0]));
70924 break;
70925 } while (false);
70926 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
70927 JSPROP_ENUMERATE)) {
70928 aRv.Throw(NS_ERROR_UNEXPECTED);
70929 return;
70930 }
70931 }
70932 }
70933 argv[0].setObject(*returnArray);
70934 break;
70935 } while (false);
70936
70937 JS::Rooted<JS::Value> callable(cx);
70938 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70939 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70940 !InitIds(cx, atomsCache)) ||
70941 !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) {
70942 aRv.Throw(NS_ERROR_UNEXPECTED);
70943 return;
70944 }
70945 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70946 if (!JS::Call(cx, thisValue, callable,
70947 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70948 aRv.NoteJSContextException(cx);
70949 return;
70950 }
70951}
70952
70953void
70954TestJSImplInterfaceJSImpl::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
70955{
70956 CallSetup s(this, aRv, "TestJSImplInterface.overload19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
70957 if (aRv.Failed()) {
70958 return;
70959 }
70960 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 70960); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 70960; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
70961 BindingCallContext& cx = s.GetCallContext();
70962
70963 JS::Rooted<JS::Value> rval(cx);
70964 JS::RootedVector<JS::Value> argv(cx);
70965 if (!argv.resize(1)) {
70966 // That threw an exception on the JSContext, and our CallSetup will do
70967 // the right thing with that.
70968 return;
70969 }
70970 unsigned argc = 1;
70971
70972 do {
70973 if (!arg.ToObjectInternal(cx, argv[0])) {
70974 aRv.Throw(NS_ERROR_UNEXPECTED);
70975 return;
70976 }
70977 break;
70978 } while (false);
70979
70980 JS::Rooted<JS::Value> callable(cx);
70981 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
70982 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
70983 !InitIds(cx, atomsCache)) ||
70984 !GetCallableProperty(cx, atomsCache->overload19_id, &callable)) {
70985 aRv.Throw(NS_ERROR_UNEXPECTED);
70986 return;
70987 }
70988 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
70989 if (!JS::Call(cx, thisValue, callable,
70990 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
70991 aRv.NoteJSContextException(cx);
70992 return;
70993 }
70994}
70995
70996void
70997TestJSImplInterfaceJSImpl::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
70998{
70999 CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71000 if (aRv.Failed()) {
71001 return;
71002 }
71003 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71003); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71003; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71004 BindingCallContext& cx = s.GetCallContext();
71005
71006 JS::Rooted<JS::Value> rval(cx);
71007 JS::RootedVector<JS::Value> argv(cx);
71008 if (!argv.resize(1)) {
71009 // That threw an exception on the JSContext, and our CallSetup will do
71010 // the right thing with that.
71011 return;
71012 }
71013 unsigned argc = 1;
71014
71015 do {
71016 if (!arg.ToObjectInternal(cx, argv[0])) {
71017 aRv.Throw(NS_ERROR_UNEXPECTED);
71018 return;
71019 }
71020 break;
71021 } while (false);
71022
71023 JS::Rooted<JS::Value> callable(cx);
71024 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71025 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71026 !InitIds(cx, atomsCache)) ||
71027 !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) {
71028 aRv.Throw(NS_ERROR_UNEXPECTED);
71029 return;
71030 }
71031 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71032 if (!JS::Call(cx, thisValue, callable,
71033 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71034 aRv.NoteJSContextException(cx);
71035 return;
71036 }
71037}
71038
71039void
71040TestJSImplInterfaceJSImpl::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
71041{
71042 CallSetup s(this, aRv, "TestJSImplInterface.overload20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71043 if (aRv.Failed()) {
71044 return;
71045 }
71046 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71046); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71046; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71047 BindingCallContext& cx = s.GetCallContext();
71048
71049 JS::Rooted<JS::Value> rval(cx);
71050 JS::RootedVector<JS::Value> argv(cx);
71051 if (!argv.resize(1)) {
71052 // That threw an exception on the JSContext, and our CallSetup will do
71053 // the right thing with that.
71054 return;
71055 }
71056 unsigned argc = 1;
71057
71058 do {
71059
71060 uint32_t length = arg.Length();
71061 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
71062 if (!returnArray) {
71063 aRv.Throw(NS_ERROR_UNEXPECTED);
71064 return;
71065 }
71066 // Scope for 'tmp'
71067 {
71068 JS::Rooted<JS::Value> tmp(cx);
71069 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
71070 // Control block to let us common up the JS_DefineElement calls when there
71071 // are different ways to succeed at wrapping the object.
71072 do {
71073 tmp.setInt32(int32_t(arg[sequenceIdx0]));
71074 break;
71075 } while (false);
71076 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
71077 JSPROP_ENUMERATE)) {
71078 aRv.Throw(NS_ERROR_UNEXPECTED);
71079 return;
71080 }
71081 }
71082 }
71083 argv[0].setObject(*returnArray);
71084 break;
71085 } while (false);
71086
71087 JS::Rooted<JS::Value> callable(cx);
71088 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71089 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71090 !InitIds(cx, atomsCache)) ||
71091 !GetCallableProperty(cx, atomsCache->overload20_id, &callable)) {
71092 aRv.Throw(NS_ERROR_UNEXPECTED);
71093 return;
71094 }
71095 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71096 if (!JS::Call(cx, thisValue, callable,
71097 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71098 aRv.NoteJSContextException(cx);
71099 return;
71100 }
71101}
71102
71103void
71104TestJSImplInterfaceJSImpl::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const nsTArray<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm)
71105{
71106 CallSetup s(this, aRv, "TestJSImplInterface.passVariadicThirdArg", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71107 if (aRv.Failed()) {
71108 return;
71109 }
71110 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71111 BindingCallContext& cx = s.GetCallContext();
71112
71113 JS::Rooted<JS::Value> rval(cx);
71114 JS::RootedVector<JS::Value> argv(cx);
71115 if (!argv.resize((3 - 1) + arg3.Length())) {
71116 // That threw an exception on the JSContext, and our CallSetup will do
71117 // the right thing with that.
71118 return;
71119 }
71120 unsigned argc = (3 - 1) + arg3.Length();
71121
71122 do {
71123 for (uint32_t idx = 0; idx < arg3.Length(); ++idx) {
71124 if (!GetOrCreateDOMReflector(cx, arg3[idx], argv[2 + idx])) {
71125 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71125); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 71125; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71126 aRv.Throw(NS_ERROR_UNEXPECTED);
71127 return;
71128 }
71129 continue;
71130 }
71131 break;
71132 } while (false);
71133
71134 do {
71135 argv[1].setInt32(int32_t(arg2));
71136 break;
71137 } while (false);
71138
71139 do {
71140 if (!xpc::NonVoidStringToJsval(cx, arg1, argv[0])) {
71141 aRv.Throw(NS_ERROR_UNEXPECTED);
71142 return;
71143 }
71144 break;
71145 } while (false);
71146
71147 JS::Rooted<JS::Value> callable(cx);
71148 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71149 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71150 !InitIds(cx, atomsCache)) ||
71151 !GetCallableProperty(cx, atomsCache->passVariadicThirdArg_id, &callable)) {
71152 aRv.Throw(NS_ERROR_UNEXPECTED);
71153 return;
71154 }
71155 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71156 if (!JS::Call(cx, thisValue, callable,
71157 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71158 aRv.NoteJSContextException(cx);
71159 return;
71160 }
71161}
71162
71163void
71164TestJSImplInterfaceJSImpl::Prefable10(ErrorResult& aRv, JS::Realm* aRealm)
71165{
71166 CallSetup s(this, aRv, "TestJSImplInterface.prefable10", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71167 if (aRv.Failed()) {
71168 return;
71169 }
71170 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71170); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71170; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71171 BindingCallContext& cx = s.GetCallContext();
71172
71173 JS::Rooted<JS::Value> rval(cx);
71174
71175 JS::Rooted<JS::Value> callable(cx);
71176 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71177 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71178 !InitIds(cx, atomsCache)) ||
71179 !GetCallableProperty(cx, atomsCache->prefable10_id, &callable)) {
71180 aRv.Throw(NS_ERROR_UNEXPECTED);
71181 return;
71182 }
71183 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71184 if (!JS::Call(cx, thisValue, callable,
71185 JS::HandleValueArray::empty(), &rval)) {
71186 aRv.NoteJSContextException(cx);
71187 return;
71188 }
71189}
71190
71191void
71192TestJSImplInterfaceJSImpl::Prefable11(ErrorResult& aRv, JS::Realm* aRealm)
71193{
71194 CallSetup s(this, aRv, "TestJSImplInterface.prefable11", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71195 if (aRv.Failed()) {
71196 return;
71197 }
71198 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71198); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71198; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71199 BindingCallContext& cx = s.GetCallContext();
71200
71201 JS::Rooted<JS::Value> rval(cx);
71202
71203 JS::Rooted<JS::Value> callable(cx);
71204 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71205 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71206 !InitIds(cx, atomsCache)) ||
71207 !GetCallableProperty(cx, atomsCache->prefable11_id, &callable)) {
71208 aRv.Throw(NS_ERROR_UNEXPECTED);
71209 return;
71210 }
71211 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71212 if (!JS::Call(cx, thisValue, callable,
71213 JS::HandleValueArray::empty(), &rval)) {
71214 aRv.NoteJSContextException(cx);
71215 return;
71216 }
71217}
71218
71219void
71220TestJSImplInterfaceJSImpl::Prefable13(ErrorResult& aRv, JS::Realm* aRealm)
71221{
71222 CallSetup s(this, aRv, "TestJSImplInterface.prefable13", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71223 if (aRv.Failed()) {
71224 return;
71225 }
71226 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71226); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71226; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71227 BindingCallContext& cx = s.GetCallContext();
71228
71229 JS::Rooted<JS::Value> rval(cx);
71230
71231 JS::Rooted<JS::Value> callable(cx);
71232 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71233 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71234 !InitIds(cx, atomsCache)) ||
71235 !GetCallableProperty(cx, atomsCache->prefable13_id, &callable)) {
71236 aRv.Throw(NS_ERROR_UNEXPECTED);
71237 return;
71238 }
71239 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71240 if (!JS::Call(cx, thisValue, callable,
71241 JS::HandleValueArray::empty(), &rval)) {
71242 aRv.NoteJSContextException(cx);
71243 return;
71244 }
71245}
71246
71247void
71248TestJSImplInterfaceJSImpl::Prefable17(ErrorResult& aRv, JS::Realm* aRealm)
71249{
71250 CallSetup s(this, aRv, "TestJSImplInterface.prefable17", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71251 if (aRv.Failed()) {
71252 return;
71253 }
71254 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71254); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71254; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71255 BindingCallContext& cx = s.GetCallContext();
71256
71257 JS::Rooted<JS::Value> rval(cx);
71258
71259 JS::Rooted<JS::Value> callable(cx);
71260 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71261 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71262 !InitIds(cx, atomsCache)) ||
71263 !GetCallableProperty(cx, atomsCache->prefable17_id, &callable)) {
71264 aRv.Throw(NS_ERROR_UNEXPECTED);
71265 return;
71266 }
71267 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71268 if (!JS::Call(cx, thisValue, callable,
71269 JS::HandleValueArray::empty(), &rval)) {
71270 aRv.NoteJSContextException(cx);
71271 return;
71272 }
71273}
71274
71275void
71276TestJSImplInterfaceJSImpl::Prefable18(ErrorResult& aRv, JS::Realm* aRealm)
71277{
71278 CallSetup s(this, aRv, "TestJSImplInterface.prefable18", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71279 if (aRv.Failed()) {
71280 return;
71281 }
71282 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71282); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71282; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71283 BindingCallContext& cx = s.GetCallContext();
71284
71285 JS::Rooted<JS::Value> rval(cx);
71286
71287 JS::Rooted<JS::Value> callable(cx);
71288 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71289 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71290 !InitIds(cx, atomsCache)) ||
71291 !GetCallableProperty(cx, atomsCache->prefable18_id, &callable)) {
71292 aRv.Throw(NS_ERROR_UNEXPECTED);
71293 return;
71294 }
71295 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71296 if (!JS::Call(cx, thisValue, callable,
71297 JS::HandleValueArray::empty(), &rval)) {
71298 aRv.NoteJSContextException(cx);
71299 return;
71300 }
71301}
71302
71303void
71304TestJSImplInterfaceJSImpl::Prefable19(ErrorResult& aRv, JS::Realm* aRealm)
71305{
71306 CallSetup s(this, aRv, "TestJSImplInterface.prefable19", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71307 if (aRv.Failed()) {
71308 return;
71309 }
71310 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71310); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71310; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71311 BindingCallContext& cx = s.GetCallContext();
71312
71313 JS::Rooted<JS::Value> rval(cx);
71314
71315 JS::Rooted<JS::Value> callable(cx);
71316 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71317 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71318 !InitIds(cx, atomsCache)) ||
71319 !GetCallableProperty(cx, atomsCache->prefable19_id, &callable)) {
71320 aRv.Throw(NS_ERROR_UNEXPECTED);
71321 return;
71322 }
71323 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71324 if (!JS::Call(cx, thisValue, callable,
71325 JS::HandleValueArray::empty(), &rval)) {
71326 aRv.NoteJSContextException(cx);
71327 return;
71328 }
71329}
71330
71331void
71332TestJSImplInterfaceJSImpl::Prefable20(ErrorResult& aRv, JS::Realm* aRealm)
71333{
71334 CallSetup s(this, aRv, "TestJSImplInterface.prefable20", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71335 if (aRv.Failed()) {
71336 return;
71337 }
71338 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71338); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71338; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71339 BindingCallContext& cx = s.GetCallContext();
71340
71341 JS::Rooted<JS::Value> rval(cx);
71342
71343 JS::Rooted<JS::Value> callable(cx);
71344 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71345 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71346 !InitIds(cx, atomsCache)) ||
71347 !GetCallableProperty(cx, atomsCache->prefable20_id, &callable)) {
71348 aRv.Throw(NS_ERROR_UNEXPECTED);
71349 return;
71350 }
71351 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71352 if (!JS::Call(cx, thisValue, callable,
71353 JS::HandleValueArray::empty(), &rval)) {
71354 aRv.NoteJSContextException(cx);
71355 return;
71356 }
71357}
71358
71359void
71360TestJSImplInterfaceJSImpl::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm)
71361{
71362 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71363 if (aRv.Failed()) {
71364 return;
71365 }
71366 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71366); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71366; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71367 BindingCallContext& cx = s.GetCallContext();
71368
71369 JS::Rooted<JS::Value> rval(cx);
71370
71371 JS::Rooted<JS::Value> callable(cx);
71372 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71373 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71374 !InitIds(cx, atomsCache)) ||
71375 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext5_id, &callable)) {
71376 aRv.Throw(NS_ERROR_UNEXPECTED);
71377 return;
71378 }
71379 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71380 if (!JS::Call(cx, thisValue, callable,
71381 JS::HandleValueArray::empty(), &rval)) {
71382 aRv.NoteJSContextException(cx);
71383 return;
71384 }
71385}
71386
71387void
71388TestJSImplInterfaceJSImpl::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm)
71389{
71390 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71391 if (aRv.Failed()) {
71392 return;
71393 }
71394 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71394); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71394; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71395 BindingCallContext& cx = s.GetCallContext();
71396
71397 JS::Rooted<JS::Value> rval(cx);
71398
71399 JS::Rooted<JS::Value> callable(cx);
71400 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71401 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71402 !InitIds(cx, atomsCache)) ||
71403 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext6_id, &callable)) {
71404 aRv.Throw(NS_ERROR_UNEXPECTED);
71405 return;
71406 }
71407 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71408 if (!JS::Call(cx, thisValue, callable,
71409 JS::HandleValueArray::empty(), &rval)) {
71410 aRv.NoteJSContextException(cx);
71411 return;
71412 }
71413}
71414
71415void
71416TestJSImplInterfaceJSImpl::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm)
71417{
71418 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71419 if (aRv.Failed()) {
71420 return;
71421 }
71422 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71422); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71422; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71423 BindingCallContext& cx = s.GetCallContext();
71424
71425 JS::Rooted<JS::Value> rval(cx);
71426
71427 JS::Rooted<JS::Value> callable(cx);
71428 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71429 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71430 !InitIds(cx, atomsCache)) ||
71431 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext7_id, &callable)) {
71432 aRv.Throw(NS_ERROR_UNEXPECTED);
71433 return;
71434 }
71435 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71436 if (!JS::Call(cx, thisValue, callable,
71437 JS::HandleValueArray::empty(), &rval)) {
71438 aRv.NoteJSContextException(cx);
71439 return;
71440 }
71441}
71442
71443void
71444TestJSImplInterfaceJSImpl::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm)
71445{
71446 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71447 if (aRv.Failed()) {
71448 return;
71449 }
71450 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71450; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71451 BindingCallContext& cx = s.GetCallContext();
71452
71453 JS::Rooted<JS::Value> rval(cx);
71454
71455 JS::Rooted<JS::Value> callable(cx);
71456 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71457 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71458 !InitIds(cx, atomsCache)) ||
71459 !GetCallableProperty(cx, atomsCache->conditionalOnSecureContext8_id, &callable)) {
71460 aRv.Throw(NS_ERROR_UNEXPECTED);
71461 return;
71462 }
71463 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71464 if (!JS::Call(cx, thisValue, callable,
71465 JS::HandleValueArray::empty(), &rval)) {
71466 aRv.NoteJSContextException(cx);
71467 return;
71468 }
71469}
71470
71471void
71472TestJSImplInterfaceJSImpl::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
71473{
71474 CallSetup s(this, aRv, "TestJSImplInterface.passRenamedInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71475 if (aRv.Failed()) {
71476 return;
71477 }
71478 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71478); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71478; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71479 BindingCallContext& cx = s.GetCallContext();
71480
71481 JS::Rooted<JS::Value> rval(cx);
71482 JS::RootedVector<JS::Value> argv(cx);
71483 if (!argv.resize(1)) {
71484 // That threw an exception on the JSContext, and our CallSetup will do
71485 // the right thing with that.
71486 return;
71487 }
71488 unsigned argc = 1;
71489
71490 do {
71491 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
71492 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71492); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 71492; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71493 aRv.Throw(NS_ERROR_UNEXPECTED);
71494 return;
71495 }
71496 break;
71497 } while (false);
71498
71499 JS::Rooted<JS::Value> callable(cx);
71500 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71501 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71502 !InitIds(cx, atomsCache)) ||
71503 !GetCallableProperty(cx, atomsCache->passRenamedInterface_id, &callable)) {
71504 aRv.Throw(NS_ERROR_UNEXPECTED);
71505 return;
71506 }
71507 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71508 if (!JS::Call(cx, thisValue, callable,
71509 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71510 aRv.NoteJSContextException(cx);
71511 return;
71512 }
71513}
71514
71515void
71516TestJSImplInterfaceJSImpl::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm)
71517{
71518 CallSetup s(this, aRv, "TestJSImplInterface.throwingMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71519 if (aRv.Failed()) {
71520 return;
71521 }
71522 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71522); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71522; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71523 BindingCallContext& cx = s.GetCallContext();
71524
71525 JS::Rooted<JS::Value> rval(cx);
71526
71527 JS::Rooted<JS::Value> callable(cx);
71528 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71529 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71530 !InitIds(cx, atomsCache)) ||
71531 !GetCallableProperty(cx, atomsCache->throwingMethod_id, &callable)) {
71532 aRv.Throw(NS_ERROR_UNEXPECTED);
71533 return;
71534 }
71535 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71536 if (!JS::Call(cx, thisValue, callable,
71537 JS::HandleValueArray::empty(), &rval)) {
71538 aRv.NoteJSContextException(cx);
71539 return;
71540 }
71541}
71542
71543void
71544TestJSImplInterfaceJSImpl::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm)
71545{
71546 CallSetup s(this, aRv, "TestJSImplInterface.canOOMMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71547 if (aRv.Failed()) {
71548 return;
71549 }
71550 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71550); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71550; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71551 BindingCallContext& cx = s.GetCallContext();
71552
71553 JS::Rooted<JS::Value> rval(cx);
71554
71555 JS::Rooted<JS::Value> callable(cx);
71556 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71557 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71558 !InitIds(cx, atomsCache)) ||
71559 !GetCallableProperty(cx, atomsCache->canOOMMethod_id, &callable)) {
71560 aRv.Throw(NS_ERROR_UNEXPECTED);
71561 return;
71562 }
71563 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71564 if (!JS::Call(cx, thisValue, callable,
71565 JS::HandleValueArray::empty(), &rval)) {
71566 aRv.NoteJSContextException(cx);
71567 return;
71568 }
71569}
71570
71571void
71572TestJSImplInterfaceJSImpl::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm)
71573{
71574 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71575 if (aRv.Failed()) {
71576 return;
71577 }
71578 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71578); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71578; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71579 BindingCallContext& cx = s.GetCallContext();
71580
71581 JS::Rooted<JS::Value> rval(cx);
71582
71583 JS::Rooted<JS::Value> callable(cx);
71584 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71585 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71586 !InitIds(cx, atomsCache)) ||
71587 !GetCallableProperty(cx, atomsCache->ceReactionsMethod_id, &callable)) {
71588 aRv.Throw(NS_ERROR_UNEXPECTED);
71589 return;
71590 }
71591 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71592 if (!JS::Call(cx, thisValue, callable,
71593 JS::HandleValueArray::empty(), &rval)) {
71594 aRv.NoteJSContextException(cx);
71595 return;
71596 }
71597}
71598
71599void
71600TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm)
71601{
71602 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71603 if (aRv.Failed()) {
71604 return;
71605 }
71606 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71606); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71606; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71607 BindingCallContext& cx = s.GetCallContext();
71608
71609 JS::Rooted<JS::Value> rval(cx);
71610
71611 JS::Rooted<JS::Value> callable(cx);
71612 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71613 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71614 !InitIds(cx, atomsCache)) ||
71615 !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) {
71616 aRv.Throw(NS_ERROR_UNEXPECTED);
71617 return;
71618 }
71619 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71620 if (!JS::Call(cx, thisValue, callable,
71621 JS::HandleValueArray::empty(), &rval)) {
71622 aRv.NoteJSContextException(cx);
71623 return;
71624 }
71625}
71626
71627void
71628TestJSImplInterfaceJSImpl::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm)
71629{
71630 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsMethodOverload", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71631 if (aRv.Failed()) {
71632 return;
71633 }
71634 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71634); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71634; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71635 BindingCallContext& cx = s.GetCallContext();
71636
71637 JS::Rooted<JS::Value> rval(cx);
71638 JS::RootedVector<JS::Value> argv(cx);
71639 if (!argv.resize(1)) {
71640 // That threw an exception on the JSContext, and our CallSetup will do
71641 // the right thing with that.
71642 return;
71643 }
71644 unsigned argc = 1;
71645
71646 do {
71647 if (!xpc::NonVoidStringToJsval(cx, bar, argv[0])) {
71648 aRv.Throw(NS_ERROR_UNEXPECTED);
71649 return;
71650 }
71651 break;
71652 } while (false);
71653
71654 JS::Rooted<JS::Value> callable(cx);
71655 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71656 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71657 !InitIds(cx, atomsCache)) ||
71658 !GetCallableProperty(cx, atomsCache->ceReactionsMethodOverload_id, &callable)) {
71659 aRv.Throw(NS_ERROR_UNEXPECTED);
71660 return;
71661 }
71662 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71663 if (!JS::Call(cx, thisValue, callable,
71664 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71665 aRv.NoteJSContextException(cx);
71666 return;
71667 }
71668}
71669
71670void
71671TestJSImplInterfaceJSImpl::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm)
71672{
71673 CallSetup s(this, aRv, "TestJSImplInterface.passArgsWithDefaults", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71674 if (aRv.Failed()) {
71675 return;
71676 }
71677 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71677); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71677; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71678 BindingCallContext& cx = s.GetCallContext();
71679
71680 JS::Rooted<JS::Value> rval(cx);
71681 JS::RootedVector<JS::Value> argv(cx);
71682 if (!argv.resize(5)) {
71683 // That threw an exception on the JSContext, and our CallSetup will do
71684 // the right thing with that.
71685 return;
71686 }
71687 unsigned argc = 5;
71688
71689 do {
71690 if (arg5.WasPassed()) {
71691 argv[4].set(JS_NumberValue(double(arg5.Value())));
71692 break;
71693 } else if (argc == 5) {
71694 // This is our current trailing argument; reduce argc
71695 --argc;
71696 } else {
71697 argv[4].setUndefined();
71698 }
71699 } while (false);
71700
71701 do {
71702 argv[3].set(JS_NumberValue(double(arg4)));
71703 break;
71704 } while (false);
71705
71706 do {
71707 if (!arg3.ToObjectInternal(cx, argv[2])) {
71708 aRv.Throw(NS_ERROR_UNEXPECTED);
71709 return;
71710 }
71711 break;
71712 } while (false);
71713
71714 do {
71715 if (!arg2) {
71716 argv[1].setNull();
71717 break;
71718 }
71719 if (!GetOrCreateDOMReflector(cx, arg2, argv[1])) {
71720 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 71720); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 71720; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71721 aRv.Throw(NS_ERROR_UNEXPECTED);
71722 return;
71723 }
71724 break;
71725 } while (false);
71726
71727 do {
71728 if (arg1.WasPassed()) {
71729 argv[0].setInt32(int32_t(arg1.Value()));
71730 break;
71731 } else if (argc == 1) {
71732 // This is our current trailing argument; reduce argc
71733 --argc;
71734 } else {
71735 argv[0].setUndefined();
71736 }
71737 } while (false);
71738
71739 JS::Rooted<JS::Value> callable(cx);
71740 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71741 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71742 !InitIds(cx, atomsCache)) ||
71743 !GetCallableProperty(cx, atomsCache->passArgsWithDefaults_id, &callable)) {
71744 aRv.Throw(NS_ERROR_UNEXPECTED);
71745 return;
71746 }
71747 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71748 if (!JS::Call(cx, thisValue, callable,
71749 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71750 aRv.NoteJSContextException(cx);
71751 return;
71752 }
71753}
71754
71755void
71756TestJSImplInterfaceJSImpl::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
71757{
71758 CallSetup s(this, aRv, "TestJSImplInterface.toJSON", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71759 if (aRv.Failed()) {
71760 return;
71761 }
71762 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71762); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71762; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71763 BindingCallContext& cx = s.GetCallContext();
71764
71765 JS::Rooted<JS::Value> rval(cx);
71766
71767 JS::Rooted<JS::Value> callable(cx);
71768 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71769 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71770 !InitIds(cx, atomsCache)) ||
71771 !GetCallableProperty(cx, atomsCache->toJSON_id, &callable)) {
71772 aRv.Throw(NS_ERROR_UNEXPECTED);
71773 return;
71774 }
71775 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71776 if (!JS::Call(cx, thisValue, callable,
71777 JS::HandleValueArray::empty(), &rval)) {
71778 aRv.NoteJSContextException(cx);
71779 return;
71780 }
71781 JS::Rooted<JSObject*> rvalDecl(cx);
71782 if (rval.isObject()) {
71783#ifdef __clang__1
71784#pragma clang diagnostic push
71785#pragma clang diagnostic ignored "-Wunreachable-code"
71786#pragma clang diagnostic ignored "-Wunreachable-code-return"
71787#endif // __clang__
71788 if ((false) && !CallerSubsumes(rval)) {
71789 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSON");
71790 aRv.Throw(NS_ERROR_UNEXPECTED);
71791 return;
71792 }
71793#ifdef __clang__1
71794#pragma clang diagnostic pop
71795#endif // __clang__
71796 rvalDecl = &rval.toObject();
71797 } else {
71798 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSON");
71799 aRv.Throw(NS_ERROR_UNEXPECTED);
71800 return;
71801 }
71802 aRetVal.set(rvalDecl);
71803}
71804
71805void
71806TestJSImplInterfaceJSImpl::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm)
71807{
71808 CallSetup s(this, aRv, "TestJSImplInterface.dashed-method", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71809 if (aRv.Failed()) {
71810 return;
71811 }
71812 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71812); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71812; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71813 BindingCallContext& cx = s.GetCallContext();
71814
71815 JS::Rooted<JS::Value> rval(cx);
71816
71817 JS::Rooted<JS::Value> callable(cx);
71818 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71819 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71820 !InitIds(cx, atomsCache)) ||
71821 !GetCallableProperty(cx, atomsCache->dashed_method_id, &callable)) {
71822 aRv.Throw(NS_ERROR_UNEXPECTED);
71823 return;
71824 }
71825 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71826 if (!JS::Call(cx, thisValue, callable,
71827 JS::HandleValueArray::empty(), &rval)) {
71828 aRv.NoteJSContextException(cx);
71829 return;
71830 }
71831}
71832
71833void
71834TestJSImplInterfaceJSImpl::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm)
71835{
71836 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableMethod", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71837 if (aRv.Failed()) {
71838 return;
71839 }
71840 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71840); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71840; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71841 BindingCallContext& cx = s.GetCallContext();
71842
71843 JS::Rooted<JS::Value> rval(cx);
71844
71845 JS::Rooted<JS::Value> callable(cx);
71846 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71847 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71848 !InitIds(cx, atomsCache)) ||
71849 !GetCallableProperty(cx, atomsCache->nonEnumerableMethod_id, &callable)) {
71850 aRv.Throw(NS_ERROR_UNEXPECTED);
71851 return;
71852 }
71853 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71854 if (!JS::Call(cx, thisValue, callable,
71855 JS::HandleValueArray::empty(), &rval)) {
71856 aRv.NoteJSContextException(cx);
71857 return;
71858 }
71859}
71860
71861void
71862TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
71863{
71864 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71865 if (aRv.Failed()) {
71866 return;
71867 }
71868 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71868); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71868; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71869 BindingCallContext& cx = s.GetCallContext();
71870
71871 JS::Rooted<JS::Value> rval(cx);
71872 JS::RootedVector<JS::Value> argv(cx);
71873 if (!argv.resize(1)) {
71874 // That threw an exception on the JSContext, and our CallSetup will do
71875 // the right thing with that.
71876 return;
71877 }
71878 unsigned argc = 1;
71879
71880 do {
71881 argv[0].setObject(*foo.Obj());
71882 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
71883 aRv.Throw(NS_ERROR_UNEXPECTED);
71884 return;
71885 }
71886 break;
71887 } while (false);
71888
71889 JS::Rooted<JS::Value> callable(cx);
71890 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71891 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71892 !InitIds(cx, atomsCache)) ||
71893 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferViewTypedef_id, &callable)) {
71894 aRv.Throw(NS_ERROR_UNEXPECTED);
71895 return;
71896 }
71897 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71898 if (!JS::Call(cx, thisValue, callable,
71899 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71900 aRv.NoteJSContextException(cx);
71901 return;
71902 }
71903}
71904
71905void
71906TestJSImplInterfaceJSImpl::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
71907{
71908 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71909 if (aRv.Failed()) {
71910 return;
71911 }
71912 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71912); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71912; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71913 BindingCallContext& cx = s.GetCallContext();
71914
71915 JS::Rooted<JS::Value> rval(cx);
71916 JS::RootedVector<JS::Value> argv(cx);
71917 if (!argv.resize(1)) {
71918 // That threw an exception on the JSContext, and our CallSetup will do
71919 // the right thing with that.
71920 return;
71921 }
71922 unsigned argc = 1;
71923
71924 do {
71925 argv[0].setObject(*foo.Obj());
71926 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
71927 aRv.Throw(NS_ERROR_UNEXPECTED);
71928 return;
71929 }
71930 break;
71931 } while (false);
71932
71933 JS::Rooted<JS::Value> callable(cx);
71934 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71935 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71936 !InitIds(cx, atomsCache)) ||
71937 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBufferView_id, &callable)) {
71938 aRv.Throw(NS_ERROR_UNEXPECTED);
71939 return;
71940 }
71941 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71942 if (!JS::Call(cx, thisValue, callable,
71943 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71944 aRv.NoteJSContextException(cx);
71945 return;
71946 }
71947}
71948
71949void
71950TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm)
71951{
71952 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
71953 if (aRv.Failed()) {
71954 return;
71955 }
71956 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 71956); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 71956; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
71957 BindingCallContext& cx = s.GetCallContext();
71958
71959 JS::Rooted<JS::Value> rval(cx);
71960 JS::RootedVector<JS::Value> argv(cx);
71961 if (!argv.resize(1)) {
71962 // That threw an exception on the JSContext, and our CallSetup will do
71963 // the right thing with that.
71964 return;
71965 }
71966 unsigned argc = 1;
71967
71968 do {
71969 if (foo.IsNull()) {
71970 argv[0].setNull();
71971 break;
71972 }
71973 argv[0].setObject(*foo.Value().Obj());
71974 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
71975 aRv.Throw(NS_ERROR_UNEXPECTED);
71976 return;
71977 }
71978 break;
71979 } while (false);
71980
71981 JS::Rooted<JS::Value> callable(cx);
71982 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
71983 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
71984 !InitIds(cx, atomsCache)) ||
71985 !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBufferView_id, &callable)) {
71986 aRv.Throw(NS_ERROR_UNEXPECTED);
71987 return;
71988 }
71989 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
71990 if (!JS::Call(cx, thisValue, callable,
71991 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
71992 aRv.NoteJSContextException(cx);
71993 return;
71994 }
71995}
71996
71997void
71998TestJSImplInterfaceJSImpl::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
71999{
72000 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72001 if (aRv.Failed()) {
72002 return;
72003 }
72004 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72004); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72004; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72005 BindingCallContext& cx = s.GetCallContext();
72006
72007 JS::Rooted<JS::Value> rval(cx);
72008 JS::RootedVector<JS::Value> argv(cx);
72009 if (!argv.resize(1)) {
72010 // That threw an exception on the JSContext, and our CallSetup will do
72011 // the right thing with that.
72012 return;
72013 }
72014 unsigned argc = 1;
72015
72016 do {
72017 argv[0].setObject(*foo.Obj());
72018 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72019 aRv.Throw(NS_ERROR_UNEXPECTED);
72020 return;
72021 }
72022 break;
72023 } while (false);
72024
72025 JS::Rooted<JS::Value> callable(cx);
72026 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72027 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72028 !InitIds(cx, atomsCache)) ||
72029 !GetCallableProperty(cx, atomsCache->passAllowSharedArrayBuffer_id, &callable)) {
72030 aRv.Throw(NS_ERROR_UNEXPECTED);
72031 return;
72032 }
72033 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72034 if (!JS::Call(cx, thisValue, callable,
72035 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72036 aRv.NoteJSContextException(cx);
72037 return;
72038 }
72039}
72040
72041void
72042TestJSImplInterfaceJSImpl::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm)
72043{
72044 CallSetup s(this, aRv, "TestJSImplInterface.passAllowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72045 if (aRv.Failed()) {
72046 return;
72047 }
72048 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72048); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72048; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72049 BindingCallContext& cx = s.GetCallContext();
72050
72051 JS::Rooted<JS::Value> rval(cx);
72052 JS::RootedVector<JS::Value> argv(cx);
72053 if (!argv.resize(1)) {
72054 // That threw an exception on the JSContext, and our CallSetup will do
72055 // the right thing with that.
72056 return;
72057 }
72058 unsigned argc = 1;
72059
72060 do {
72061 if (foo.IsNull()) {
72062 argv[0].setNull();
72063 break;
72064 }
72065 argv[0].setObject(*foo.Value().Obj());
72066 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
72067 aRv.Throw(NS_ERROR_UNEXPECTED);
72068 return;
72069 }
72070 break;
72071 } while (false);
72072
72073 JS::Rooted<JS::Value> callable(cx);
72074 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72075 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72076 !InitIds(cx, atomsCache)) ||
72077 !GetCallableProperty(cx, atomsCache->passAllowSharedNullableArrayBuffer_id, &callable)) {
72078 aRv.Throw(NS_ERROR_UNEXPECTED);
72079 return;
72080 }
72081 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72082 if (!JS::Call(cx, thisValue, callable,
72083 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72084 aRv.NoteJSContextException(cx);
72085 return;
72086 }
72087}
72088
72089void
72090TestJSImplInterfaceJSImpl::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
72091{
72092 CallSetup s(this, aRv, "TestJSImplInterface.passUnionArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72093 if (aRv.Failed()) {
72094 return;
72095 }
72096 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72096); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72096; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72097 BindingCallContext& cx = s.GetCallContext();
72098
72099 JS::Rooted<JS::Value> rval(cx);
72100 JS::RootedVector<JS::Value> argv(cx);
72101 if (!argv.resize(1)) {
72102 // That threw an exception on the JSContext, and our CallSetup will do
72103 // the right thing with that.
72104 return;
72105 }
72106 unsigned argc = 1;
72107
72108 do {
72109 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
72110 if (!foo.ToJSVal(cx, callbackObj, argv[0])) {
72111 aRv.Throw(NS_ERROR_UNEXPECTED);
72112 return;
72113 }
72114 break;
72115 } while (false);
72116
72117 JS::Rooted<JS::Value> callable(cx);
72118 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72119 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72120 !InitIds(cx, atomsCache)) ||
72121 !GetCallableProperty(cx, atomsCache->passUnionArrayBuffer_id, &callable)) {
72122 aRv.Throw(NS_ERROR_UNEXPECTED);
72123 return;
72124 }
72125 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72126 if (!JS::Call(cx, thisValue, callable,
72127 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72128 aRv.NoteJSContextException(cx);
72129 return;
72130 }
72131}
72132
72133void
72134TestJSImplInterfaceJSImpl::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
72135{
72136 CallSetup s(this, aRv, "TestJSImplInterface.passUnionAllowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72137 if (aRv.Failed()) {
72138 return;
72139 }
72140 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72140); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72140; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72141 BindingCallContext& cx = s.GetCallContext();
72142
72143 JS::Rooted<JS::Value> rval(cx);
72144 JS::RootedVector<JS::Value> argv(cx);
72145 if (!argv.resize(1)) {
72146 // That threw an exception on the JSContext, and our CallSetup will do
72147 // the right thing with that.
72148 return;
72149 }
72150 unsigned argc = 1;
72151
72152 do {
72153 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
72154 if (!foo.ToJSVal(cx, callbackObj, argv[0])) {
72155 aRv.Throw(NS_ERROR_UNEXPECTED);
72156 return;
72157 }
72158 break;
72159 } while (false);
72160
72161 JS::Rooted<JS::Value> callable(cx);
72162 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72163 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72164 !InitIds(cx, atomsCache)) ||
72165 !GetCallableProperty(cx, atomsCache->passUnionAllowSharedArrayBuffer_id, &callable)) {
72166 aRv.Throw(NS_ERROR_UNEXPECTED);
72167 return;
72168 }
72169 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72170 if (!JS::Call(cx, thisValue, callable,
72171 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72172 aRv.NoteJSContextException(cx);
72173 return;
72174 }
72175}
72176
72177void
72178TestJSImplInterfaceJSImpl::__Init(const nsAString& str, uint32_t num, const Nullable<bool>& boolArg, TestInterface* iface, int32_t arg1, const DictForConstructor& dict, JS::Handle<JS::Value> any1, JS::Handle<JSObject*> obj1, JS::Handle<JSObject*> obj2, const Sequence<Dict>& seq, JS::Handle<JS::Value> any2, const Optional<JS::Handle<JSObject*>>& obj3, const Optional<JS::Handle<JSObject*>>& obj4, const Uint8Array& typedArr, const ArrayBuffer& arrayBuf, ErrorResult& aRv, JS::Realm* aRealm)
72179{
72180 CallSetup s(this, aRv, "__init", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72181 if (aRv.Failed()) {
72182 return;
72183 }
72184 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72184); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72184; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72185 BindingCallContext& cx = s.GetCallContext();
72186
72187 JS::Rooted<JS::Value> rval(cx);
72188 JS::RootedVector<JS::Value> argv(cx);
72189 if (!argv.resize(15)) {
72190 // That threw an exception on the JSContext, and our CallSetup will do
72191 // the right thing with that.
72192 return;
72193 }
72194 unsigned argc = 15;
72195
72196 do {
72197 argv[14].setObject(*arrayBuf.Obj());
72198 if (!MaybeWrapNonDOMObjectValue(cx, argv[14])) {
72199 aRv.Throw(NS_ERROR_UNEXPECTED);
72200 return;
72201 }
72202 break;
72203 } while (false);
72204
72205 do {
72206 argv[13].setObject(*typedArr.Obj());
72207 if (!MaybeWrapNonDOMObjectValue(cx, argv[13])) {
72208 aRv.Throw(NS_ERROR_UNEXPECTED);
72209 return;
72210 }
72211 break;
72212 } while (false);
72213
72214 do {
72215 if (obj4.WasPassed()) {
72216 if (obj4.Value()) {
72217 JS::ExposeObjectToActiveJS(obj4.Value());
72218 }
72219 argv[12].setObjectOrNull(obj4.Value());
72220 if (!MaybeWrapObjectOrNullValue(cx, argv[12])) {
72221 aRv.Throw(NS_ERROR_UNEXPECTED);
72222 return;
72223 }
72224 break;
72225 } else if (argc == 13) {
72226 // This is our current trailing argument; reduce argc
72227 --argc;
72228 } else {
72229 argv[12].setUndefined();
72230 }
72231 } while (false);
72232
72233 do {
72234 if (obj3.WasPassed()) {
72235 JS::ExposeObjectToActiveJS(obj3.Value());
72236 argv[11].setObject(*obj3.Value());
72237 if (!MaybeWrapObjectValue(cx, argv[11])) {
72238 aRv.Throw(NS_ERROR_UNEXPECTED);
72239 return;
72240 }
72241 break;
72242 } else if (argc == 12) {
72243 // This is our current trailing argument; reduce argc
72244 --argc;
72245 } else {
72246 argv[11].setUndefined();
72247 }
72248 } while (false);
72249
72250 do {
72251 JS::ExposeValueToActiveJS(any2);
72252 argv[10].set(any2);
72253 if (!MaybeWrapValue(cx, argv[10])) {
72254 aRv.Throw(NS_ERROR_UNEXPECTED);
72255 return;
72256 }
72257 break;
72258 } while (false);
72259
72260 do {
72261
72262 uint32_t length = seq.Length();
72263 JS::Rooted<JSObject*> returnArray(cx, JS::NewArrayObject(cx, length));
72264 if (!returnArray) {
72265 aRv.Throw(NS_ERROR_UNEXPECTED);
72266 return;
72267 }
72268 // Scope for 'tmp'
72269 {
72270 JS::Rooted<JS::Value> tmp(cx);
72271 for (uint32_t sequenceIdx0 = 0; sequenceIdx0 < length; ++sequenceIdx0) {
72272 // Control block to let us common up the JS_DefineElement calls when there
72273 // are different ways to succeed at wrapping the object.
72274 do {
72275 if (!seq[sequenceIdx0].ToObjectInternal(cx, &tmp)) {
72276 aRv.Throw(NS_ERROR_UNEXPECTED);
72277 return;
72278 }
72279 break;
72280 } while (false);
72281 if (!JS_DefineElement(cx, returnArray, sequenceIdx0, tmp,
72282 JSPROP_ENUMERATE)) {
72283 aRv.Throw(NS_ERROR_UNEXPECTED);
72284 return;
72285 }
72286 }
72287 }
72288 argv[9].setObject(*returnArray);
72289 break;
72290 } while (false);
72291
72292 do {
72293 if (obj2) {
72294 JS::ExposeObjectToActiveJS(obj2);
72295 }
72296 argv[8].setObjectOrNull(obj2);
72297 if (!MaybeWrapObjectOrNullValue(cx, argv[8])) {
72298 aRv.Throw(NS_ERROR_UNEXPECTED);
72299 return;
72300 }
72301 break;
72302 } while (false);
72303
72304 do {
72305 JS::ExposeObjectToActiveJS(obj1);
72306 argv[7].setObject(*obj1);
72307 if (!MaybeWrapObjectValue(cx, argv[7])) {
72308 aRv.Throw(NS_ERROR_UNEXPECTED);
72309 return;
72310 }
72311 break;
72312 } while (false);
72313
72314 do {
72315 JS::ExposeValueToActiveJS(any1);
72316 argv[6].set(any1);
72317 if (!MaybeWrapValue(cx, argv[6])) {
72318 aRv.Throw(NS_ERROR_UNEXPECTED);
72319 return;
72320 }
72321 break;
72322 } while (false);
72323
72324 do {
72325 if (!dict.ToObjectInternal(cx, argv[5])) {
72326 aRv.Throw(NS_ERROR_UNEXPECTED);
72327 return;
72328 }
72329 break;
72330 } while (false);
72331
72332 do {
72333 argv[4].setInt32(int32_t(arg1));
72334 break;
72335 } while (false);
72336
72337 do {
72338 if (!iface) {
72339 argv[3].setNull();
72340 break;
72341 }
72342 if (!GetOrCreateDOMReflector(cx, iface, argv[3])) {
72343 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 72343); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 72343; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72344 aRv.Throw(NS_ERROR_UNEXPECTED);
72345 return;
72346 }
72347 break;
72348 } while (false);
72349
72350 do {
72351 if (boolArg.IsNull()) {
72352 argv[2].setNull();
72353 break;
72354 }
72355 argv[2].setBoolean(boolArg.Value());
72356 break;
72357 } while (false);
72358
72359 do {
72360 argv[1].setNumber(num);
72361 break;
72362 } while (false);
72363
72364 do {
72365 if (!xpc::NonVoidStringToJsval(cx, str, argv[0])) {
72366 aRv.Throw(NS_ERROR_UNEXPECTED);
72367 return;
72368 }
72369 break;
72370 } while (false);
72371
72372 JS::Rooted<JS::Value> callable(cx);
72373 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72374 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
72375 !InitIds(cx, atomsCache)) ||
72376 !GetCallableProperty(cx, atomsCache->__init_id, &callable)) {
72377 aRv.Throw(NS_ERROR_UNEXPECTED);
72378 return;
72379 }
72380 JS::Rooted<JS::Value> thisValue(cx, JS::ObjectValue(*mCallback));
72381 if (!JS::Call(cx, thisValue, callable,
72382 JS::HandleValueArray::subarray(argv, 0, argc), &rval)) {
72383 aRv.NoteJSContextException(cx);
72384 return;
72385 }
72386}
72387
72388bool
72389TestJSImplInterfaceJSImpl::InitIds(JSContext* cx, TestJSImplInterfaceAtoms* atomsCache)
72390{
72391 MOZ_ASSERT(reinterpret_cast<jsid*>(atomsCache)->isVoid())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(reinterpret_cast<jsid*>(atomsCache)->isVoid
())>::isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(reinterpret_cast<jsid*>(atomsCache)->isVoid
()))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("reinterpret_cast<jsid*>(atomsCache)->isVoid()", "../TestJSImplGenBinding.cpp"
, 72391); AnnotateMozCrashReason("MOZ_ASSERT" "(" "reinterpret_cast<jsid*>(atomsCache)->isVoid()"
")"); do { *((volatile int*)__null) = 72391; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
72392
72393 // Initialize these in reverse order so that any failure leaves the first one
72394 // uninitialized.
72395 if (!atomsCache->__init_id.init(cx, "__init") ||
72396 !atomsCache->passUnionAllowSharedArrayBuffer_id.init(cx, "passUnionAllowSharedArrayBuffer") ||
72397 !atomsCache->passUnionArrayBuffer_id.init(cx, "passUnionArrayBuffer") ||
72398 !atomsCache->passAllowSharedNullableArrayBuffer_id.init(cx, "passAllowSharedNullableArrayBuffer") ||
72399 !atomsCache->passAllowSharedArrayBuffer_id.init(cx, "passAllowSharedArrayBuffer") ||
72400 !atomsCache->passAllowSharedNullableArrayBufferView_id.init(cx, "passAllowSharedNullableArrayBufferView") ||
72401 !atomsCache->passAllowSharedArrayBufferView_id.init(cx, "passAllowSharedArrayBufferView") ||
72402 !atomsCache->passAllowSharedArrayBufferViewTypedef_id.init(cx, "passAllowSharedArrayBufferViewTypedef") ||
72403 !atomsCache->allowSharedNullableArrayBuffer_id.init(cx, "allowSharedNullableArrayBuffer") ||
72404 !atomsCache->allowSharedArrayBuffer_id.init(cx, "allowSharedArrayBuffer") ||
72405 !atomsCache->allowSharedNullableArrayBufferView_id.init(cx, "allowSharedNullableArrayBufferView") ||
72406 !atomsCache->allowSharedArrayBufferView_id.init(cx, "allowSharedArrayBufferView") ||
72407 !atomsCache->allowSharedArrayBufferViewTypedef_id.init(cx, "allowSharedArrayBufferViewTypedef") ||
72408 !atomsCache->nonEnumerableMethod_id.init(cx, "nonEnumerableMethod") ||
72409 !atomsCache->nonEnumerableAttr_id.init(cx, "nonEnumerableAttr") ||
72410 !atomsCache->dashed_method_id.init(cx, "dashed-method") ||
72411 !atomsCache->dashed_attribute_id.init(cx, "dashed-attribute") ||
72412 !atomsCache->toJSON_id.init(cx, "toJSON") ||
72413 !atomsCache->toJSONShouldSkipThis3_id.init(cx, "toJSONShouldSkipThis3") ||
72414 !atomsCache->toJSONShouldSkipThis2_id.init(cx, "toJSONShouldSkipThis2") ||
72415 !atomsCache->toJSONShouldSkipThis_id.init(cx, "toJSONShouldSkipThis") ||
72416 !atomsCache->passArgsWithDefaults_id.init(cx, "passArgsWithDefaults") ||
72417 !atomsCache->ceReactionsAttr_id.init(cx, "ceReactionsAttr") ||
72418 !atomsCache->ceReactionsMethodOverload_id.init(cx, "ceReactionsMethodOverload") ||
72419 !atomsCache->ceReactionsMethod_id.init(cx, "ceReactionsMethod") ||
72420 !atomsCache->canOOMSetterAttr_id.init(cx, "canOOMSetterAttr") ||
72421 !atomsCache->canOOMGetterAttr_id.init(cx, "canOOMGetterAttr") ||
72422 !atomsCache->canOOMAttr_id.init(cx, "canOOMAttr") ||
72423 !atomsCache->canOOMMethod_id.init(cx, "canOOMMethod") ||
72424 !atomsCache->throwingSetterAttr_id.init(cx, "throwingSetterAttr") ||
72425 !atomsCache->throwingGetterAttr_id.init(cx, "throwingGetterAttr") ||
72426 !atomsCache->throwingAttr_id.init(cx, "throwingAttr") ||
72427 !atomsCache->throwingMethod_id.init(cx, "throwingMethod") ||
72428 !atomsCache->putForwardsAttr3_id.init(cx, "putForwardsAttr3") ||
72429 !atomsCache->putForwardsAttr2_id.init(cx, "putForwardsAttr2") ||
72430 !atomsCache->putForwardsAttr_id.init(cx, "putForwardsAttr") ||
72431 !atomsCache->passRenamedInterface_id.init(cx, "passRenamedInterface") ||
72432 !atomsCache->attrWithLenientThis_id.init(cx, "attrWithLenientThis") ||
72433 !atomsCache->conditionalOnSecureContext8_id.init(cx, "conditionalOnSecureContext8") ||
72434 !atomsCache->conditionalOnSecureContext7_id.init(cx, "conditionalOnSecureContext7") ||
72435 !atomsCache->conditionalOnSecureContext6_id.init(cx, "conditionalOnSecureContext6") ||
72436 !atomsCache->conditionalOnSecureContext5_id.init(cx, "conditionalOnSecureContext5") ||
72437 !atomsCache->conditionalOnSecureContext4_id.init(cx, "conditionalOnSecureContext4") ||
72438 !atomsCache->conditionalOnSecureContext3_id.init(cx, "conditionalOnSecureContext3") ||
72439 !atomsCache->conditionalOnSecureContext2_id.init(cx, "conditionalOnSecureContext2") ||
72440 !atomsCache->conditionalOnSecureContext1_id.init(cx, "conditionalOnSecureContext1") ||
72441 !atomsCache->prefable20_id.init(cx, "prefable20") ||
72442 !atomsCache->prefable19_id.init(cx, "prefable19") ||
72443 !atomsCache->prefable18_id.init(cx, "prefable18") ||
72444 !atomsCache->prefable17_id.init(cx, "prefable17") ||
72445 !atomsCache->prefable16_id.init(cx, "prefable16") ||
72446 !atomsCache->prefable15_id.init(cx, "prefable15") ||
72447 !atomsCache->prefable14_id.init(cx, "prefable14") ||
72448 !atomsCache->prefable13_id.init(cx, "prefable13") ||
72449 !atomsCache->prefable12_id.init(cx, "prefable12") ||
72450 !atomsCache->prefable11_id.init(cx, "prefable11") ||
72451 !atomsCache->prefable10_id.init(cx, "prefable10") ||
72452 !atomsCache->prefable9_id.init(cx, "prefable9") ||
72453 !atomsCache->prefable8_id.init(cx, "prefable8") ||
72454 !atomsCache->prefable7_id.init(cx, "prefable7") ||
72455 !atomsCache->prefable6_id.init(cx, "prefable6") ||
72456 !atomsCache->prefable5_id.init(cx, "prefable5") ||
72457 !atomsCache->prefable4_id.init(cx, "prefable4") ||
72458 !atomsCache->prefable3_id.init(cx, "prefable3") ||
72459 !atomsCache->prefable2_id.init(cx, "prefable2") ||
72460 !atomsCache->prefable1_id.init(cx, "prefable1") ||
72461 !atomsCache->passVariadicThirdArg_id.init(cx, "passVariadicThirdArg") ||
72462 !atomsCache->overload20_id.init(cx, "overload20") ||
72463 !atomsCache->overload19_id.init(cx, "overload19") ||
72464 !atomsCache->overload18_id.init(cx, "overload18") ||
72465 !atomsCache->overload17_id.init(cx, "overload17") ||
72466 !atomsCache->overload16_id.init(cx, "overload16") ||
72467 !atomsCache->overload15_id.init(cx, "overload15") ||
72468 !atomsCache->overload14_id.init(cx, "overload14") ||
72469 !atomsCache->overload13_id.init(cx, "overload13") ||
72470 !atomsCache->overload12_id.init(cx, "overload12") ||
72471 !atomsCache->overload11_id.init(cx, "overload11") ||
72472 !atomsCache->overload10_id.init(cx, "overload10") ||
72473 !atomsCache->overload9_id.init(cx, "overload9") ||
72474 !atomsCache->overload8_id.init(cx, "overload8") ||
72475 !atomsCache->overload7_id.init(cx, "overload7") ||
72476 !atomsCache->overload6_id.init(cx, "overload6") ||
72477 !atomsCache->overload5_id.init(cx, "overload5") ||
72478 !atomsCache->overload4_id.init(cx, "overload4") ||
72479 !atomsCache->overload3_id.init(cx, "overload3") ||
72480 !atomsCache->overload2_id.init(cx, "overload2") ||
72481 !atomsCache->overload1_id.init(cx, "overload1") ||
72482 !atomsCache->deprecatedMethodWithContext_id.init(cx, "deprecatedMethodWithContext") ||
72483 !atomsCache->deprecatedMethod_id.init(cx, "deprecatedMethod") ||
72484 !atomsCache->deprecatedAttribute_id.init(cx, "deprecatedAttribute") ||
72485 !atomsCache->exerciseTypedefInterfaces3_id.init(cx, "exerciseTypedefInterfaces3") ||
72486 !atomsCache->exerciseTypedefInterfaces2_id.init(cx, "exerciseTypedefInterfaces2") ||
72487 !atomsCache->exerciseTypedefInterfaces1_id.init(cx, "exerciseTypedefInterfaces1") ||
72488 !atomsCache->clampedByteNullable_id.init(cx, "clampedByteNullable") ||
72489 !atomsCache->clampedByte_id.init(cx, "clampedByte") ||
72490 !atomsCache->enforcedByteNullable_id.init(cx, "enforcedByteNullable") ||
72491 !atomsCache->enforcedByte_id.init(cx, "enforcedByte") ||
72492 !atomsCache->doClampNullable_id.init(cx, "doClampNullable") ||
72493 !atomsCache->doClamp_id.init(cx, "doClamp") ||
72494 !atomsCache->doEnforceRangeNullable_id.init(cx, "doEnforceRangeNullable") ||
72495 !atomsCache->doEnforceRange_id.init(cx, "doEnforceRange") ||
72496 !atomsCache->dontEnforceRangeOrClamp_id.init(cx, "dontEnforceRangeOrClamp") ||
72497 !atomsCache->passVariadicDictionary_id.init(cx, "passVariadicDictionary") ||
72498 !atomsCache->receiveDictContainingSequence_id.init(cx, "receiveDictContainingSequence") ||
72499 !atomsCache->passDictContainingSequence_id.init(cx, "passDictContainingSequence") ||
72500 !atomsCache->passDictContainingDict_id.init(cx, "passDictContainingDict") ||
72501 !atomsCache->passDictionaryOrLong_id.init(cx, "passDictionaryOrLong") ||
72502 !atomsCache->passRecordOfDictionaries_id.init(cx, "passRecordOfDictionaries") ||
72503 !atomsCache->passSequenceOfDictionaries_id.init(cx, "passSequenceOfDictionaries") ||
72504 !atomsCache->passOtherDictionary_id.init(cx, "passOtherDictionary") ||
72505 !atomsCache->receiveNullableDictionary_id.init(cx, "receiveNullableDictionary") ||
72506 !atomsCache->receiveDictionary_id.init(cx, "receiveDictionary") ||
72507 !atomsCache->passDictionary2_id.init(cx, "passDictionary2") ||
72508 !atomsCache->passDictionary_id.init(cx, "passDictionary") ||
72509 !atomsCache->attributeRenamedTo_id.init(cx, "attributeRenamedTo") ||
72510 !atomsCache->attributeGetterRenamedTo_id.init(cx, "attributeGetterRenamedTo") ||
72511 !atomsCache->methodRenamedTo_id.init(cx, "methodRenamedTo") ||
72512 !atomsCache->receiveAddrefedPromise_id.init(cx, "receiveAddrefedPromise") ||
72513 !atomsCache->receivePromise_id.init(cx, "receivePromise") ||
72514 !atomsCache->passPromiseSequence_id.init(cx, "passPromiseSequence") ||
72515 !atomsCache->passOptionalPromise_id.init(cx, "passOptionalPromise") ||
72516 !atomsCache->passPromise_id.init(cx, "passPromise") ||
72517 !atomsCache->writableNullableUnion_id.init(cx, "writableNullableUnion") ||
72518 !atomsCache->writableUnionContainingNull_id.init(cx, "writableUnionContainingNull") ||
72519 !atomsCache->writableUnion_id.init(cx, "writableUnion") ||
72520 !atomsCache->receiveNullableUnion2_id.init(cx, "receiveNullableUnion2") ||
72521 !atomsCache->receiveNullableUnion_id.init(cx, "receiveNullableUnion") ||
72522 !atomsCache->receiveUnionContainingNull_id.init(cx, "receiveUnionContainingNull") ||
72523 !atomsCache->receiveUnion2_id.init(cx, "receiveUnion2") ||
72524 !atomsCache->receiveUnion_id.init(cx, "receiveUnion") ||
72525 !atomsCache->passRecordOfUnions_id.init(cx, "passRecordOfUnions") ||
72526 !atomsCache->passVariadicNullableUnion_id.init(cx, "passVariadicNullableUnion") ||
72527 !atomsCache->passSequenceOfNullableUnions_id.init(cx, "passSequenceOfNullableUnions") ||
72528 !atomsCache->passVariadicUnion_id.init(cx, "passVariadicUnion") ||
72529 !atomsCache->passSequenceOfUnions2_id.init(cx, "passSequenceOfUnions2") ||
72530 !atomsCache->passSequenceOfUnions_id.init(cx, "passSequenceOfUnions") ||
72531 !atomsCache->passNullableUnionWithDefaultValue28_id.init(cx, "passNullableUnionWithDefaultValue28") ||
72532 !atomsCache->passNullableUnionWithDefaultValue27_id.init(cx, "passNullableUnionWithDefaultValue27") ||
72533 !atomsCache->passNullableUnionWithDefaultValue26_id.init(cx, "passNullableUnionWithDefaultValue26") ||
72534 !atomsCache->passNullableUnionWithDefaultValue25_id.init(cx, "passNullableUnionWithDefaultValue25") ||
72535 !atomsCache->passNullableUnionWithDefaultValue24_id.init(cx, "passNullableUnionWithDefaultValue24") ||
72536 !atomsCache->passNullableUnionWithDefaultValue23_id.init(cx, "passNullableUnionWithDefaultValue23") ||
72537 !atomsCache->passNullableUnionWithDefaultValue22_id.init(cx, "passNullableUnionWithDefaultValue22") ||
72538 !atomsCache->passNullableUnionWithDefaultValue21_id.init(cx, "passNullableUnionWithDefaultValue21") ||
72539 !atomsCache->passNullableUnionWithDefaultValue20_id.init(cx, "passNullableUnionWithDefaultValue20") ||
72540 !atomsCache->passNullableUnionWithDefaultValue19_id.init(cx, "passNullableUnionWithDefaultValue19") ||
72541 !atomsCache->passNullableUnionWithDefaultValue18_id.init(cx, "passNullableUnionWithDefaultValue18") ||
72542 !atomsCache->passNullableUnionWithDefaultValue17_id.init(cx, "passNullableUnionWithDefaultValue17") ||
72543 !atomsCache->passNullableUnionWithDefaultValue16_id.init(cx, "passNullableUnionWithDefaultValue16") ||
72544 !atomsCache->passNullableUnionWithDefaultValue15_id.init(cx, "passNullableUnionWithDefaultValue15") ||
72545 !atomsCache->passNullableUnionWithDefaultValue14_id.init(cx, "passNullableUnionWithDefaultValue14") ||
72546 !atomsCache->passNullableUnionWithDefaultValue13_id.init(cx, "passNullableUnionWithDefaultValue13") ||
72547 !atomsCache->passNullableUnionWithDefaultValue12_id.init(cx, "passNullableUnionWithDefaultValue12") ||
72548 !atomsCache->passNullableUnionWithDefaultValue11_id.init(cx, "passNullableUnionWithDefaultValue11") ||
72549 !atomsCache->passNullableUnionWithDefaultValue10_id.init(cx, "passNullableUnionWithDefaultValue10") ||
72550 !atomsCache->passNullableUnionWithDefaultValue9_id.init(cx, "passNullableUnionWithDefaultValue9") ||
72551 !atomsCache->passNullableUnionWithDefaultValue8_id.init(cx, "passNullableUnionWithDefaultValue8") ||
72552 !atomsCache->passNullableUnionWithDefaultValue7_id.init(cx, "passNullableUnionWithDefaultValue7") ||
72553 !atomsCache->passNullableUnionWithDefaultValue6_id.init(cx, "passNullableUnionWithDefaultValue6") ||
72554 !atomsCache->passNullableUnionWithDefaultValue5_id.init(cx, "passNullableUnionWithDefaultValue5") ||
72555 !atomsCache->passNullableUnionWithDefaultValue4_id.init(cx, "passNullableUnionWithDefaultValue4") ||
72556 !atomsCache->passNullableUnionWithDefaultValue3_id.init(cx, "passNullableUnionWithDefaultValue3") ||
72557 !atomsCache->passNullableUnionWithDefaultValue2_id.init(cx, "passNullableUnionWithDefaultValue2") ||
72558 !atomsCache->passNullableUnionWithDefaultValue1_id.init(cx, "passNullableUnionWithDefaultValue1") ||
72559 !atomsCache->passUnionWithDefaultValue25_id.init(cx, "passUnionWithDefaultValue25") ||
72560 !atomsCache->passUnionWithDefaultValue24_id.init(cx, "passUnionWithDefaultValue24") ||
72561 !atomsCache->passUnionWithDefaultValue23_id.init(cx, "passUnionWithDefaultValue23") ||
72562 !atomsCache->passUnionWithDefaultValue22_id.init(cx, "passUnionWithDefaultValue22") ||
72563 !atomsCache->passUnionWithDefaultValue21_id.init(cx, "passUnionWithDefaultValue21") ||
72564 !atomsCache->passUnionWithDefaultValue20_id.init(cx, "passUnionWithDefaultValue20") ||
72565 !atomsCache->passUnionWithDefaultValue19_id.init(cx, "passUnionWithDefaultValue19") ||
72566 !atomsCache->passUnionWithDefaultValue18_id.init(cx, "passUnionWithDefaultValue18") ||
72567 !atomsCache->passUnionWithDefaultValue17_id.init(cx, "passUnionWithDefaultValue17") ||
72568 !atomsCache->passUnionWithDefaultValue16_id.init(cx, "passUnionWithDefaultValue16") ||
72569 !atomsCache->passUnionWithDefaultValue15_id.init(cx, "passUnionWithDefaultValue15") ||
72570 !atomsCache->passUnionWithDefaultValue14_id.init(cx, "passUnionWithDefaultValue14") ||
72571 !atomsCache->passUnionWithDefaultValue13_id.init(cx, "passUnionWithDefaultValue13") ||
72572 !atomsCache->passUnionWithDefaultValue12_id.init(cx, "passUnionWithDefaultValue12") ||
72573 !atomsCache->passUnionWithDefaultValue11_id.init(cx, "passUnionWithDefaultValue11") ||
72574 !atomsCache->passUnionWithDefaultValue10_id.init(cx, "passUnionWithDefaultValue10") ||
72575 !atomsCache->passUnionWithDefaultValue9_id.init(cx, "passUnionWithDefaultValue9") ||
72576 !atomsCache->passUnionWithDefaultValue8_id.init(cx, "passUnionWithDefaultValue8") ||
72577 !atomsCache->passUnionWithDefaultValue7_id.init(cx, "passUnionWithDefaultValue7") ||
72578 !atomsCache->passUnionWithDefaultValue6_id.init(cx, "passUnionWithDefaultValue6") ||
72579 !atomsCache->passUnionWithDefaultValue5_id.init(cx, "passUnionWithDefaultValue5") ||
72580 !atomsCache->passUnionWithDefaultValue4_id.init(cx, "passUnionWithDefaultValue4") ||
72581 !atomsCache->passUnionWithDefaultValue3_id.init(cx, "passUnionWithDefaultValue3") ||
72582 !atomsCache->passUnionWithDefaultValue2_id.init(cx, "passUnionWithDefaultValue2") ||
72583 !atomsCache->passUnionWithDefaultValue1_id.init(cx, "passUnionWithDefaultValue1") ||
72584 !atomsCache->passUnionWithObject_id.init(cx, "passUnionWithObject") ||
72585 !atomsCache->passUnionWithEnum_id.init(cx, "passUnionWithEnum") ||
72586 !atomsCache->passUnionWithString_id.init(cx, "passUnionWithString") ||
72587 !atomsCache->passUnionWithTypedArraysOrNull_id.init(cx, "passUnionWithTypedArraysOrNull") ||
72588 !atomsCache->passUnionWithTypedArrays_id.init(cx, "passUnionWithTypedArrays") ||
72589 !atomsCache->passUnionWithArrayBufferOrNull_id.init(cx, "passUnionWithArrayBufferOrNull") ||
72590 !atomsCache->passUnionWithArrayBuffer_id.init(cx, "passUnionWithArrayBuffer") ||
72591 !atomsCache->passOptionalNullableUnionWithDefaultValue_id.init(cx, "passOptionalNullableUnionWithDefaultValue") ||
72592 !atomsCache->passOptionalNullableUnion_id.init(cx, "passOptionalNullableUnion") ||
72593 !atomsCache->passOptionalUnion_id.init(cx, "passOptionalUnion") ||
72594 !atomsCache->passNullableUnion_id.init(cx, "passNullableUnion") ||
72595 !atomsCache->passUnionWithNullable_id.init(cx, "passUnionWithNullable") ||
72596 !atomsCache->passUnionWithSVS_id.init(cx, "passUnionWithSVS") ||
72597 !atomsCache->passUnionWithSequenceAndRecord_id.init(cx, "passUnionWithSequenceAndRecord") ||
72598 !atomsCache->passUnionWithRecordAndSequence_id.init(cx, "passUnionWithRecordAndSequence") ||
72599 !atomsCache->passUnionWithRecord_id.init(cx, "passUnionWithRecord") ||
72600 !atomsCache->passUnionWithUTF8String_id.init(cx, "passUnionWithUTF8String") ||
72601 !atomsCache->passUnionWithByteString_id.init(cx, "passUnionWithByteString") ||
72602 !atomsCache->passUnionWithCallback_id.init(cx, "passUnionWithCallback") ||
72603 !atomsCache->passUnion28_id.init(cx, "passUnion28") ||
72604 !atomsCache->passUnion27_id.init(cx, "passUnion27") ||
72605 !atomsCache->passUnion26_id.init(cx, "passUnion26") ||
72606 !atomsCache->passUnion25_id.init(cx, "passUnion25") ||
72607 !atomsCache->passUnion24_id.init(cx, "passUnion24") ||
72608 !atomsCache->passUnion23_id.init(cx, "passUnion23") ||
72609 !atomsCache->passUnion22_id.init(cx, "passUnion22") ||
72610 !atomsCache->passUnion21_id.init(cx, "passUnion21") ||
72611 !atomsCache->passUnion20_id.init(cx, "passUnion20") ||
72612 !atomsCache->passUnion19_id.init(cx, "passUnion19") ||
72613 !atomsCache->passUnion18_id.init(cx, "passUnion18") ||
72614 !atomsCache->passUnion17_id.init(cx, "passUnion17") ||
72615 !atomsCache->passUnion16_id.init(cx, "passUnion16") ||
72616 !atomsCache->passUnion15_id.init(cx, "passUnion15") ||
72617 !atomsCache->passUnion14_id.init(cx, "passUnion14") ||
72618 !atomsCache->passUnion13_id.init(cx, "passUnion13") ||
72619 !atomsCache->passUnion12_id.init(cx, "passUnion12") ||
72620 !atomsCache->passUnion11_id.init(cx, "passUnion11") ||
72621 !atomsCache->passUnion10_id.init(cx, "passUnion10") ||
72622 !atomsCache->passUnion9_id.init(cx, "passUnion9") ||
72623 !atomsCache->passUnion8_id.init(cx, "passUnion8") ||
72624 !atomsCache->passUnion7_id.init(cx, "passUnion7") ||
72625 !atomsCache->passUnion6_id.init(cx, "passUnion6") ||
72626 !atomsCache->passUnion5_id.init(cx, "passUnion5") ||
72627 !atomsCache->passUnion4_id.init(cx, "passUnion4") ||
72628 !atomsCache->passUnion3_id.init(cx, "passUnion3") ||
72629 !atomsCache->passUnion2_id.init(cx, "passUnion2") ||
72630 !atomsCache->passUnion_id.init(cx, "passUnion") ||
72631 !atomsCache->receiveNullableObject_id.init(cx, "receiveNullableObject") ||
72632 !atomsCache->receiveObject_id.init(cx, "receiveObject") ||
72633 !atomsCache->passRecordOfObject_id.init(cx, "passRecordOfObject") ||
72634 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfNullableObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfNullableObject") ||
72635 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfObject_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfObject") ||
72636 !atomsCache->passNullableSequenceOfObject_id.init(cx, "passNullableSequenceOfObject") ||
72637 !atomsCache->passSequenceOfNullableObject_id.init(cx, "passSequenceOfNullableObject") ||
72638 !atomsCache->passSequenceOfObject_id.init(cx, "passSequenceOfObject") ||
72639 !atomsCache->passOptionalNullableObjectWithDefaultValue_id.init(cx, "passOptionalNullableObjectWithDefaultValue") ||
72640 !atomsCache->passOptionalNullableObject_id.init(cx, "passOptionalNullableObject") ||
72641 !atomsCache->passOptionalObject_id.init(cx, "passOptionalObject") ||
72642 !atomsCache->passVariadicNullableObject_id.init(cx, "passVariadicNullableObject") ||
72643 !atomsCache->passNullableObject_id.init(cx, "passNullableObject") ||
72644 !atomsCache->passVariadicObject_id.init(cx, "passVariadicObject") ||
72645 !atomsCache->passObject_id.init(cx, "passObject") ||
72646 !atomsCache->receiveAny_id.init(cx, "receiveAny") ||
72647 !atomsCache->passOptionalNullableSequenceOfNullableRecordOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableRecordOfAny") ||
72648 !atomsCache->passOptionalNullableRecordOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableRecordOfNullableSequenceOfAny") ||
72649 !atomsCache->passOptionalNullableRecordOfNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfNullableRecordOfAny") ||
72650 !atomsCache->passNullableRecordOfNullableRecordOfAny_id.init(cx, "passNullableRecordOfNullableRecordOfAny") ||
72651 !atomsCache->passRecordOfNullableRecordOfAny_id.init(cx, "passRecordOfNullableRecordOfAny") ||
72652 !atomsCache->passRecordOfRecordOfAny_id.init(cx, "passRecordOfRecordOfAny") ||
72653 !atomsCache->passOptionalRecordOfAnyWithDefaultValue_id.init(cx, "passOptionalRecordOfAnyWithDefaultValue") ||
72654 !atomsCache->passOptionalNullableRecordOfAny_id.init(cx, "passOptionalNullableRecordOfAny") ||
72655 !atomsCache->passOptionalRecordOfAny_id.init(cx, "passOptionalRecordOfAny") ||
72656 !atomsCache->passNullableRecordOfAny_id.init(cx, "passNullableRecordOfAny") ||
72657 !atomsCache->passRecordOfAny_id.init(cx, "passRecordOfAny") ||
72658 !atomsCache->passOptionalNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfNullableSequenceOfAny") ||
72659 !atomsCache->passNullableSequenceOfNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfNullableSequenceOfAny") ||
72660 !atomsCache->passSequenceOfNullableSequenceOfAny_id.init(cx, "passSequenceOfNullableSequenceOfAny") ||
72661 !atomsCache->passSequenceOfSequenceOfAny_id.init(cx, "passSequenceOfSequenceOfAny") ||
72662 !atomsCache->passOptionalSequenceOfAnyWithDefaultValue_id.init(cx, "passOptionalSequenceOfAnyWithDefaultValue") ||
72663 !atomsCache->passOptionalNullableSequenceOfAny_id.init(cx, "passOptionalNullableSequenceOfAny") ||
72664 !atomsCache->passOptionalSequenceOfAny_id.init(cx, "passOptionalSequenceOfAny") ||
72665 !atomsCache->passNullableSequenceOfAny_id.init(cx, "passNullableSequenceOfAny") ||
72666 !atomsCache->passSequenceOfAny_id.init(cx, "passSequenceOfAny") ||
72667 !atomsCache->passAnyDefaultNull_id.init(cx, "passAnyDefaultNull") ||
72668 !atomsCache->passOptionalAny_id.init(cx, "passOptionalAny") ||
72669 !atomsCache->passVariadicAny_id.init(cx, "passVariadicAny") ||
72670 !atomsCache->passAny_id.init(cx, "passAny") ||
72671 !atomsCache->passOptionalNullableTreatAsNullCallbackWithDefaultValue_id.init(cx, "passOptionalNullableTreatAsNullCallbackWithDefaultValue") ||
72672 !atomsCache->receiveNullableCallback_id.init(cx, "receiveNullableCallback") ||
72673 !atomsCache->receiveCallback_id.init(cx, "receiveCallback") ||
72674 !atomsCache->passOptionalNullableCallbackWithDefaultValue_id.init(cx, "passOptionalNullableCallbackWithDefaultValue") ||
72675 !atomsCache->passOptionalNullableCallback_id.init(cx, "passOptionalNullableCallback") ||
72676 !atomsCache->passOptionalCallback_id.init(cx, "passOptionalCallback") ||
72677 !atomsCache->passNullableCallback_id.init(cx, "passNullableCallback") ||
72678 !atomsCache->passCallback_id.init(cx, "passCallback") ||
72679 !atomsCache->readonlyEnumAttribute_id.init(cx, "readonlyEnumAttribute") ||
72680 !atomsCache->enumAttribute_id.init(cx, "enumAttribute") ||
72681 !atomsCache->receiveNullableEnum_id.init(cx, "receiveNullableEnum") ||
72682 !atomsCache->receiveEnum_id.init(cx, "receiveEnum") ||
72683 !atomsCache->passOptionalNullableEnumWithDefaultValue2_id.init(cx, "passOptionalNullableEnumWithDefaultValue2") ||
72684 !atomsCache->passOptionalNullableEnumWithDefaultValue_id.init(cx, "passOptionalNullableEnumWithDefaultValue") ||
72685 !atomsCache->passOptionalNullableEnum_id.init(cx, "passOptionalNullableEnum") ||
72686 !atomsCache->passEnumWithDefault_id.init(cx, "passEnumWithDefault") ||
72687 !atomsCache->passOptionalEnum_id.init(cx, "passOptionalEnum") ||
72688 !atomsCache->passNullableEnum_id.init(cx, "passNullableEnum") ||
72689 !atomsCache->passEnum_id.init(cx, "passEnum") ||
72690 !atomsCache->jsStringAttr_id.init(cx, "jsStringAttr") ||
72691 !atomsCache->readonlyJSStringAttr_id.init(cx, "readonlyJSStringAttr") ||
72692 !atomsCache->receiveJSString_id.init(cx, "receiveJSString") ||
72693 !atomsCache->passOptionalJSStringWithDefaultValue_id.init(cx, "passOptionalJSStringWithDefaultValue") ||
72694 !atomsCache->passJSString_id.init(cx, "passJSString") ||
72695 !atomsCache->receiveSVS_id.init(cx, "receiveSVS") ||
72696 !atomsCache->passVariadicSVS_id.init(cx, "passVariadicSVS") ||
72697 !atomsCache->passOptionalNullableSVSWithDefaultValue_id.init(cx, "passOptionalNullableSVSWithDefaultValue") ||
72698 !atomsCache->passOptionalNullableSVS_id.init(cx, "passOptionalNullableSVS") ||
72699 !atomsCache->passOptionalSVSWithDefaultValue_id.init(cx, "passOptionalSVSWithDefaultValue") ||
72700 !atomsCache->passOptionalSVS_id.init(cx, "passOptionalSVS") ||
72701 !atomsCache->passNullableSVS_id.init(cx, "passNullableSVS") ||
72702 !atomsCache->passSVS_id.init(cx, "passSVS") ||
72703 !atomsCache->passOptionalUnionUTF8StringWithDefaultValue_id.init(cx, "passOptionalUnionUTF8StringWithDefaultValue") ||
72704 !atomsCache->passOptionalUnionUTF8String_id.init(cx, "passOptionalUnionUTF8String") ||
72705 !atomsCache->passUnionUTF8String_id.init(cx, "passUnionUTF8String") ||
72706 !atomsCache->passVariadicUTF8String_id.init(cx, "passVariadicUTF8String") ||
72707 !atomsCache->passOptionalNullableUTF8StringWithDefaultValue_id.init(cx, "passOptionalNullableUTF8StringWithDefaultValue") ||
72708 !atomsCache->passOptionalNullableUTF8String_id.init(cx, "passOptionalNullableUTF8String") ||
72709 !atomsCache->passOptionalUTF8StringWithDefaultValue_id.init(cx, "passOptionalUTF8StringWithDefaultValue") ||
72710 !atomsCache->passOptionalUTF8String_id.init(cx, "passOptionalUTF8String") ||
72711 !atomsCache->passNullableUTF8String_id.init(cx, "passNullableUTF8String") ||
72712 !atomsCache->passUTF8String_id.init(cx, "passUTF8String") ||
72713 !atomsCache->passOptionalUnionByteStringWithDefaultValue_id.init(cx, "passOptionalUnionByteStringWithDefaultValue") ||
72714 !atomsCache->passOptionalUnionByteString_id.init(cx, "passOptionalUnionByteString") ||
72715 !atomsCache->passUnionByteString_id.init(cx, "passUnionByteString") ||
72716 !atomsCache->passVariadicByteString_id.init(cx, "passVariadicByteString") ||
72717 !atomsCache->passOptionalNullableByteStringWithDefaultValue_id.init(cx, "passOptionalNullableByteStringWithDefaultValue") ||
72718 !atomsCache->passOptionalNullableByteString_id.init(cx, "passOptionalNullableByteString") ||
72719 !atomsCache->passOptionalByteStringWithDefaultValue_id.init(cx, "passOptionalByteStringWithDefaultValue") ||
72720 !atomsCache->passOptionalByteString_id.init(cx, "passOptionalByteString") ||
72721 !atomsCache->passNullableByteString_id.init(cx, "passNullableByteString") ||
72722 !atomsCache->passByteString_id.init(cx, "passByteString") ||
72723 !atomsCache->passVariadicString_id.init(cx, "passVariadicString") ||
72724 !atomsCache->passOptionalNullableStringWithDefaultValue_id.init(cx, "passOptionalNullableStringWithDefaultValue") ||
72725 !atomsCache->passOptionalNullableString_id.init(cx, "passOptionalNullableString") ||
72726 !atomsCache->passOptionalStringWithDefaultValue_id.init(cx, "passOptionalStringWithDefaultValue") ||
72727 !atomsCache->passOptionalString_id.init(cx, "passOptionalString") ||
72728 !atomsCache->passNullableString_id.init(cx, "passNullableString") ||
72729 !atomsCache->passString_id.init(cx, "passString") ||
72730 !atomsCache->uint8ArrayAttr_id.init(cx, "uint8ArrayAttr") ||
72731 !atomsCache->receiveUint8Array_id.init(cx, "receiveUint8Array") ||
72732 !atomsCache->passVariadicNullableTypedArray_id.init(cx, "passVariadicNullableTypedArray") ||
72733 !atomsCache->passVariadicTypedArray_id.init(cx, "passVariadicTypedArray") ||
72734 !atomsCache->passRecordOfNullableArrayBuffers_id.init(cx, "passRecordOfNullableArrayBuffers") ||
72735 !atomsCache->passRecordOfArrayBuffers_id.init(cx, "passRecordOfArrayBuffers") ||
72736 !atomsCache->passSequenceOfNullableArrayBuffers_id.init(cx, "passSequenceOfNullableArrayBuffers") ||
72737 !atomsCache->passSequenceOfArrayBuffers_id.init(cx, "passSequenceOfArrayBuffers") ||
72738 !atomsCache->passFloat64Array_id.init(cx, "passFloat64Array") ||
72739 !atomsCache->passFloat32Array_id.init(cx, "passFloat32Array") ||
72740 !atomsCache->passUint8ClampedArray_id.init(cx, "passUint8ClampedArray") ||
72741 !atomsCache->passUint32Array_id.init(cx, "passUint32Array") ||
72742 !atomsCache->passUint16Array_id.init(cx, "passUint16Array") ||
72743 !atomsCache->passUint8Array_id.init(cx, "passUint8Array") ||
72744 !atomsCache->passInt32Array_id.init(cx, "passInt32Array") ||
72745 !atomsCache->passInt16Array_id.init(cx, "passInt16Array") ||
72746 !atomsCache->passInt8Array_id.init(cx, "passInt8Array") ||
72747 !atomsCache->passArrayBufferView_id.init(cx, "passArrayBufferView") ||
72748 !atomsCache->passOptionalNullableArrayBufferWithDefaultValue_id.init(cx, "passOptionalNullableArrayBufferWithDefaultValue") ||
72749 !atomsCache->passOptionalNullableArrayBuffer_id.init(cx, "passOptionalNullableArrayBuffer") ||
72750 !atomsCache->passOptionalArrayBuffer_id.init(cx, "passOptionalArrayBuffer") ||
72751 !atomsCache->passNullableArrayBuffer_id.init(cx, "passNullableArrayBuffer") ||
72752 !atomsCache->passArrayBuffer_id.init(cx, "passArrayBuffer") ||
72753 !atomsCache->receiveAnyRecord_id.init(cx, "receiveAnyRecord") ||
72754 !atomsCache->receiveNullableRecordOfNullableInts_id.init(cx, "receiveNullableRecordOfNullableInts") ||
72755 !atomsCache->receiveRecordOfNullableInts_id.init(cx, "receiveRecordOfNullableInts") ||
72756 !atomsCache->receiveNullableRecord_id.init(cx, "receiveNullableRecord") ||
72757 !atomsCache->receiveRecord_id.init(cx, "receiveRecord") ||
72758 !atomsCache->passRecordOfRecords_id.init(cx, "passRecordOfRecords") ||
72759 !atomsCache->passUTF8StringRecord_id.init(cx, "passUTF8StringRecord") ||
72760 !atomsCache->passByteStringRecord_id.init(cx, "passByteStringRecord") ||
72761 !atomsCache->passStringRecord_id.init(cx, "passStringRecord") ||
72762 !atomsCache->passNullableExternalInterfaceRecord_id.init(cx, "passNullableExternalInterfaceRecord") ||
72763 !atomsCache->passExternalInterfaceRecord_id.init(cx, "passExternalInterfaceRecord") ||
72764 !atomsCache->passOptionalObjectRecord_id.init(cx, "passOptionalObjectRecord") ||
72765 !atomsCache->passOptionalNullableRecordWithDefaultValue_id.init(cx, "passOptionalNullableRecordWithDefaultValue") ||
72766 !atomsCache->passOptionalNullableRecord_id.init(cx, "passOptionalNullableRecord") ||
72767 !atomsCache->passOptionalRecord_id.init(cx, "passOptionalRecord") ||
72768 !atomsCache->passNullableCastableObjectNullableRecord_id.init(cx, "passNullableCastableObjectNullableRecord") ||
72769 !atomsCache->passCastableObjectNullableRecord_id.init(cx, "passCastableObjectNullableRecord") ||
72770 !atomsCache->passNullableCastableObjectRecord_id.init(cx, "passNullableCastableObjectRecord") ||
72771 !atomsCache->passCastableObjectRecord_id.init(cx, "passCastableObjectRecord") ||
72772 !atomsCache->passOptionalNullableRecordOfNullableInts_id.init(cx, "passOptionalNullableRecordOfNullableInts") ||
72773 !atomsCache->passOptionalRecordOfNullableInts_id.init(cx, "passOptionalRecordOfNullableInts") ||
72774 !atomsCache->passRecordOfNullableInts_id.init(cx, "passRecordOfNullableInts") ||
72775 !atomsCache->passNullableRecord_id.init(cx, "passNullableRecord") ||
72776 !atomsCache->passRecord_id.init(cx, "passRecord") ||
72777 !atomsCache->passSequenceOfSequencesOfSequences_id.init(cx, "passSequenceOfSequencesOfSequences") ||
72778 !atomsCache->passSequenceOfSequences_id.init(cx, "passSequenceOfSequences") ||
72779 !atomsCache->receiveNullableObjectSequence_id.init(cx, "receiveNullableObjectSequence") ||
72780 !atomsCache->receiveObjectSequence_id.init(cx, "receiveObjectSequence") ||
72781 !atomsCache->receiveNullableAnySequence_id.init(cx, "receiveNullableAnySequence") ||
72782 !atomsCache->receiveAnySequence_id.init(cx, "receiveAnySequence") ||
72783 !atomsCache->receiveUTF8StringSequence_id.init(cx, "receiveUTF8StringSequence") ||
72784 !atomsCache->receiveByteStringSequence_id.init(cx, "receiveByteStringSequence") ||
72785 !atomsCache->receiveStringSequence_id.init(cx, "receiveStringSequence") ||
72786 !atomsCache->passNullableExternalInterfaceSequence_id.init(cx, "passNullableExternalInterfaceSequence") ||
72787 !atomsCache->passExternalInterfaceSequence_id.init(cx, "passExternalInterfaceSequence") ||
72788 !atomsCache->passOptionalObjectSequence_id.init(cx, "passOptionalObjectSequence") ||
72789 !atomsCache->passOptionalNullableSequenceWithDefaultValue2_id.init(cx, "passOptionalNullableSequenceWithDefaultValue2") ||
72790 !atomsCache->passOptionalNullableSequenceWithDefaultValue_id.init(cx, "passOptionalNullableSequenceWithDefaultValue") ||
72791 !atomsCache->passOptionalNullableSequence_id.init(cx, "passOptionalNullableSequence") ||
72792 !atomsCache->passOptionalSequenceWithDefaultValue_id.init(cx, "passOptionalSequenceWithDefaultValue") ||
72793 !atomsCache->passOptionalSequence_id.init(cx, "passOptionalSequence") ||
72794 !atomsCache->passNullableCastableObjectNullableSequence_id.init(cx, "passNullableCastableObjectNullableSequence") ||
72795 !atomsCache->passCastableObjectNullableSequence_id.init(cx, "passCastableObjectNullableSequence") ||
72796 !atomsCache->passNullableCastableObjectSequence_id.init(cx, "passNullableCastableObjectSequence") ||
72797 !atomsCache->passCastableObjectSequence_id.init(cx, "passCastableObjectSequence") ||
72798 !atomsCache->receiveWeakNullableCastableObjectNullableSequence_id.init(cx, "receiveWeakNullableCastableObjectNullableSequence") ||
72799 !atomsCache->receiveWeakCastableObjectNullableSequence_id.init(cx, "receiveWeakCastableObjectNullableSequence") ||
72800 !atomsCache->receiveWeakNullableCastableObjectSequence_id.init(cx, "receiveWeakNullableCastableObjectSequence") ||
72801 !atomsCache->receiveWeakCastableObjectSequence_id.init(cx, "receiveWeakCastableObjectSequence") ||
72802 !atomsCache->receiveNullableCastableObjectNullableSequence_id.init(cx, "receiveNullableCastableObjectNullableSequence") ||
72803 !atomsCache->receiveCastableObjectNullableSequence_id.init(cx, "receiveCastableObjectNullableSequence") ||
72804 !atomsCache->receiveNullableCallbackObjectSequence_id.init(cx, "receiveNullableCallbackObjectSequence") ||
72805 !atomsCache->receiveNullableCastableObjectSequence_id.init(cx, "receiveNullableCastableObjectSequence") ||
72806 !atomsCache->receiveCallbackObjectSequence_id.init(cx, "receiveCallbackObjectSequence") ||
72807 !atomsCache->receiveCastableObjectSequence_id.init(cx, "receiveCastableObjectSequence") ||
72808 !atomsCache->passOptionalNullableSequenceOfNullableInts_id.init(cx, "passOptionalNullableSequenceOfNullableInts") ||
72809 !atomsCache->passOptionalSequenceOfNullableInts_id.init(cx, "passOptionalSequenceOfNullableInts") ||
72810 !atomsCache->passSequenceOfNullableInts_id.init(cx, "passSequenceOfNullableInts") ||
72811 !atomsCache->passNullableSequence_id.init(cx, "passNullableSequence") ||
72812 !atomsCache->passSequence_id.init(cx, "passSequence") ||
72813 !atomsCache->receiveNullableSequenceOfNullableInts_id.init(cx, "receiveNullableSequenceOfNullableInts") ||
72814 !atomsCache->receiveSequenceOfNullableInts_id.init(cx, "receiveSequenceOfNullableInts") ||
72815 !atomsCache->receiveNullableSequence_id.init(cx, "receiveNullableSequence") ||
72816 !atomsCache->receiveSequence_id.init(cx, "receiveSequence") ||
72817 !atomsCache->passOptionalCallbackInterfaceWithDefault_id.init(cx, "passOptionalCallbackInterfaceWithDefault") ||
72818 !atomsCache->passOptionalNonNullCallbackInterface_id.init(cx, "passOptionalNonNullCallbackInterface") ||
72819 !atomsCache->passOptionalCallbackInterface_id.init(cx, "passOptionalCallbackInterface") ||
72820 !atomsCache->nullableCallbackInterface_id.init(cx, "nullableCallbackInterface") ||
72821 !atomsCache->nonNullCallbackInterface_id.init(cx, "nonNullCallbackInterface") ||
72822 !atomsCache->passNullableCallbackInterface_id.init(cx, "passNullableCallbackInterface") ||
72823 !atomsCache->passCallbackInterface_id.init(cx, "passCallbackInterface") ||
72824 !atomsCache->receiveWeakNullableCallbackInterface_id.init(cx, "receiveWeakNullableCallbackInterface") ||
72825 !atomsCache->receiveWeakCallbackInterface_id.init(cx, "receiveWeakCallbackInterface") ||
72826 !atomsCache->receiveNullableCallbackInterface_id.init(cx, "receiveNullableCallbackInterface") ||
72827 !atomsCache->receiveCallbackInterface_id.init(cx, "receiveCallbackInterface") ||
72828 !atomsCache->passOptionalExternalWithDefault_id.init(cx, "passOptionalExternalWithDefault") ||
72829 !atomsCache->passOptionalNonNullExternal_id.init(cx, "passOptionalNonNullExternal") ||
72830 !atomsCache->passOptionalExternal_id.init(cx, "passOptionalExternal") ||
72831 !atomsCache->nullableExternal_id.init(cx, "nullableExternal") ||
72832 !atomsCache->nonNullExternal_id.init(cx, "nonNullExternal") ||
72833 !atomsCache->passNullableExternal_id.init(cx, "passNullableExternal") ||
72834 !atomsCache->passExternal_id.init(cx, "passExternal") ||
72835 !atomsCache->receiveWeakNullableExternal_id.init(cx, "receiveWeakNullableExternal") ||
72836 !atomsCache->receiveWeakExternal_id.init(cx, "receiveWeakExternal") ||
72837 !atomsCache->receiveNullableExternal_id.init(cx, "receiveNullableExternal") ||
72838 !atomsCache->receiveExternal_id.init(cx, "receiveExternal") ||
72839 !atomsCache->receiveNullableNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceNullableSequence") ||
72840 !atomsCache->receiveNonWrapperCacheInterfaceNullableSequence_id.init(cx, "receiveNonWrapperCacheInterfaceNullableSequence") ||
72841 !atomsCache->receiveNullableNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNullableNonWrapperCacheInterfaceSequence") ||
72842 !atomsCache->receiveNonWrapperCacheInterfaceSequence_id.init(cx, "receiveNonWrapperCacheInterfaceSequence") ||
72843 !atomsCache->receiveNullableNonWrapperCacheInterface_id.init(cx, "receiveNullableNonWrapperCacheInterface") ||
72844 !atomsCache->receiveNonWrapperCacheInterface_id.init(cx, "receiveNonWrapperCacheInterface") ||
72845 !atomsCache->passOptionalSelfWithDefault_id.init(cx, "passOptionalSelfWithDefault") ||
72846 !atomsCache->passOptionalNonNullSelf_id.init(cx, "passOptionalNonNullSelf") ||
72847 !atomsCache->passOptionalSelf_id.init(cx, "passOptionalSelf") ||
72848 !atomsCache->nullableSelf_id.init(cx, "nullableSelf") ||
72849 !atomsCache->nonNullSelf_id.init(cx, "nonNullSelf") ||
72850 !atomsCache->passNullableSelf_id.init(cx, "passNullableSelf") ||
72851 !atomsCache->passSelf_id.init(cx, "passSelf") ||
72852 !atomsCache->receiveWeakNullableSelf_id.init(cx, "receiveWeakNullableSelf") ||
72853 !atomsCache->receiveWeakSelf_id.init(cx, "receiveWeakSelf") ||
72854 !atomsCache->receiveNullableSelf_id.init(cx, "receiveNullableSelf") ||
72855 !atomsCache->receiveSelf_id.init(cx, "receiveSelf") ||
72856 !atomsCache->lenientDoubleAttr_id.init(cx, "lenientDoubleAttr") ||
72857 !atomsCache->lenientFloatAttr_id.init(cx, "lenientFloatAttr") ||
72858 !atomsCache->passLenientFloat_id.init(cx, "passLenientFloat") ||
72859 !atomsCache->passFloat_id.init(cx, "passFloat") ||
72860 !atomsCache->writableNullableUnrestrictedDouble_id.init(cx, "writableNullableUnrestrictedDouble") ||
72861 !atomsCache->writableNullableDouble_id.init(cx, "writableNullableDouble") ||
72862 !atomsCache->writableUnrestrictedDouble_id.init(cx, "writableUnrestrictedDouble") ||
72863 !atomsCache->writableDouble_id.init(cx, "writableDouble") ||
72864 !atomsCache->writableNullableUnrestrictedFloat_id.init(cx, "writableNullableUnrestrictedFloat") ||
72865 !atomsCache->writableNullableFloat_id.init(cx, "writableNullableFloat") ||
72866 !atomsCache->writableUnrestrictedFloat_id.init(cx, "writableUnrestrictedFloat") ||
72867 !atomsCache->writableFloat_id.init(cx, "writableFloat") ||
72868 !atomsCache->passOptionalUnsignedLongLongWithDefault_id.init(cx, "passOptionalUnsignedLongLongWithDefault") ||
72869 !atomsCache->passOptionalUnsignedLongLong_id.init(cx, "passOptionalUnsignedLongLong") ||
72870 !atomsCache->receiveUnsignedLongLong_id.init(cx, "receiveUnsignedLongLong") ||
72871 !atomsCache->passUnsignedLongLong_id.init(cx, "passUnsignedLongLong") ||
72872 !atomsCache->writableUnsignedLongLong_id.init(cx, "writableUnsignedLongLong") ||
72873 !atomsCache->readonlyUnsignedLongLong_id.init(cx, "readonlyUnsignedLongLong") ||
72874 !atomsCache->passOptionalUnsignedLongWithDefault_id.init(cx, "passOptionalUnsignedLongWithDefault") ||
72875 !atomsCache->passOptionalUnsignedLong_id.init(cx, "passOptionalUnsignedLong") ||
72876 !atomsCache->receiveUnsignedLong_id.init(cx, "receiveUnsignedLong") ||
72877 !atomsCache->passUnsignedLong_id.init(cx, "passUnsignedLong") ||
72878 !atomsCache->writableUnsignedLong_id.init(cx, "writableUnsignedLong") ||
72879 !atomsCache->readonlyUnsignedLong_id.init(cx, "readonlyUnsignedLong") ||
72880 !atomsCache->passOptionalUnsignedShortWithDefault_id.init(cx, "passOptionalUnsignedShortWithDefault") ||
72881 !atomsCache->passOptionalUnsignedShort_id.init(cx, "passOptionalUnsignedShort") ||
72882 !atomsCache->receiveUnsignedShort_id.init(cx, "receiveUnsignedShort") ||
72883 !atomsCache->passUnsignedShort_id.init(cx, "passUnsignedShort") ||
72884 !atomsCache->writableUnsignedShort_id.init(cx, "writableUnsignedShort") ||
72885 !atomsCache->readonlyUnsignedShort_id.init(cx, "readonlyUnsignedShort") ||
72886 !atomsCache->passOptionalOctetWithDefault_id.init(cx, "passOptionalOctetWithDefault") ||
72887 !atomsCache->passOptionalOctet_id.init(cx, "passOptionalOctet") ||
72888 !atomsCache->receiveOctet_id.init(cx, "receiveOctet") ||
72889 !atomsCache->passOctet_id.init(cx, "passOctet") ||
72890 !atomsCache->writableOctet_id.init(cx, "writableOctet") ||
72891 !atomsCache->readonlyOctet_id.init(cx, "readonlyOctet") ||
72892 !atomsCache->passOptionalLongLongWithDefault_id.init(cx, "passOptionalLongLongWithDefault") ||
72893 !atomsCache->passOptionalLongLong_id.init(cx, "passOptionalLongLong") ||
72894 !atomsCache->receiveLongLong_id.init(cx, "receiveLongLong") ||
72895 !atomsCache->passLongLong_id.init(cx, "passLongLong") ||
72896 !atomsCache->writableLongLong_id.init(cx, "writableLongLong") ||
72897 !atomsCache->readonlyLongLong_id.init(cx, "readonlyLongLong") ||
72898 !atomsCache->passOptionalLongWithDefault_id.init(cx, "passOptionalLongWithDefault") ||
72899 !atomsCache->passOptionalLong_id.init(cx, "passOptionalLong") ||
72900 !atomsCache->receiveLong_id.init(cx, "receiveLong") ||
72901 !atomsCache->passLong_id.init(cx, "passLong") ||
72902 !atomsCache->writableLong_id.init(cx, "writableLong") ||
72903 !atomsCache->readonlyLong_id.init(cx, "readonlyLong") ||
72904 !atomsCache->passOptionalShortWithDefault_id.init(cx, "passOptionalShortWithDefault") ||
72905 !atomsCache->passOptionalShort_id.init(cx, "passOptionalShort") ||
72906 !atomsCache->receiveShort_id.init(cx, "receiveShort") ||
72907 !atomsCache->passShort_id.init(cx, "passShort") ||
72908 !atomsCache->writableShort_id.init(cx, "writableShort") ||
72909 !atomsCache->readonlyShort_id.init(cx, "readonlyShort") ||
72910 !atomsCache->returnDeviceStateDependentByte_id.init(cx, "returnDeviceStateDependentByte") ||
72911 !atomsCache->returnConstantByte_id.init(cx, "returnConstantByte") ||
72912 !atomsCache->returnDOMDependentByte_id.init(cx, "returnDOMDependentByte") ||
72913 !atomsCache->returnByteSideEffectFree_id.init(cx, "returnByteSideEffectFree") ||
72914 !atomsCache->deviceStateDependentByte_id.init(cx, "deviceStateDependentByte") ||
72915 !atomsCache->constantByte_id.init(cx, "constantByte") ||
72916 !atomsCache->domDependentByte_id.init(cx, "domDependentByte") ||
72917 !atomsCache->sideEffectFreeByte_id.init(cx, "sideEffectFreeByte") ||
72918 !atomsCache->passVariadicByte_id.init(cx, "passVariadicByte") ||
72919 !atomsCache->passOptionalNullableByte_id.init(cx, "passOptionalNullableByte") ||
72920 !atomsCache->passNullableByte_id.init(cx, "passNullableByte") ||
72921 !atomsCache->passOptionalByteWithDefaultBeforeRequired_id.init(cx, "passOptionalByteWithDefaultBeforeRequired") ||
72922 !atomsCache->passOptionalByteWithDefault_id.init(cx, "passOptionalByteWithDefault") ||
72923 !atomsCache->passOptionalByteBeforeRequired_id.init(cx, "passOptionalByteBeforeRequired") ||
72924 !atomsCache->passOptionalByte_id.init(cx, "passOptionalByte") ||
72925 !atomsCache->receiveByte_id.init(cx, "receiveByte") ||
72926 !atomsCache->passByte_id.init(cx, "passByte") ||
72927 !atomsCache->writableByte_id.init(cx, "writableByte") ||
72928 !atomsCache->readonlyByte_id.init(cx, "readonlyByte")) {
72929 return false;
72930 }
72931 return true;
72932}
72933
72934
72935int8_t
72936TestJSImplInterfaceJSImpl::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm)
72937{
72938 CallSetup s(this, aRv, "TestJSImplInterface.readonlyByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72939 if (aRv.Failed()) {
72940 return int8_t(0);
72941 }
72942 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72942); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72942; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72943 BindingCallContext& cx = s.GetCallContext();
72944
72945 JS::Rooted<JS::Value> rval(cx);
72946
72947 JS::Rooted<JSObject *> callback(cx, mCallback);
72948 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72949 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
72950 && !InitIds(cx, atomsCache)) ||
72951 !JS_GetPropertyById(cx, callback, atomsCache->readonlyByte_id, &rval)) {
72952 aRv.Throw(NS_ERROR_UNEXPECTED);
72953 return int8_t(0);
72954 }
72955 int8_t rvalDecl;
72956 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyByte", &rvalDecl)) {
72957 aRv.Throw(NS_ERROR_UNEXPECTED);
72958 return int8_t(0);
72959 }
72960 return rvalDecl;
72961}
72962
72963int8_t
72964TestJSImplInterfaceJSImpl::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm)
72965{
72966 CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72967 if (aRv.Failed()) {
72968 return int8_t(0);
72969 }
72970 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72970); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72970; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72971 BindingCallContext& cx = s.GetCallContext();
72972
72973 JS::Rooted<JS::Value> rval(cx);
72974
72975 JS::Rooted<JSObject *> callback(cx, mCallback);
72976 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
72977 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
72978 && !InitIds(cx, atomsCache)) ||
72979 !JS_GetPropertyById(cx, callback, atomsCache->writableByte_id, &rval)) {
72980 aRv.Throw(NS_ERROR_UNEXPECTED);
72981 return int8_t(0);
72982 }
72983 int8_t rvalDecl;
72984 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableByte", &rvalDecl)) {
72985 aRv.Throw(NS_ERROR_UNEXPECTED);
72986 return int8_t(0);
72987 }
72988 return rvalDecl;
72989}
72990
72991int8_t
72992TestJSImplInterfaceJSImpl::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm)
72993{
72994 CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
72995 if (aRv.Failed()) {
72996 return int8_t(0);
72997 }
72998 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 72998); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 72998; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
72999 BindingCallContext& cx = s.GetCallContext();
73000
73001 JS::Rooted<JS::Value> rval(cx);
73002
73003 JS::Rooted<JSObject *> callback(cx, mCallback);
73004 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73005 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73006 && !InitIds(cx, atomsCache)) ||
73007 !JS_GetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, &rval)) {
73008 aRv.Throw(NS_ERROR_UNEXPECTED);
73009 return int8_t(0);
73010 }
73011 int8_t rvalDecl;
73012 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.sideEffectFreeByte", &rvalDecl)) {
73013 aRv.Throw(NS_ERROR_UNEXPECTED);
73014 return int8_t(0);
73015 }
73016 return rvalDecl;
73017}
73018
73019int8_t
73020TestJSImplInterfaceJSImpl::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
73021{
73022 CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73023 if (aRv.Failed()) {
73024 return int8_t(0);
73025 }
73026 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73026); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73026; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73027 BindingCallContext& cx = s.GetCallContext();
73028
73029 JS::Rooted<JS::Value> rval(cx);
73030
73031 JS::Rooted<JSObject *> callback(cx, mCallback);
73032 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73033 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73034 && !InitIds(cx, atomsCache)) ||
73035 !JS_GetPropertyById(cx, callback, atomsCache->domDependentByte_id, &rval)) {
73036 aRv.Throw(NS_ERROR_UNEXPECTED);
73037 return int8_t(0);
73038 }
73039 int8_t rvalDecl;
73040 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.domDependentByte", &rvalDecl)) {
73041 aRv.Throw(NS_ERROR_UNEXPECTED);
73042 return int8_t(0);
73043 }
73044 return rvalDecl;
73045}
73046
73047int8_t
73048TestJSImplInterfaceJSImpl::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
73049{
73050 CallSetup s(this, aRv, "TestJSImplInterface.constantByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73051 if (aRv.Failed()) {
73052 return int8_t(0);
73053 }
73054 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73054); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73054; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73055 BindingCallContext& cx = s.GetCallContext();
73056
73057 JS::Rooted<JS::Value> rval(cx);
73058
73059 JS::Rooted<JSObject *> callback(cx, mCallback);
73060 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73061 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73062 && !InitIds(cx, atomsCache)) ||
73063 !JS_GetPropertyById(cx, callback, atomsCache->constantByte_id, &rval)) {
73064 aRv.Throw(NS_ERROR_UNEXPECTED);
73065 return int8_t(0);
73066 }
73067 int8_t rvalDecl;
73068 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.constantByte", &rvalDecl)) {
73069 aRv.Throw(NS_ERROR_UNEXPECTED);
73070 return int8_t(0);
73071 }
73072 return rvalDecl;
73073}
73074
73075int8_t
73076TestJSImplInterfaceJSImpl::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
73077{
73078 CallSetup s(this, aRv, "TestJSImplInterface.deviceStateDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73079 if (aRv.Failed()) {
73080 return int8_t(0);
73081 }
73082 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73082; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73083 BindingCallContext& cx = s.GetCallContext();
73084
73085 JS::Rooted<JS::Value> rval(cx);
73086
73087 JS::Rooted<JSObject *> callback(cx, mCallback);
73088 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73089 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73090 && !InitIds(cx, atomsCache)) ||
73091 !JS_GetPropertyById(cx, callback, atomsCache->deviceStateDependentByte_id, &rval)) {
73092 aRv.Throw(NS_ERROR_UNEXPECTED);
73093 return int8_t(0);
73094 }
73095 int8_t rvalDecl;
73096 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deviceStateDependentByte", &rvalDecl)) {
73097 aRv.Throw(NS_ERROR_UNEXPECTED);
73098 return int8_t(0);
73099 }
73100 return rvalDecl;
73101}
73102
73103int16_t
73104TestJSImplInterfaceJSImpl::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm)
73105{
73106 CallSetup s(this, aRv, "TestJSImplInterface.readonlyShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73107 if (aRv.Failed()) {
73108 return int16_t(0);
73109 }
73110 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73111 BindingCallContext& cx = s.GetCallContext();
73112
73113 JS::Rooted<JS::Value> rval(cx);
73114
73115 JS::Rooted<JSObject *> callback(cx, mCallback);
73116 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73117 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73118 && !InitIds(cx, atomsCache)) ||
73119 !JS_GetPropertyById(cx, callback, atomsCache->readonlyShort_id, &rval)) {
73120 aRv.Throw(NS_ERROR_UNEXPECTED);
73121 return int16_t(0);
73122 }
73123 int16_t rvalDecl;
73124 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyShort", &rvalDecl)) {
73125 aRv.Throw(NS_ERROR_UNEXPECTED);
73126 return int16_t(0);
73127 }
73128 return rvalDecl;
73129}
73130
73131int16_t
73132TestJSImplInterfaceJSImpl::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm)
73133{
73134 CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73135 if (aRv.Failed()) {
73136 return int16_t(0);
73137 }
73138 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73138); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73138; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73139 BindingCallContext& cx = s.GetCallContext();
73140
73141 JS::Rooted<JS::Value> rval(cx);
73142
73143 JS::Rooted<JSObject *> callback(cx, mCallback);
73144 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73145 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73146 && !InitIds(cx, atomsCache)) ||
73147 !JS_GetPropertyById(cx, callback, atomsCache->writableShort_id, &rval)) {
73148 aRv.Throw(NS_ERROR_UNEXPECTED);
73149 return int16_t(0);
73150 }
73151 int16_t rvalDecl;
73152 if (!ValueToPrimitive<int16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableShort", &rvalDecl)) {
73153 aRv.Throw(NS_ERROR_UNEXPECTED);
73154 return int16_t(0);
73155 }
73156 return rvalDecl;
73157}
73158
73159int32_t
73160TestJSImplInterfaceJSImpl::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm)
73161{
73162 CallSetup s(this, aRv, "TestJSImplInterface.readonlyLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73163 if (aRv.Failed()) {
73164 return int32_t(0);
73165 }
73166 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73166); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73166; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73167 BindingCallContext& cx = s.GetCallContext();
73168
73169 JS::Rooted<JS::Value> rval(cx);
73170
73171 JS::Rooted<JSObject *> callback(cx, mCallback);
73172 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73173 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73174 && !InitIds(cx, atomsCache)) ||
73175 !JS_GetPropertyById(cx, callback, atomsCache->readonlyLong_id, &rval)) {
73176 aRv.Throw(NS_ERROR_UNEXPECTED);
73177 return int32_t(0);
73178 }
73179 int32_t rvalDecl;
73180 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLong", &rvalDecl)) {
73181 aRv.Throw(NS_ERROR_UNEXPECTED);
73182 return int32_t(0);
73183 }
73184 return rvalDecl;
73185}
73186
73187int32_t
73188TestJSImplInterfaceJSImpl::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm)
73189{
73190 CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73191 if (aRv.Failed()) {
73192 return int32_t(0);
73193 }
73194 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73194); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73194; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73195 BindingCallContext& cx = s.GetCallContext();
73196
73197 JS::Rooted<JS::Value> rval(cx);
73198
73199 JS::Rooted<JSObject *> callback(cx, mCallback);
73200 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73201 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73202 && !InitIds(cx, atomsCache)) ||
73203 !JS_GetPropertyById(cx, callback, atomsCache->writableLong_id, &rval)) {
73204 aRv.Throw(NS_ERROR_UNEXPECTED);
73205 return int32_t(0);
73206 }
73207 int32_t rvalDecl;
73208 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLong", &rvalDecl)) {
73209 aRv.Throw(NS_ERROR_UNEXPECTED);
73210 return int32_t(0);
73211 }
73212 return rvalDecl;
73213}
73214
73215int64_t
73216TestJSImplInterfaceJSImpl::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73217{
73218 CallSetup s(this, aRv, "TestJSImplInterface.readonlyLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73219 if (aRv.Failed()) {
73220 return int64_t(0);
73221 }
73222 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73222); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73222; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73223 BindingCallContext& cx = s.GetCallContext();
73224
73225 JS::Rooted<JS::Value> rval(cx);
73226
73227 JS::Rooted<JSObject *> callback(cx, mCallback);
73228 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73229 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73230 && !InitIds(cx, atomsCache)) ||
73231 !JS_GetPropertyById(cx, callback, atomsCache->readonlyLongLong_id, &rval)) {
73232 aRv.Throw(NS_ERROR_UNEXPECTED);
73233 return int64_t(0);
73234 }
73235 int64_t rvalDecl;
73236 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyLongLong", &rvalDecl)) {
73237 aRv.Throw(NS_ERROR_UNEXPECTED);
73238 return int64_t(0);
73239 }
73240 return rvalDecl;
73241}
73242
73243int64_t
73244TestJSImplInterfaceJSImpl::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73245{
73246 CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73247 if (aRv.Failed()) {
73248 return int64_t(0);
73249 }
73250 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73250); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73250; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73251 BindingCallContext& cx = s.GetCallContext();
73252
73253 JS::Rooted<JS::Value> rval(cx);
73254
73255 JS::Rooted<JSObject *> callback(cx, mCallback);
73256 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73257 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73258 && !InitIds(cx, atomsCache)) ||
73259 !JS_GetPropertyById(cx, callback, atomsCache->writableLongLong_id, &rval)) {
73260 aRv.Throw(NS_ERROR_UNEXPECTED);
73261 return int64_t(0);
73262 }
73263 int64_t rvalDecl;
73264 if (!ValueToPrimitive<int64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableLongLong", &rvalDecl)) {
73265 aRv.Throw(NS_ERROR_UNEXPECTED);
73266 return int64_t(0);
73267 }
73268 return rvalDecl;
73269}
73270
73271uint8_t
73272TestJSImplInterfaceJSImpl::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm)
73273{
73274 CallSetup s(this, aRv, "TestJSImplInterface.readonlyOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73275 if (aRv.Failed()) {
73276 return uint8_t(0);
73277 }
73278 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73278); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73278; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73279 BindingCallContext& cx = s.GetCallContext();
73280
73281 JS::Rooted<JS::Value> rval(cx);
73282
73283 JS::Rooted<JSObject *> callback(cx, mCallback);
73284 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73285 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73286 && !InitIds(cx, atomsCache)) ||
73287 !JS_GetPropertyById(cx, callback, atomsCache->readonlyOctet_id, &rval)) {
73288 aRv.Throw(NS_ERROR_UNEXPECTED);
73289 return uint8_t(0);
73290 }
73291 uint8_t rvalDecl;
73292 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyOctet", &rvalDecl)) {
73293 aRv.Throw(NS_ERROR_UNEXPECTED);
73294 return uint8_t(0);
73295 }
73296 return rvalDecl;
73297}
73298
73299uint8_t
73300TestJSImplInterfaceJSImpl::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm)
73301{
73302 CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73303 if (aRv.Failed()) {
73304 return uint8_t(0);
73305 }
73306 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73306); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73306; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73307 BindingCallContext& cx = s.GetCallContext();
73308
73309 JS::Rooted<JS::Value> rval(cx);
73310
73311 JS::Rooted<JSObject *> callback(cx, mCallback);
73312 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73313 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73314 && !InitIds(cx, atomsCache)) ||
73315 !JS_GetPropertyById(cx, callback, atomsCache->writableOctet_id, &rval)) {
73316 aRv.Throw(NS_ERROR_UNEXPECTED);
73317 return uint8_t(0);
73318 }
73319 uint8_t rvalDecl;
73320 if (!ValueToPrimitive<uint8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableOctet", &rvalDecl)) {
73321 aRv.Throw(NS_ERROR_UNEXPECTED);
73322 return uint8_t(0);
73323 }
73324 return rvalDecl;
73325}
73326
73327uint16_t
73328TestJSImplInterfaceJSImpl::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
73329{
73330 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73331 if (aRv.Failed()) {
73332 return uint16_t(0);
73333 }
73334 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73334); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73334; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73335 BindingCallContext& cx = s.GetCallContext();
73336
73337 JS::Rooted<JS::Value> rval(cx);
73338
73339 JS::Rooted<JSObject *> callback(cx, mCallback);
73340 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73341 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73342 && !InitIds(cx, atomsCache)) ||
73343 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedShort_id, &rval)) {
73344 aRv.Throw(NS_ERROR_UNEXPECTED);
73345 return uint16_t(0);
73346 }
73347 uint16_t rvalDecl;
73348 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedShort", &rvalDecl)) {
73349 aRv.Throw(NS_ERROR_UNEXPECTED);
73350 return uint16_t(0);
73351 }
73352 return rvalDecl;
73353}
73354
73355uint16_t
73356TestJSImplInterfaceJSImpl::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
73357{
73358 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73359 if (aRv.Failed()) {
73360 return uint16_t(0);
73361 }
73362 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73362); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73362; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73363 BindingCallContext& cx = s.GetCallContext();
73364
73365 JS::Rooted<JS::Value> rval(cx);
73366
73367 JS::Rooted<JSObject *> callback(cx, mCallback);
73368 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73369 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73370 && !InitIds(cx, atomsCache)) ||
73371 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, &rval)) {
73372 aRv.Throw(NS_ERROR_UNEXPECTED);
73373 return uint16_t(0);
73374 }
73375 uint16_t rvalDecl;
73376 if (!ValueToPrimitive<uint16_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedShort", &rvalDecl)) {
73377 aRv.Throw(NS_ERROR_UNEXPECTED);
73378 return uint16_t(0);
73379 }
73380 return rvalDecl;
73381}
73382
73383uint32_t
73384TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
73385{
73386 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73387 if (aRv.Failed()) {
73388 return uint32_t(0);
73389 }
73390 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73390); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73390; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73391 BindingCallContext& cx = s.GetCallContext();
73392
73393 JS::Rooted<JS::Value> rval(cx);
73394
73395 JS::Rooted<JSObject *> callback(cx, mCallback);
73396 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73397 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73398 && !InitIds(cx, atomsCache)) ||
73399 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLong_id, &rval)) {
73400 aRv.Throw(NS_ERROR_UNEXPECTED);
73401 return uint32_t(0);
73402 }
73403 uint32_t rvalDecl;
73404 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLong", &rvalDecl)) {
73405 aRv.Throw(NS_ERROR_UNEXPECTED);
73406 return uint32_t(0);
73407 }
73408 return rvalDecl;
73409}
73410
73411uint32_t
73412TestJSImplInterfaceJSImpl::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
73413{
73414 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73415 if (aRv.Failed()) {
73416 return uint32_t(0);
73417 }
73418 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73418; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73419 BindingCallContext& cx = s.GetCallContext();
73420
73421 JS::Rooted<JS::Value> rval(cx);
73422
73423 JS::Rooted<JSObject *> callback(cx, mCallback);
73424 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73425 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73426 && !InitIds(cx, atomsCache)) ||
73427 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, &rval)) {
73428 aRv.Throw(NS_ERROR_UNEXPECTED);
73429 return uint32_t(0);
73430 }
73431 uint32_t rvalDecl;
73432 if (!ValueToPrimitive<uint32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLong", &rvalDecl)) {
73433 aRv.Throw(NS_ERROR_UNEXPECTED);
73434 return uint32_t(0);
73435 }
73436 return rvalDecl;
73437}
73438
73439uint64_t
73440TestJSImplInterfaceJSImpl::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73441{
73442 CallSetup s(this, aRv, "TestJSImplInterface.readonlyUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73443 if (aRv.Failed()) {
73444 return uint64_t(0);
73445 }
73446 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73446); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73446; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73447 BindingCallContext& cx = s.GetCallContext();
73448
73449 JS::Rooted<JS::Value> rval(cx);
73450
73451 JS::Rooted<JSObject *> callback(cx, mCallback);
73452 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73453 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73454 && !InitIds(cx, atomsCache)) ||
73455 !JS_GetPropertyById(cx, callback, atomsCache->readonlyUnsignedLongLong_id, &rval)) {
73456 aRv.Throw(NS_ERROR_UNEXPECTED);
73457 return uint64_t(0);
73458 }
73459 uint64_t rvalDecl;
73460 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.readonlyUnsignedLongLong", &rvalDecl)) {
73461 aRv.Throw(NS_ERROR_UNEXPECTED);
73462 return uint64_t(0);
73463 }
73464 return rvalDecl;
73465}
73466
73467uint64_t
73468TestJSImplInterfaceJSImpl::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
73469{
73470 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73471 if (aRv.Failed()) {
73472 return uint64_t(0);
73473 }
73474 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73474); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73474; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73475 BindingCallContext& cx = s.GetCallContext();
73476
73477 JS::Rooted<JS::Value> rval(cx);
73478
73479 JS::Rooted<JSObject *> callback(cx, mCallback);
73480 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73481 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73482 && !InitIds(cx, atomsCache)) ||
73483 !JS_GetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, &rval)) {
73484 aRv.Throw(NS_ERROR_UNEXPECTED);
73485 return uint64_t(0);
73486 }
73487 uint64_t rvalDecl;
73488 if (!ValueToPrimitive<uint64_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnsignedLongLong", &rvalDecl)) {
73489 aRv.Throw(NS_ERROR_UNEXPECTED);
73490 return uint64_t(0);
73491 }
73492 return rvalDecl;
73493}
73494
73495float
73496TestJSImplInterfaceJSImpl::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm)
73497{
73498 CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73499 if (aRv.Failed()) {
73500 return float(0);
73501 }
73502 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73502); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73502; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73503 BindingCallContext& cx = s.GetCallContext();
73504
73505 JS::Rooted<JS::Value> rval(cx);
73506
73507 JS::Rooted<JSObject *> callback(cx, mCallback);
73508 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73509 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73510 && !InitIds(cx, atomsCache)) ||
73511 !JS_GetPropertyById(cx, callback, atomsCache->writableFloat_id, &rval)) {
73512 aRv.Throw(NS_ERROR_UNEXPECTED);
73513 return float(0);
73514 }
73515 float rvalDecl;
73516 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableFloat", &rvalDecl)) {
73517 aRv.Throw(NS_ERROR_UNEXPECTED);
73518 return float(0);
73519 } else if (!std::isfinite(rvalDecl)) {
73520 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableFloat");
73521 aRv.Throw(NS_ERROR_UNEXPECTED);
73522 return float(0);
73523 }
73524 return rvalDecl;
73525}
73526
73527float
73528TestJSImplInterfaceJSImpl::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm)
73529{
73530 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73531 if (aRv.Failed()) {
73532 return float(0);
73533 }
73534 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73534); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73534; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73535 BindingCallContext& cx = s.GetCallContext();
73536
73537 JS::Rooted<JS::Value> rval(cx);
73538
73539 JS::Rooted<JSObject *> callback(cx, mCallback);
73540 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73541 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73542 && !InitIds(cx, atomsCache)) ||
73543 !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, &rval)) {
73544 aRv.Throw(NS_ERROR_UNEXPECTED);
73545 return float(0);
73546 }
73547 float rvalDecl;
73548 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedFloat", &rvalDecl)) {
73549 aRv.Throw(NS_ERROR_UNEXPECTED);
73550 return float(0);
73551 }
73552 return rvalDecl;
73553}
73554
73555Nullable<float>
73556TestJSImplInterfaceJSImpl::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm)
73557{
73558 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73559 if (aRv.Failed()) {
73560 return Nullable<float>();
73561 }
73562 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73562); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73562; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73563 BindingCallContext& cx = s.GetCallContext();
73564
73565 JS::Rooted<JS::Value> rval(cx);
73566
73567 JS::Rooted<JSObject *> callback(cx, mCallback);
73568 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73569 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73570 && !InitIds(cx, atomsCache)) ||
73571 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, &rval)) {
73572 aRv.Throw(NS_ERROR_UNEXPECTED);
73573 return Nullable<float>();
73574 }
73575 Nullable<float> rvalDecl;
73576 if (rval.isNullOrUndefined()) {
73577 rvalDecl.SetNull();
73578 } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableFloat", &rvalDecl.SetValue())) {
73579 aRv.Throw(NS_ERROR_UNEXPECTED);
73580 return Nullable<float>();
73581 } else if (!std::isfinite(rvalDecl.Value())) {
73582 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableFloat");
73583 aRv.Throw(NS_ERROR_UNEXPECTED);
73584 return Nullable<float>();
73585 }
73586 return rvalDecl;
73587}
73588
73589Nullable<float>
73590TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm)
73591{
73592 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73593 if (aRv.Failed()) {
73594 return Nullable<float>();
73595 }
73596 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73596); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73596; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73597 BindingCallContext& cx = s.GetCallContext();
73598
73599 JS::Rooted<JS::Value> rval(cx);
73600
73601 JS::Rooted<JSObject *> callback(cx, mCallback);
73602 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73603 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73604 && !InitIds(cx, atomsCache)) ||
73605 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, &rval)) {
73606 aRv.Throw(NS_ERROR_UNEXPECTED);
73607 return Nullable<float>();
73608 }
73609 Nullable<float> rvalDecl;
73610 if (rval.isNullOrUndefined()) {
73611 rvalDecl.SetNull();
73612 } else if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedFloat", &rvalDecl.SetValue())) {
73613 aRv.Throw(NS_ERROR_UNEXPECTED);
73614 return Nullable<float>();
73615 }
73616 return rvalDecl;
73617}
73618
73619double
73620TestJSImplInterfaceJSImpl::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm)
73621{
73622 CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73623 if (aRv.Failed()) {
73624 return double(0);
73625 }
73626 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73626); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73626; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73627 BindingCallContext& cx = s.GetCallContext();
73628
73629 JS::Rooted<JS::Value> rval(cx);
73630
73631 JS::Rooted<JSObject *> callback(cx, mCallback);
73632 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73633 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73634 && !InitIds(cx, atomsCache)) ||
73635 !JS_GetPropertyById(cx, callback, atomsCache->writableDouble_id, &rval)) {
73636 aRv.Throw(NS_ERROR_UNEXPECTED);
73637 return double(0);
73638 }
73639 double rvalDecl;
73640 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableDouble", &rvalDecl)) {
73641 aRv.Throw(NS_ERROR_UNEXPECTED);
73642 return double(0);
73643 } else if (!std::isfinite(rvalDecl)) {
73644 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableDouble");
73645 aRv.Throw(NS_ERROR_UNEXPECTED);
73646 return double(0);
73647 }
73648 return rvalDecl;
73649}
73650
73651double
73652TestJSImplInterfaceJSImpl::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm)
73653{
73654 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73655 if (aRv.Failed()) {
73656 return double(0);
73657 }
73658 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73658); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73658; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73659 BindingCallContext& cx = s.GetCallContext();
73660
73661 JS::Rooted<JS::Value> rval(cx);
73662
73663 JS::Rooted<JSObject *> callback(cx, mCallback);
73664 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73665 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73666 && !InitIds(cx, atomsCache)) ||
73667 !JS_GetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, &rval)) {
73668 aRv.Throw(NS_ERROR_UNEXPECTED);
73669 return double(0);
73670 }
73671 double rvalDecl;
73672 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableUnrestrictedDouble", &rvalDecl)) {
73673 aRv.Throw(NS_ERROR_UNEXPECTED);
73674 return double(0);
73675 }
73676 return rvalDecl;
73677}
73678
73679Nullable<double>
73680TestJSImplInterfaceJSImpl::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm)
73681{
73682 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73683 if (aRv.Failed()) {
73684 return Nullable<double>();
73685 }
73686 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73686); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73686; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73687 BindingCallContext& cx = s.GetCallContext();
73688
73689 JS::Rooted<JS::Value> rval(cx);
73690
73691 JS::Rooted<JSObject *> callback(cx, mCallback);
73692 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73693 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73694 && !InitIds(cx, atomsCache)) ||
73695 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, &rval)) {
73696 aRv.Throw(NS_ERROR_UNEXPECTED);
73697 return Nullable<double>();
73698 }
73699 Nullable<double> rvalDecl;
73700 if (rval.isNullOrUndefined()) {
73701 rvalDecl.SetNull();
73702 } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableDouble", &rvalDecl.SetValue())) {
73703 aRv.Throw(NS_ERROR_UNEXPECTED);
73704 return Nullable<double>();
73705 } else if (!std::isfinite(rvalDecl.Value())) {
73706 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.writableNullableDouble");
73707 aRv.Throw(NS_ERROR_UNEXPECTED);
73708 return Nullable<double>();
73709 }
73710 return rvalDecl;
73711}
73712
73713Nullable<double>
73714TestJSImplInterfaceJSImpl::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm)
73715{
73716 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73717 if (aRv.Failed()) {
73718 return Nullable<double>();
73719 }
73720 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73720); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73720; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73721 BindingCallContext& cx = s.GetCallContext();
73722
73723 JS::Rooted<JS::Value> rval(cx);
73724
73725 JS::Rooted<JSObject *> callback(cx, mCallback);
73726 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73727 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73728 && !InitIds(cx, atomsCache)) ||
73729 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, &rval)) {
73730 aRv.Throw(NS_ERROR_UNEXPECTED);
73731 return Nullable<double>();
73732 }
73733 Nullable<double> rvalDecl;
73734 if (rval.isNullOrUndefined()) {
73735 rvalDecl.SetNull();
73736 } else if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.writableNullableUnrestrictedDouble", &rvalDecl.SetValue())) {
73737 aRv.Throw(NS_ERROR_UNEXPECTED);
73738 return Nullable<double>();
73739 }
73740 return rvalDecl;
73741}
73742
73743float
73744TestJSImplInterfaceJSImpl::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm)
73745{
73746 CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73747 if (aRv.Failed()) {
73748 return float(0);
73749 }
73750 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73750); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73750; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73751 BindingCallContext& cx = s.GetCallContext();
73752
73753 JS::Rooted<JS::Value> rval(cx);
73754
73755 JS::Rooted<JSObject *> callback(cx, mCallback);
73756 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73757 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73758 && !InitIds(cx, atomsCache)) ||
73759 !JS_GetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, &rval)) {
73760 aRv.Throw(NS_ERROR_UNEXPECTED);
73761 return float(0);
73762 }
73763 float rvalDecl;
73764 if (!ValueToPrimitive<float, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientFloatAttr", &rvalDecl)) {
73765 aRv.Throw(NS_ERROR_UNEXPECTED);
73766 return float(0);
73767 } else if (!std::isfinite(rvalDecl)) {
73768 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientFloatAttr");
73769 aRv.Throw(NS_ERROR_UNEXPECTED);
73770 return float(0);
73771 }
73772 return rvalDecl;
73773}
73774
73775double
73776TestJSImplInterfaceJSImpl::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm)
73777{
73778 CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73779 if (aRv.Failed()) {
73780 return double(0);
73781 }
73782 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73782); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73782; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73783 BindingCallContext& cx = s.GetCallContext();
73784
73785 JS::Rooted<JS::Value> rval(cx);
73786
73787 JS::Rooted<JSObject *> callback(cx, mCallback);
73788 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73789 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73790 && !InitIds(cx, atomsCache)) ||
73791 !JS_GetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, &rval)) {
73792 aRv.Throw(NS_ERROR_UNEXPECTED);
73793 return double(0);
73794 }
73795 double rvalDecl;
73796 if (!ValueToPrimitive<double, eDefault>(cx, rval, "Return value of TestJSImplInterface.lenientDoubleAttr", &rvalDecl)) {
73797 aRv.Throw(NS_ERROR_UNEXPECTED);
73798 return double(0);
73799 } else if (!std::isfinite(rvalDecl)) {
73800 cx.ThrowErrorMessage<MSG_NOT_FINITE>("Return value of TestJSImplInterface.lenientDoubleAttr");
73801 aRv.Throw(NS_ERROR_UNEXPECTED);
73802 return double(0);
73803 }
73804 return rvalDecl;
73805}
73806
73807already_AddRefed<TestJSImplInterface>
73808TestJSImplInterfaceJSImpl::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm)
73809{
73810 CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73811 if (aRv.Failed()) {
73812 return nullptr;
73813 }
73814 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73814); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73814; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73815 BindingCallContext& cx = s.GetCallContext();
73816
73817 JS::Rooted<JS::Value> rval(cx);
73818
73819 JS::Rooted<JSObject *> callback(cx, mCallback);
73820 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73821 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73822 && !InitIds(cx, atomsCache)) ||
73823 !JS_GetPropertyById(cx, callback, atomsCache->nonNullSelf_id, &rval)) {
73824 aRv.Throw(NS_ERROR_UNEXPECTED);
73825 return nullptr;
73826 }
73827 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
73828 if (rval.isObject()) {
73829 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
73830 {
73831 // Our JSContext should be in the right global to do unwrapping in.
73832 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
73833 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
73834 // Be careful to not wrap random DOM objects here, even if
73835 // they're wrapped in opaque security wrappers for some reason.
73836 // XXXbz Wish we could check for a JS-implemented object
73837 // that already has a content reflection...
73838 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
73839 nsCOMPtr<nsIGlobalObject> contentGlobal;
73840 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
73841 if (!callback ||
73842 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
73843 aRv.Throw(NS_ERROR_UNEXPECTED);
73844 return nullptr;
73845 }
73846 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
73847 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 73848); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 73848; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
73848 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 73848); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 73848; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
73849 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
73850 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
73851 } else {
73852 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullSelf", "TestJSImplInterface");
73853 aRv.Throw(NS_ERROR_UNEXPECTED);
73854 return nullptr;
73855 }
73856 }
73857 }
73858 } else {
73859 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullSelf");
73860 aRv.Throw(NS_ERROR_UNEXPECTED);
73861 return nullptr;
73862 }
73863 return rvalDecl.forget();
73864}
73865
73866already_AddRefed<TestJSImplInterface>
73867TestJSImplInterfaceJSImpl::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
73868{
73869 CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73870 if (aRv.Failed()) {
73871 return nullptr;
73872 }
73873 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73873); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73873; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73874 BindingCallContext& cx = s.GetCallContext();
73875
73876 JS::Rooted<JS::Value> rval(cx);
73877
73878 JS::Rooted<JSObject *> callback(cx, mCallback);
73879 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73880 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73881 && !InitIds(cx, atomsCache)) ||
73882 !JS_GetPropertyById(cx, callback, atomsCache->nullableSelf_id, &rval)) {
73883 aRv.Throw(NS_ERROR_UNEXPECTED);
73884 return nullptr;
73885 }
73886 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
73887 if (rval.isObject()) {
73888 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
73889 {
73890 // Our JSContext should be in the right global to do unwrapping in.
73891 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
73892 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
73893 // Be careful to not wrap random DOM objects here, even if
73894 // they're wrapped in opaque security wrappers for some reason.
73895 // XXXbz Wish we could check for a JS-implemented object
73896 // that already has a content reflection...
73897 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
73898 nsCOMPtr<nsIGlobalObject> contentGlobal;
73899 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
73900 if (!callback ||
73901 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
73902 aRv.Throw(NS_ERROR_UNEXPECTED);
73903 return nullptr;
73904 }
73905 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
73906 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 73907); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 73907; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
73907 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 73907); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 73907; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
73908 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
73909 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
73910 } else {
73911 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableSelf", "TestJSImplInterface");
73912 aRv.Throw(NS_ERROR_UNEXPECTED);
73913 return nullptr;
73914 }
73915 }
73916 }
73917 } else if (rval.isNullOrUndefined()) {
73918 rvalDecl = nullptr;
73919 } else {
73920 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableSelf");
73921 aRv.Throw(NS_ERROR_UNEXPECTED);
73922 return nullptr;
73923 }
73924 return rvalDecl.forget();
73925}
73926
73927already_AddRefed<TestExternalInterface>
73928TestJSImplInterfaceJSImpl::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm)
73929{
73930 CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73931 if (aRv.Failed()) {
73932 return nullptr;
73933 }
73934 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73934); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73934; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73935 BindingCallContext& cx = s.GetCallContext();
73936
73937 JS::Rooted<JS::Value> rval(cx);
73938
73939 JS::Rooted<JSObject *> callback(cx, mCallback);
73940 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73941 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73942 && !InitIds(cx, atomsCache)) ||
73943 !JS_GetPropertyById(cx, callback, atomsCache->nonNullExternal_id, &rval)) {
73944 aRv.Throw(NS_ERROR_UNEXPECTED);
73945 return nullptr;
73946 }
73947 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
73948 if (rval.isObject()) {
73949 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
73950 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
73951 JS::Rooted<JSObject*> source(cx, &rval.toObject());
73952 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
73953 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nonNullExternal", "TestExternalInterface");
73954 aRv.Throw(NS_ERROR_UNEXPECTED);
73955 return nullptr;
73956 }
73957 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 73957); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 73957; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
73958 rvalDecl = rvalHolder;
73959 } else {
73960 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullExternal");
73961 aRv.Throw(NS_ERROR_UNEXPECTED);
73962 return nullptr;
73963 }
73964 return rvalDecl.forget();
73965}
73966
73967already_AddRefed<TestExternalInterface>
73968TestJSImplInterfaceJSImpl::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
73969{
73970 CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
73971 if (aRv.Failed()) {
73972 return nullptr;
73973 }
73974 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 73974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 73974; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
73975 BindingCallContext& cx = s.GetCallContext();
73976
73977 JS::Rooted<JS::Value> rval(cx);
73978
73979 JS::Rooted<JSObject *> callback(cx, mCallback);
73980 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
73981 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
73982 && !InitIds(cx, atomsCache)) ||
73983 !JS_GetPropertyById(cx, callback, atomsCache->nullableExternal_id, &rval)) {
73984 aRv.Throw(NS_ERROR_UNEXPECTED);
73985 return nullptr;
73986 }
73987 RefPtr<mozilla::dom::TestExternalInterface> rvalDecl;
73988 if (rval.isObject()) {
73989 static_assert(IsRefcounted<mozilla::dom::TestExternalInterface>::value, "We can only store refcounted classes.");
73990 RefPtr<mozilla::dom::TestExternalInterface> rvalHolder;
73991 JS::Rooted<JSObject*> source(cx, &rval.toObject());
73992 if (NS_FAILED(UnwrapArg<mozilla::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder)))((bool)(__builtin_expect(!!(NS_FAILED_impl(UnwrapArg<mozilla
::dom::TestExternalInterface>(cx, source, getter_AddRefs(rvalHolder
)))), 0)))
) {
73993 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.nullableExternal", "TestExternalInterface");
73994 aRv.Throw(NS_ERROR_UNEXPECTED);
73995 return nullptr;
73996 }
73997 MOZ_ASSERT(rvalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(rvalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(rvalHolder))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("rvalHolder", "../TestJSImplGenBinding.cpp"
, 73997); AnnotateMozCrashReason("MOZ_ASSERT" "(" "rvalHolder"
")"); do { *((volatile int*)__null) = 73997; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
73998 rvalDecl = rvalHolder;
73999 } else if (rval.isNullOrUndefined()) {
74000 rvalDecl = nullptr;
74001 } else {
74002 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableExternal");
74003 aRv.Throw(NS_ERROR_UNEXPECTED);
74004 return nullptr;
74005 }
74006 return rvalDecl.forget();
74007}
74008
74009already_AddRefed<TestCallbackInterface>
74010TestJSImplInterfaceJSImpl::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
74011{
74012 CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74013 if (aRv.Failed()) {
74014 return nullptr;
74015 }
74016 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74016); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74016; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74017 BindingCallContext& cx = s.GetCallContext();
74018
74019 JS::Rooted<JS::Value> rval(cx);
74020
74021 JS::Rooted<JSObject *> callback(cx, mCallback);
74022 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74023 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74024 && !InitIds(cx, atomsCache)) ||
74025 !JS_GetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, &rval)) {
74026 aRv.Throw(NS_ERROR_UNEXPECTED);
74027 return nullptr;
74028 }
74029 RefPtr<TestCallbackInterface> rvalDecl;
74030 if (rval.isObject()) {
74031 { // scope for tempRoot and tempGlobalRoot if needed
74032 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
74033 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
74034 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
74035 }
74036 } else {
74037 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nonNullCallbackInterface");
74038 aRv.Throw(NS_ERROR_UNEXPECTED);
74039 return nullptr;
74040 }
74041 return rvalDecl.forget();
74042}
74043
74044already_AddRefed<TestCallbackInterface>
74045TestJSImplInterfaceJSImpl::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
74046{
74047 CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74048 if (aRv.Failed()) {
74049 return nullptr;
74050 }
74051 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74051); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74051; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74052 BindingCallContext& cx = s.GetCallContext();
74053
74054 JS::Rooted<JS::Value> rval(cx);
74055
74056 JS::Rooted<JSObject *> callback(cx, mCallback);
74057 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74058 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74059 && !InitIds(cx, atomsCache)) ||
74060 !JS_GetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, &rval)) {
74061 aRv.Throw(NS_ERROR_UNEXPECTED);
74062 return nullptr;
74063 }
74064 RefPtr<TestCallbackInterface> rvalDecl;
74065 if (rval.isObject()) {
74066 { // scope for tempRoot and tempGlobalRoot if needed
74067 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
74068 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
74069 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
74070 }
74071 } else if (rval.isNullOrUndefined()) {
74072 rvalDecl = nullptr;
74073 } else {
74074 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.nullableCallbackInterface");
74075 aRv.Throw(NS_ERROR_UNEXPECTED);
74076 return nullptr;
74077 }
74078 return rvalDecl.forget();
74079}
74080
74081void
74082TestJSImplInterfaceJSImpl::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74083{
74084 CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74085 if (aRv.Failed()) {
74086 return;
74087 }
74088 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74088); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74088; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74089 BindingCallContext& cx = s.GetCallContext();
74090
74091 JS::Rooted<JS::Value> rval(cx);
74092
74093 JS::Rooted<JSObject *> callback(cx, mCallback);
74094 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74095 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74096 && !InitIds(cx, atomsCache)) ||
74097 !JS_GetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, &rval)) {
74098 aRv.Throw(NS_ERROR_UNEXPECTED);
74099 return;
74100 }
74101 RootedSpiderMonkeyInterface<Uint8Array> rvalDecl(cx);
74102 if (rval.isObject()) {
74103 if (!rvalDecl.Init(&rval.toObject())) {
74104 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.uint8ArrayAttr", "Uint8Array");
74105 aRv.Throw(NS_ERROR_UNEXPECTED);
74106 return;
74107 }
74108 if (JS::IsArrayBufferViewShared(rvalDecl.Obj())) {
74109 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_SHARED>("Return value of TestJSImplInterface.uint8ArrayAttr");
74110 aRv.Throw(NS_ERROR_UNEXPECTED);
74111 return;
74112 }
74113 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
74114 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.uint8ArrayAttr");
74115 aRv.Throw(NS_ERROR_UNEXPECTED);
74116 return;
74117 }
74118 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
74119 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.uint8ArrayAttr");
74120 aRv.Throw(NS_ERROR_UNEXPECTED);
74121 return;
74122 }
74123 } else {
74124 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.uint8ArrayAttr");
74125 aRv.Throw(NS_ERROR_UNEXPECTED);
74126 return;
74127 }
74128 aRetVal.set(rvalDecl.Obj());
74129}
74130
74131void
74132TestJSImplInterfaceJSImpl::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74133{
74134 CallSetup s(this, aRv, "TestJSImplInterface.readonlyJSStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74135 if (aRv.Failed()) {
74136 return;
74137 }
74138 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74138); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74138; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74139 BindingCallContext& cx = s.GetCallContext();
74140
74141 JS::Rooted<JS::Value> rval(cx);
74142
74143 JS::Rooted<JSObject *> callback(cx, mCallback);
74144 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74145 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74146 && !InitIds(cx, atomsCache)) ||
74147 !JS_GetPropertyById(cx, callback, atomsCache->readonlyJSStringAttr_id, &rval)) {
74148 aRv.Throw(NS_ERROR_UNEXPECTED);
74149 return;
74150 }
74151 JS::Rooted<JSString*> rvalDecl(cx);
74152 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
74153 aRv.Throw(NS_ERROR_UNEXPECTED);
74154 return;
74155 }
74156 aRetVal.set(rvalDecl);
74157}
74158
74159void
74160TestJSImplInterfaceJSImpl::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74161{
74162 CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74163 if (aRv.Failed()) {
74164 return;
74165 }
74166 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74166); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74166; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74167 BindingCallContext& cx = s.GetCallContext();
74168
74169 JS::Rooted<JS::Value> rval(cx);
74170
74171 JS::Rooted<JSObject *> callback(cx, mCallback);
74172 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74173 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74174 && !InitIds(cx, atomsCache)) ||
74175 !JS_GetPropertyById(cx, callback, atomsCache->jsStringAttr_id, &rval)) {
74176 aRv.Throw(NS_ERROR_UNEXPECTED);
74177 return;
74178 }
74179 JS::Rooted<JSString*> rvalDecl(cx);
74180 if (!(rvalDecl = ConvertJSValueToJSString(cx, rval))) {
74181 aRv.Throw(NS_ERROR_UNEXPECTED);
74182 return;
74183 }
74184 aRetVal.set(rvalDecl);
74185}
74186
74187MyTestEnum
74188TestJSImplInterfaceJSImpl::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74189{
74190 CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74191 if (aRv.Failed()) {
74192 return MyTestEnum(0);
74193 }
74194 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74194); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74194; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74195 BindingCallContext& cx = s.GetCallContext();
74196
74197 JS::Rooted<JS::Value> rval(cx);
74198
74199 JS::Rooted<JSObject *> callback(cx, mCallback);
74200 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74201 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74202 && !InitIds(cx, atomsCache)) ||
74203 !JS_GetPropertyById(cx, callback, atomsCache->enumAttribute_id, &rval)) {
74204 aRv.Throw(NS_ERROR_UNEXPECTED);
74205 return MyTestEnum(0);
74206 }
74207 MyTestEnum rvalDecl;
74208 {
74209 int index;
74210 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
74211 binding_detail::EnumStrings<MyTestEnum>::Values,
74212 "MyTestEnum", "return value of TestJSImplInterface.enumAttribute",
74213 &index)) {
74214 aRv.Throw(NS_ERROR_UNEXPECTED);
74215 return MyTestEnum(0);
74216 }
74217 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 74217); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 74217; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74218 rvalDecl = static_cast<MyTestEnum>(index);
74219 }
74220 return rvalDecl;
74221}
74222
74223MyTestEnum
74224TestJSImplInterfaceJSImpl::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74225{
74226 CallSetup s(this, aRv, "TestJSImplInterface.readonlyEnumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74227 if (aRv.Failed()) {
74228 return MyTestEnum(0);
74229 }
74230 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74230); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74230; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74231 BindingCallContext& cx = s.GetCallContext();
74232
74233 JS::Rooted<JS::Value> rval(cx);
74234
74235 JS::Rooted<JSObject *> callback(cx, mCallback);
74236 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74237 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74238 && !InitIds(cx, atomsCache)) ||
74239 !JS_GetPropertyById(cx, callback, atomsCache->readonlyEnumAttribute_id, &rval)) {
74240 aRv.Throw(NS_ERROR_UNEXPECTED);
74241 return MyTestEnum(0);
74242 }
74243 MyTestEnum rvalDecl;
74244 {
74245 int index;
74246 if (!binding_detail::FindEnumStringIndex<true>(cx, rval,
74247 binding_detail::EnumStrings<MyTestEnum>::Values,
74248 "MyTestEnum", "return value of TestJSImplInterface.readonlyEnumAttribute",
74249 &index)) {
74250 aRv.Throw(NS_ERROR_UNEXPECTED);
74251 return MyTestEnum(0);
74252 }
74253 MOZ_ASSERT(index >= 0)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(index >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(index >= 0))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("index >= 0",
"../TestJSImplGenBinding.cpp", 74253); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "index >= 0" ")"); do { *((volatile int*
)__null) = 74253; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74254 rvalDecl = static_cast<MyTestEnum>(index);
74255 }
74256 return rvalDecl;
74257}
74258
74259void
74260TestJSImplInterfaceJSImpl::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74261{
74262 CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74263 if (aRv.Failed()) {
74264 return;
74265 }
74266 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74266); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74266; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74267 BindingCallContext& cx = s.GetCallContext();
74268
74269 JS::Rooted<JS::Value> rval(cx);
74270
74271 JS::Rooted<JSObject *> callback(cx, mCallback);
74272 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74273 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74274 && !InitIds(cx, atomsCache)) ||
74275 !JS_GetPropertyById(cx, callback, atomsCache->writableUnion_id, &rval)) {
74276 aRv.Throw(NS_ERROR_UNEXPECTED);
74277 return;
74278 }
74279 OwningCanvasPatternOrCanvasGradient& rvalDecl(aRetVal);
74280 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnion", false)) {
74281 aRv.Throw(NS_ERROR_UNEXPECTED);
74282 return;
74283 }
74284}
74285
74286void
74287TestJSImplInterfaceJSImpl::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74288{
74289 CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74290 if (aRv.Failed()) {
74291 return;
74292 }
74293 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74293); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74293; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74294 BindingCallContext& cx = s.GetCallContext();
74295
74296 JS::Rooted<JS::Value> rval(cx);
74297
74298 JS::Rooted<JSObject *> callback(cx, mCallback);
74299 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74300 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74301 && !InitIds(cx, atomsCache)) ||
74302 !JS_GetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, &rval)) {
74303 aRv.Throw(NS_ERROR_UNEXPECTED);
74304 return;
74305 }
74306 OwningCanvasPatternOrNullOrCanvasGradient& rvalDecl(aRetVal);
74307 if (!rvalDecl.Init(cx, rval, "Return value of TestJSImplInterface.writableUnionContainingNull", false)) {
74308 aRv.Throw(NS_ERROR_UNEXPECTED);
74309 return;
74310 }
74311}
74312
74313void
74314TestJSImplInterfaceJSImpl::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
74315{
74316 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74317 if (aRv.Failed()) {
74318 return;
74319 }
74320 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74320); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74320; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74321 BindingCallContext& cx = s.GetCallContext();
74322
74323 JS::Rooted<JS::Value> rval(cx);
74324
74325 JS::Rooted<JSObject *> callback(cx, mCallback);
74326 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74327 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74328 && !InitIds(cx, atomsCache)) ||
74329 !JS_GetPropertyById(cx, callback, atomsCache->writableNullableUnion_id, &rval)) {
74330 aRv.Throw(NS_ERROR_UNEXPECTED);
74331 return;
74332 }
74333 Nullable<OwningCanvasPatternOrCanvasGradient >& rvalDecl(aRetVal);
74334 if (rval.isNullOrUndefined()) {
74335 rvalDecl.SetNull();
74336 } else {
74337 if (!rvalDecl.SetValue().Init(cx, rval, "Return value of TestJSImplInterface.writableNullableUnion", false)) {
74338 aRv.Throw(NS_ERROR_UNEXPECTED);
74339 return;
74340 }
74341 }
74342}
74343
74344int8_t
74345TestJSImplInterfaceJSImpl::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
74346{
74347 CallSetup s(this, aRv, "TestJSImplInterface.attributeGetterRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74348 if (aRv.Failed()) {
74349 return int8_t(0);
74350 }
74351 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74351); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74351; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74352 BindingCallContext& cx = s.GetCallContext();
74353
74354 JS::Rooted<JS::Value> rval(cx);
74355
74356 JS::Rooted<JSObject *> callback(cx, mCallback);
74357 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74358 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74359 && !InitIds(cx, atomsCache)) ||
74360 !JS_GetPropertyById(cx, callback, atomsCache->attributeGetterRenamedTo_id, &rval)) {
74361 aRv.Throw(NS_ERROR_UNEXPECTED);
74362 return int8_t(0);
74363 }
74364 int8_t rvalDecl;
74365 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeGetterRenamedFrom", &rvalDecl)) {
74366 aRv.Throw(NS_ERROR_UNEXPECTED);
74367 return int8_t(0);
74368 }
74369 return rvalDecl;
74370}
74371
74372int8_t
74373TestJSImplInterfaceJSImpl::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
74374{
74375 CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74376 if (aRv.Failed()) {
74377 return int8_t(0);
74378 }
74379 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74379); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74379; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74380 BindingCallContext& cx = s.GetCallContext();
74381
74382 JS::Rooted<JS::Value> rval(cx);
74383
74384 JS::Rooted<JSObject *> callback(cx, mCallback);
74385 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74386 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74387 && !InitIds(cx, atomsCache)) ||
74388 !JS_GetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, &rval)) {
74389 aRv.Throw(NS_ERROR_UNEXPECTED);
74390 return int8_t(0);
74391 }
74392 int8_t rvalDecl;
74393 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attributeRenamedFrom", &rvalDecl)) {
74394 aRv.Throw(NS_ERROR_UNEXPECTED);
74395 return int8_t(0);
74396 }
74397 return rvalDecl;
74398}
74399
74400int8_t
74401TestJSImplInterfaceJSImpl::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm)
74402{
74403 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74404 if (aRv.Failed()) {
74405 return int8_t(0);
74406 }
74407 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74407); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74407; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74408 BindingCallContext& cx = s.GetCallContext();
74409
74410 JS::Rooted<JS::Value> rval(cx);
74411
74412 JS::Rooted<JSObject *> callback(cx, mCallback);
74413 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74414 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74415 && !InitIds(cx, atomsCache)) ||
74416 !JS_GetPropertyById(cx, callback, atomsCache->enforcedByte_id, &rval)) {
74417 aRv.Throw(NS_ERROR_UNEXPECTED);
74418 return int8_t(0);
74419 }
74420 int8_t rvalDecl;
74421 if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, rval, "Return value of TestJSImplInterface.enforcedByte", &rvalDecl)) {
74422 aRv.Throw(NS_ERROR_UNEXPECTED);
74423 return int8_t(0);
74424 }
74425 return rvalDecl;
74426}
74427
74428Nullable<int8_t>
74429TestJSImplInterfaceJSImpl::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm)
74430{
74431 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74432 if (aRv.Failed()) {
6
Taking false branch
74433 return Nullable<int8_t>();
74434 }
74435 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74435); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74435; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
7
Assuming the condition is false
8
Taking false branch
9
Loop condition is false. Exiting loop
74436 BindingCallContext& cx = s.GetCallContext();
74437
74438 JS::Rooted<JS::Value> rval(cx);
74439
74440 JS::Rooted<JSObject *> callback(cx, mCallback);
74441 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74442 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
10
Assuming the condition is false
12
Taking false branch
74443 && !InitIds(cx, atomsCache)) ||
74444 !JS_GetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, &rval)) {
11
Assuming the condition is false
74445 aRv.Throw(NS_ERROR_UNEXPECTED);
74446 return Nullable<int8_t>();
74447 }
74448 Nullable<int8_t> rvalDecl;
74449 if (rval.isNullOrUndefined()) {
13
Taking false branch
74450 rvalDecl.SetNull();
74451 } else if (!ValueToPrimitive<int8_t, eEnforceRange>(cx, rval, "Return value of TestJSImplInterface.enforcedByteNullable", &rvalDecl.SetValue())) {
14
Calling 'ValueToPrimitive<signed char, mozilla::dom::eEnforceRange, mozilla::dom::BindingCallContext>'
74452 aRv.Throw(NS_ERROR_UNEXPECTED);
74453 return Nullable<int8_t>();
74454 }
74455 return rvalDecl;
74456}
74457
74458int8_t
74459TestJSImplInterfaceJSImpl::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm)
74460{
74461 CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74462 if (aRv.Failed()) {
74463 return int8_t(0);
74464 }
74465 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74465); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74465; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74466 BindingCallContext& cx = s.GetCallContext();
74467
74468 JS::Rooted<JS::Value> rval(cx);
74469
74470 JS::Rooted<JSObject *> callback(cx, mCallback);
74471 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74472 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74473 && !InitIds(cx, atomsCache)) ||
74474 !JS_GetPropertyById(cx, callback, atomsCache->clampedByte_id, &rval)) {
74475 aRv.Throw(NS_ERROR_UNEXPECTED);
74476 return int8_t(0);
74477 }
74478 int8_t rvalDecl;
74479 if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByte", &rvalDecl)) {
74480 aRv.Throw(NS_ERROR_UNEXPECTED);
74481 return int8_t(0);
74482 }
74483 return rvalDecl;
74484}
74485
74486Nullable<int8_t>
74487TestJSImplInterfaceJSImpl::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm)
74488{
74489 CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74490 if (aRv.Failed()) {
74491 return Nullable<int8_t>();
74492 }
74493 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74493; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74494 BindingCallContext& cx = s.GetCallContext();
74495
74496 JS::Rooted<JS::Value> rval(cx);
74497
74498 JS::Rooted<JSObject *> callback(cx, mCallback);
74499 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74500 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74501 && !InitIds(cx, atomsCache)) ||
74502 !JS_GetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, &rval)) {
74503 aRv.Throw(NS_ERROR_UNEXPECTED);
74504 return Nullable<int8_t>();
74505 }
74506 Nullable<int8_t> rvalDecl;
74507 if (rval.isNullOrUndefined()) {
74508 rvalDecl.SetNull();
74509 } else if (!ValueToPrimitive<int8_t, eClamp>(cx, rval, "Return value of TestJSImplInterface.clampedByteNullable", &rvalDecl.SetValue())) {
74510 aRv.Throw(NS_ERROR_UNEXPECTED);
74511 return Nullable<int8_t>();
74512 }
74513 return rvalDecl;
74514}
74515
74516int8_t
74517TestJSImplInterfaceJSImpl::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm)
74518{
74519 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74520 if (aRv.Failed()) {
74521 return int8_t(0);
74522 }
74523 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74523); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74523; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74524 BindingCallContext& cx = s.GetCallContext();
74525
74526 JS::Rooted<JS::Value> rval(cx);
74527
74528 JS::Rooted<JSObject *> callback(cx, mCallback);
74529 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74530 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74531 && !InitIds(cx, atomsCache)) ||
74532 !JS_GetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, &rval)) {
74533 aRv.Throw(NS_ERROR_UNEXPECTED);
74534 return int8_t(0);
74535 }
74536 int8_t rvalDecl;
74537 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.deprecatedAttribute", &rvalDecl)) {
74538 aRv.Throw(NS_ERROR_UNEXPECTED);
74539 return int8_t(0);
74540 }
74541 return rvalDecl;
74542}
74543
74544bool
74545TestJSImplInterfaceJSImpl::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm)
74546{
74547 CallSetup s(this, aRv, "TestJSImplInterface.prefable1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74548 if (aRv.Failed()) {
74549 return bool(0);
74550 }
74551 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74551); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74551; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74552 BindingCallContext& cx = s.GetCallContext();
74553
74554 JS::Rooted<JS::Value> rval(cx);
74555
74556 JS::Rooted<JSObject *> callback(cx, mCallback);
74557 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74558 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74559 && !InitIds(cx, atomsCache)) ||
74560 !JS_GetPropertyById(cx, callback, atomsCache->prefable1_id, &rval)) {
74561 aRv.Throw(NS_ERROR_UNEXPECTED);
74562 return bool(0);
74563 }
74564 bool rvalDecl;
74565 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable1", &rvalDecl)) {
74566 aRv.Throw(NS_ERROR_UNEXPECTED);
74567 return bool(0);
74568 }
74569 return rvalDecl;
74570}
74571
74572bool
74573TestJSImplInterfaceJSImpl::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm)
74574{
74575 CallSetup s(this, aRv, "TestJSImplInterface.prefable2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74576 if (aRv.Failed()) {
74577 return bool(0);
74578 }
74579 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74579); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74579; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74580 BindingCallContext& cx = s.GetCallContext();
74581
74582 JS::Rooted<JS::Value> rval(cx);
74583
74584 JS::Rooted<JSObject *> callback(cx, mCallback);
74585 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74586 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74587 && !InitIds(cx, atomsCache)) ||
74588 !JS_GetPropertyById(cx, callback, atomsCache->prefable2_id, &rval)) {
74589 aRv.Throw(NS_ERROR_UNEXPECTED);
74590 return bool(0);
74591 }
74592 bool rvalDecl;
74593 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable2", &rvalDecl)) {
74594 aRv.Throw(NS_ERROR_UNEXPECTED);
74595 return bool(0);
74596 }
74597 return rvalDecl;
74598}
74599
74600bool
74601TestJSImplInterfaceJSImpl::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm)
74602{
74603 CallSetup s(this, aRv, "TestJSImplInterface.prefable3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74604 if (aRv.Failed()) {
74605 return bool(0);
74606 }
74607 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74607; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74608 BindingCallContext& cx = s.GetCallContext();
74609
74610 JS::Rooted<JS::Value> rval(cx);
74611
74612 JS::Rooted<JSObject *> callback(cx, mCallback);
74613 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74614 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74615 && !InitIds(cx, atomsCache)) ||
74616 !JS_GetPropertyById(cx, callback, atomsCache->prefable3_id, &rval)) {
74617 aRv.Throw(NS_ERROR_UNEXPECTED);
74618 return bool(0);
74619 }
74620 bool rvalDecl;
74621 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable3", &rvalDecl)) {
74622 aRv.Throw(NS_ERROR_UNEXPECTED);
74623 return bool(0);
74624 }
74625 return rvalDecl;
74626}
74627
74628bool
74629TestJSImplInterfaceJSImpl::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm)
74630{
74631 CallSetup s(this, aRv, "TestJSImplInterface.prefable4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74632 if (aRv.Failed()) {
74633 return bool(0);
74634 }
74635 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74635); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74635; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74636 BindingCallContext& cx = s.GetCallContext();
74637
74638 JS::Rooted<JS::Value> rval(cx);
74639
74640 JS::Rooted<JSObject *> callback(cx, mCallback);
74641 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74642 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74643 && !InitIds(cx, atomsCache)) ||
74644 !JS_GetPropertyById(cx, callback, atomsCache->prefable4_id, &rval)) {
74645 aRv.Throw(NS_ERROR_UNEXPECTED);
74646 return bool(0);
74647 }
74648 bool rvalDecl;
74649 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable4", &rvalDecl)) {
74650 aRv.Throw(NS_ERROR_UNEXPECTED);
74651 return bool(0);
74652 }
74653 return rvalDecl;
74654}
74655
74656bool
74657TestJSImplInterfaceJSImpl::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm)
74658{
74659 CallSetup s(this, aRv, "TestJSImplInterface.prefable5", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74660 if (aRv.Failed()) {
74661 return bool(0);
74662 }
74663 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74663); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74663; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74664 BindingCallContext& cx = s.GetCallContext();
74665
74666 JS::Rooted<JS::Value> rval(cx);
74667
74668 JS::Rooted<JSObject *> callback(cx, mCallback);
74669 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74670 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74671 && !InitIds(cx, atomsCache)) ||
74672 !JS_GetPropertyById(cx, callback, atomsCache->prefable5_id, &rval)) {
74673 aRv.Throw(NS_ERROR_UNEXPECTED);
74674 return bool(0);
74675 }
74676 bool rvalDecl;
74677 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable5", &rvalDecl)) {
74678 aRv.Throw(NS_ERROR_UNEXPECTED);
74679 return bool(0);
74680 }
74681 return rvalDecl;
74682}
74683
74684bool
74685TestJSImplInterfaceJSImpl::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm)
74686{
74687 CallSetup s(this, aRv, "TestJSImplInterface.prefable6", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74688 if (aRv.Failed()) {
74689 return bool(0);
74690 }
74691 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74691); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74691; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74692 BindingCallContext& cx = s.GetCallContext();
74693
74694 JS::Rooted<JS::Value> rval(cx);
74695
74696 JS::Rooted<JSObject *> callback(cx, mCallback);
74697 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74698 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74699 && !InitIds(cx, atomsCache)) ||
74700 !JS_GetPropertyById(cx, callback, atomsCache->prefable6_id, &rval)) {
74701 aRv.Throw(NS_ERROR_UNEXPECTED);
74702 return bool(0);
74703 }
74704 bool rvalDecl;
74705 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable6", &rvalDecl)) {
74706 aRv.Throw(NS_ERROR_UNEXPECTED);
74707 return bool(0);
74708 }
74709 return rvalDecl;
74710}
74711
74712bool
74713TestJSImplInterfaceJSImpl::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm)
74714{
74715 CallSetup s(this, aRv, "TestJSImplInterface.prefable7", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74716 if (aRv.Failed()) {
74717 return bool(0);
74718 }
74719 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74719); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74719; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74720 BindingCallContext& cx = s.GetCallContext();
74721
74722 JS::Rooted<JS::Value> rval(cx);
74723
74724 JS::Rooted<JSObject *> callback(cx, mCallback);
74725 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74726 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74727 && !InitIds(cx, atomsCache)) ||
74728 !JS_GetPropertyById(cx, callback, atomsCache->prefable7_id, &rval)) {
74729 aRv.Throw(NS_ERROR_UNEXPECTED);
74730 return bool(0);
74731 }
74732 bool rvalDecl;
74733 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable7", &rvalDecl)) {
74734 aRv.Throw(NS_ERROR_UNEXPECTED);
74735 return bool(0);
74736 }
74737 return rvalDecl;
74738}
74739
74740bool
74741TestJSImplInterfaceJSImpl::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm)
74742{
74743 CallSetup s(this, aRv, "TestJSImplInterface.prefable8", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74744 if (aRv.Failed()) {
74745 return bool(0);
74746 }
74747 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74747); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74747; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74748 BindingCallContext& cx = s.GetCallContext();
74749
74750 JS::Rooted<JS::Value> rval(cx);
74751
74752 JS::Rooted<JSObject *> callback(cx, mCallback);
74753 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74754 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74755 && !InitIds(cx, atomsCache)) ||
74756 !JS_GetPropertyById(cx, callback, atomsCache->prefable8_id, &rval)) {
74757 aRv.Throw(NS_ERROR_UNEXPECTED);
74758 return bool(0);
74759 }
74760 bool rvalDecl;
74761 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable8", &rvalDecl)) {
74762 aRv.Throw(NS_ERROR_UNEXPECTED);
74763 return bool(0);
74764 }
74765 return rvalDecl;
74766}
74767
74768bool
74769TestJSImplInterfaceJSImpl::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm)
74770{
74771 CallSetup s(this, aRv, "TestJSImplInterface.prefable9", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74772 if (aRv.Failed()) {
74773 return bool(0);
74774 }
74775 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74775); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74775; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74776 BindingCallContext& cx = s.GetCallContext();
74777
74778 JS::Rooted<JS::Value> rval(cx);
74779
74780 JS::Rooted<JSObject *> callback(cx, mCallback);
74781 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74782 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74783 && !InitIds(cx, atomsCache)) ||
74784 !JS_GetPropertyById(cx, callback, atomsCache->prefable9_id, &rval)) {
74785 aRv.Throw(NS_ERROR_UNEXPECTED);
74786 return bool(0);
74787 }
74788 bool rvalDecl;
74789 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable9", &rvalDecl)) {
74790 aRv.Throw(NS_ERROR_UNEXPECTED);
74791 return bool(0);
74792 }
74793 return rvalDecl;
74794}
74795
74796bool
74797TestJSImplInterfaceJSImpl::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm)
74798{
74799 CallSetup s(this, aRv, "TestJSImplInterface.prefable12", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74800 if (aRv.Failed()) {
74801 return bool(0);
74802 }
74803 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74803); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74803; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74804 BindingCallContext& cx = s.GetCallContext();
74805
74806 JS::Rooted<JS::Value> rval(cx);
74807
74808 JS::Rooted<JSObject *> callback(cx, mCallback);
74809 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74810 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74811 && !InitIds(cx, atomsCache)) ||
74812 !JS_GetPropertyById(cx, callback, atomsCache->prefable12_id, &rval)) {
74813 aRv.Throw(NS_ERROR_UNEXPECTED);
74814 return bool(0);
74815 }
74816 bool rvalDecl;
74817 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable12", &rvalDecl)) {
74818 aRv.Throw(NS_ERROR_UNEXPECTED);
74819 return bool(0);
74820 }
74821 return rvalDecl;
74822}
74823
74824bool
74825TestJSImplInterfaceJSImpl::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm)
74826{
74827 CallSetup s(this, aRv, "TestJSImplInterface.prefable14", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74828 if (aRv.Failed()) {
74829 return bool(0);
74830 }
74831 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74831); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74831; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74832 BindingCallContext& cx = s.GetCallContext();
74833
74834 JS::Rooted<JS::Value> rval(cx);
74835
74836 JS::Rooted<JSObject *> callback(cx, mCallback);
74837 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74838 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74839 && !InitIds(cx, atomsCache)) ||
74840 !JS_GetPropertyById(cx, callback, atomsCache->prefable14_id, &rval)) {
74841 aRv.Throw(NS_ERROR_UNEXPECTED);
74842 return bool(0);
74843 }
74844 bool rvalDecl;
74845 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable14", &rvalDecl)) {
74846 aRv.Throw(NS_ERROR_UNEXPECTED);
74847 return bool(0);
74848 }
74849 return rvalDecl;
74850}
74851
74852bool
74853TestJSImplInterfaceJSImpl::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm)
74854{
74855 CallSetup s(this, aRv, "TestJSImplInterface.prefable15", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74856 if (aRv.Failed()) {
74857 return bool(0);
74858 }
74859 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74859); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74859; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74860 BindingCallContext& cx = s.GetCallContext();
74861
74862 JS::Rooted<JS::Value> rval(cx);
74863
74864 JS::Rooted<JSObject *> callback(cx, mCallback);
74865 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74866 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74867 && !InitIds(cx, atomsCache)) ||
74868 !JS_GetPropertyById(cx, callback, atomsCache->prefable15_id, &rval)) {
74869 aRv.Throw(NS_ERROR_UNEXPECTED);
74870 return bool(0);
74871 }
74872 bool rvalDecl;
74873 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable15", &rvalDecl)) {
74874 aRv.Throw(NS_ERROR_UNEXPECTED);
74875 return bool(0);
74876 }
74877 return rvalDecl;
74878}
74879
74880bool
74881TestJSImplInterfaceJSImpl::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm)
74882{
74883 CallSetup s(this, aRv, "TestJSImplInterface.prefable16", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74884 if (aRv.Failed()) {
74885 return bool(0);
74886 }
74887 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74887); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74887; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74888 BindingCallContext& cx = s.GetCallContext();
74889
74890 JS::Rooted<JS::Value> rval(cx);
74891
74892 JS::Rooted<JSObject *> callback(cx, mCallback);
74893 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74894 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74895 && !InitIds(cx, atomsCache)) ||
74896 !JS_GetPropertyById(cx, callback, atomsCache->prefable16_id, &rval)) {
74897 aRv.Throw(NS_ERROR_UNEXPECTED);
74898 return bool(0);
74899 }
74900 bool rvalDecl;
74901 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.prefable16", &rvalDecl)) {
74902 aRv.Throw(NS_ERROR_UNEXPECTED);
74903 return bool(0);
74904 }
74905 return rvalDecl;
74906}
74907
74908bool
74909TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm)
74910{
74911 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext1", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74912 if (aRv.Failed()) {
74913 return bool(0);
74914 }
74915 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74915); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74915; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74916 BindingCallContext& cx = s.GetCallContext();
74917
74918 JS::Rooted<JS::Value> rval(cx);
74919
74920 JS::Rooted<JSObject *> callback(cx, mCallback);
74921 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74922 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74923 && !InitIds(cx, atomsCache)) ||
74924 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext1_id, &rval)) {
74925 aRv.Throw(NS_ERROR_UNEXPECTED);
74926 return bool(0);
74927 }
74928 bool rvalDecl;
74929 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext1", &rvalDecl)) {
74930 aRv.Throw(NS_ERROR_UNEXPECTED);
74931 return bool(0);
74932 }
74933 return rvalDecl;
74934}
74935
74936bool
74937TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm)
74938{
74939 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74940 if (aRv.Failed()) {
74941 return bool(0);
74942 }
74943 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74943); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74943; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74944 BindingCallContext& cx = s.GetCallContext();
74945
74946 JS::Rooted<JS::Value> rval(cx);
74947
74948 JS::Rooted<JSObject *> callback(cx, mCallback);
74949 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74950 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74951 && !InitIds(cx, atomsCache)) ||
74952 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext2_id, &rval)) {
74953 aRv.Throw(NS_ERROR_UNEXPECTED);
74954 return bool(0);
74955 }
74956 bool rvalDecl;
74957 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext2", &rvalDecl)) {
74958 aRv.Throw(NS_ERROR_UNEXPECTED);
74959 return bool(0);
74960 }
74961 return rvalDecl;
74962}
74963
74964bool
74965TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm)
74966{
74967 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74968 if (aRv.Failed()) {
74969 return bool(0);
74970 }
74971 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74971); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74971; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
74972 BindingCallContext& cx = s.GetCallContext();
74973
74974 JS::Rooted<JS::Value> rval(cx);
74975
74976 JS::Rooted<JSObject *> callback(cx, mCallback);
74977 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
74978 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
74979 && !InitIds(cx, atomsCache)) ||
74980 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext3_id, &rval)) {
74981 aRv.Throw(NS_ERROR_UNEXPECTED);
74982 return bool(0);
74983 }
74984 bool rvalDecl;
74985 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext3", &rvalDecl)) {
74986 aRv.Throw(NS_ERROR_UNEXPECTED);
74987 return bool(0);
74988 }
74989 return rvalDecl;
74990}
74991
74992bool
74993TestJSImplInterfaceJSImpl::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm)
74994{
74995 CallSetup s(this, aRv, "TestJSImplInterface.conditionalOnSecureContext4", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
74996 if (aRv.Failed()) {
74997 return bool(0);
74998 }
74999 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 74999); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 74999; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75000 BindingCallContext& cx = s.GetCallContext();
75001
75002 JS::Rooted<JS::Value> rval(cx);
75003
75004 JS::Rooted<JSObject *> callback(cx, mCallback);
75005 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75006 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75007 && !InitIds(cx, atomsCache)) ||
75008 !JS_GetPropertyById(cx, callback, atomsCache->conditionalOnSecureContext4_id, &rval)) {
75009 aRv.Throw(NS_ERROR_UNEXPECTED);
75010 return bool(0);
75011 }
75012 bool rvalDecl;
75013 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.conditionalOnSecureContext4", &rvalDecl)) {
75014 aRv.Throw(NS_ERROR_UNEXPECTED);
75015 return bool(0);
75016 }
75017 return rvalDecl;
75018}
75019
75020int32_t
75021TestJSImplInterfaceJSImpl::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm)
75022{
75023 CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75024 if (aRv.Failed()) {
75025 return int32_t(0);
75026 }
75027 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75027); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75027; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75028 BindingCallContext& cx = s.GetCallContext();
75029
75030 JS::Rooted<JS::Value> rval(cx);
75031
75032 JS::Rooted<JSObject *> callback(cx, mCallback);
75033 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75034 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75035 && !InitIds(cx, atomsCache)) ||
75036 !JS_GetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, &rval)) {
75037 aRv.Throw(NS_ERROR_UNEXPECTED);
75038 return int32_t(0);
75039 }
75040 int32_t rvalDecl;
75041 if (!ValueToPrimitive<int32_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.attrWithLenientThis", &rvalDecl)) {
75042 aRv.Throw(NS_ERROR_UNEXPECTED);
75043 return int32_t(0);
75044 }
75045 return rvalDecl;
75046}
75047
75048already_AddRefed<TestJSImplInterface>
75049TestJSImplInterfaceJSImpl::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm)
75050{
75051 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75052 if (aRv.Failed()) {
75053 return nullptr;
75054 }
75055 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75055); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75055; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75056 BindingCallContext& cx = s.GetCallContext();
75057
75058 JS::Rooted<JS::Value> rval(cx);
75059
75060 JS::Rooted<JSObject *> callback(cx, mCallback);
75061 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75062 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75063 && !InitIds(cx, atomsCache)) ||
75064 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr_id, &rval)) {
75065 aRv.Throw(NS_ERROR_UNEXPECTED);
75066 return nullptr;
75067 }
75068 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75069 if (rval.isObject()) {
75070 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75071 {
75072 // Our JSContext should be in the right global to do unwrapping in.
75073 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75074 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75075 // Be careful to not wrap random DOM objects here, even if
75076 // they're wrapped in opaque security wrappers for some reason.
75077 // XXXbz Wish we could check for a JS-implemented object
75078 // that already has a content reflection...
75079 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75080 nsCOMPtr<nsIGlobalObject> contentGlobal;
75081 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75082 if (!callback ||
75083 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75084 aRv.Throw(NS_ERROR_UNEXPECTED);
75085 return nullptr;
75086 }
75087 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75088 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75089); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75089; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75089 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75089); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75089; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75090 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75091 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75092 } else {
75093 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr", "TestJSImplInterface");
75094 aRv.Throw(NS_ERROR_UNEXPECTED);
75095 return nullptr;
75096 }
75097 }
75098 }
75099 } else {
75100 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr");
75101 aRv.Throw(NS_ERROR_UNEXPECTED);
75102 return nullptr;
75103 }
75104 return rvalDecl.forget();
75105}
75106
75107already_AddRefed<TestJSImplInterface>
75108TestJSImplInterfaceJSImpl::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm)
75109{
75110 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75111 if (aRv.Failed()) {
75112 return nullptr;
75113 }
75114 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75114); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75114; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75115 BindingCallContext& cx = s.GetCallContext();
75116
75117 JS::Rooted<JS::Value> rval(cx);
75118
75119 JS::Rooted<JSObject *> callback(cx, mCallback);
75120 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75121 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75122 && !InitIds(cx, atomsCache)) ||
75123 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr2_id, &rval)) {
75124 aRv.Throw(NS_ERROR_UNEXPECTED);
75125 return nullptr;
75126 }
75127 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75128 if (rval.isObject()) {
75129 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75130 {
75131 // Our JSContext should be in the right global to do unwrapping in.
75132 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75133 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75134 // Be careful to not wrap random DOM objects here, even if
75135 // they're wrapped in opaque security wrappers for some reason.
75136 // XXXbz Wish we could check for a JS-implemented object
75137 // that already has a content reflection...
75138 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75139 nsCOMPtr<nsIGlobalObject> contentGlobal;
75140 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75141 if (!callback ||
75142 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75143 aRv.Throw(NS_ERROR_UNEXPECTED);
75144 return nullptr;
75145 }
75146 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75147 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75148); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75148; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75148 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75148); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75148; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75149 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75150 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75151 } else {
75152 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr2", "TestJSImplInterface");
75153 aRv.Throw(NS_ERROR_UNEXPECTED);
75154 return nullptr;
75155 }
75156 }
75157 }
75158 } else {
75159 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr2");
75160 aRv.Throw(NS_ERROR_UNEXPECTED);
75161 return nullptr;
75162 }
75163 return rvalDecl.forget();
75164}
75165
75166already_AddRefed<TestJSImplInterface>
75167TestJSImplInterfaceJSImpl::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm)
75168{
75169 CallSetup s(this, aRv, "TestJSImplInterface.putForwardsAttr3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75170 if (aRv.Failed()) {
75171 return nullptr;
75172 }
75173 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75173); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75173; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75174 BindingCallContext& cx = s.GetCallContext();
75175
75176 JS::Rooted<JS::Value> rval(cx);
75177
75178 JS::Rooted<JSObject *> callback(cx, mCallback);
75179 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75180 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75181 && !InitIds(cx, atomsCache)) ||
75182 !JS_GetPropertyById(cx, callback, atomsCache->putForwardsAttr3_id, &rval)) {
75183 aRv.Throw(NS_ERROR_UNEXPECTED);
75184 return nullptr;
75185 }
75186 RefPtr<mozilla::dom::TestJSImplInterface> rvalDecl;
75187 if (rval.isObject()) {
75188 static_assert(IsRefcounted<mozilla::dom::TestJSImplInterface>::value, "We can only store refcounted classes.");
75189 {
75190 // Our JSContext should be in the right global to do unwrapping in.
75191 nsresult rv = UnwrapObject<prototypes::id::TestJSImplInterface, mozilla::dom::TestJSImplInterface>(rval, rvalDecl, cx);
75192 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75193 // Be careful to not wrap random DOM objects here, even if
75194 // they're wrapped in opaque security wrappers for some reason.
75195 // XXXbz Wish we could check for a JS-implemented object
75196 // that already has a content reflection...
75197 if (!IsDOMObject(js::UncheckedUnwrap(&rval.toObject()))) {
75198 nsCOMPtr<nsIGlobalObject> contentGlobal;
75199 JS::Rooted<JSObject*> callback(cx, CallbackOrNull());
75200 if (!callback ||
75201 !GetContentGlobalForJSImplementedObject(cx, callback, getter_AddRefs(contentGlobal))) {
75202 aRv.Throw(NS_ERROR_UNEXPECTED);
75203 return nullptr;
75204 }
75205 JS::Rooted<JSObject*> jsImplSourceObj(cx, &rval.toObject());
75206 MOZ_RELEASE_ASSERT(!js::IsWrapper(jsImplSourceObj),do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75207); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75207; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
75207 "Don't return JS implementations from other compartments")do { static_assert( mozilla::detail::AssertionConditionType<
decltype(!js::IsWrapper(jsImplSourceObj))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!js::IsWrapper(jsImplSourceObj
)))), 0))) { do { } while (false); MOZ_ReportAssertionFailure
("!js::IsWrapper(jsImplSourceObj)" " (" "Don't return JS implementations from other compartments"
")", "../TestJSImplGenBinding.cpp", 75207); AnnotateMozCrashReason
("MOZ_RELEASE_ASSERT" "(" "!js::IsWrapper(jsImplSourceObj)" ") ("
"Don't return JS implementations from other compartments" ")"
); do { *((volatile int*)__null) = 75207; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
75208 JS::Rooted<JSObject*> jsImplSourceGlobal(cx, JS::GetNonCCWObjectGlobal(jsImplSourceObj));
75209 rvalDecl = new mozilla::dom::TestJSImplInterface(jsImplSourceObj, jsImplSourceGlobal, contentGlobal);
75210 } else {
75211 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.putForwardsAttr3", "TestJSImplInterface");
75212 aRv.Throw(NS_ERROR_UNEXPECTED);
75213 return nullptr;
75214 }
75215 }
75216 }
75217 } else {
75218 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.putForwardsAttr3");
75219 aRv.Throw(NS_ERROR_UNEXPECTED);
75220 return nullptr;
75221 }
75222 return rvalDecl.forget();
75223}
75224
75225bool
75226TestJSImplInterfaceJSImpl::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm)
75227{
75228 CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75229 if (aRv.Failed()) {
75230 return bool(0);
75231 }
75232 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75232); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75232; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75233 BindingCallContext& cx = s.GetCallContext();
75234
75235 JS::Rooted<JS::Value> rval(cx);
75236
75237 JS::Rooted<JSObject *> callback(cx, mCallback);
75238 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75239 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75240 && !InitIds(cx, atomsCache)) ||
75241 !JS_GetPropertyById(cx, callback, atomsCache->throwingAttr_id, &rval)) {
75242 aRv.Throw(NS_ERROR_UNEXPECTED);
75243 return bool(0);
75244 }
75245 bool rvalDecl;
75246 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingAttr", &rvalDecl)) {
75247 aRv.Throw(NS_ERROR_UNEXPECTED);
75248 return bool(0);
75249 }
75250 return rvalDecl;
75251}
75252
75253bool
75254TestJSImplInterfaceJSImpl::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75255{
75256 CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75257 if (aRv.Failed()) {
75258 return bool(0);
75259 }
75260 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75260); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75260; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75261 BindingCallContext& cx = s.GetCallContext();
75262
75263 JS::Rooted<JS::Value> rval(cx);
75264
75265 JS::Rooted<JSObject *> callback(cx, mCallback);
75266 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75267 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75268 && !InitIds(cx, atomsCache)) ||
75269 !JS_GetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, &rval)) {
75270 aRv.Throw(NS_ERROR_UNEXPECTED);
75271 return bool(0);
75272 }
75273 bool rvalDecl;
75274 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingGetterAttr", &rvalDecl)) {
75275 aRv.Throw(NS_ERROR_UNEXPECTED);
75276 return bool(0);
75277 }
75278 return rvalDecl;
75279}
75280
75281bool
75282TestJSImplInterfaceJSImpl::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75283{
75284 CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75285 if (aRv.Failed()) {
75286 return bool(0);
75287 }
75288 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75288); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75288; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75289 BindingCallContext& cx = s.GetCallContext();
75290
75291 JS::Rooted<JS::Value> rval(cx);
75292
75293 JS::Rooted<JSObject *> callback(cx, mCallback);
75294 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75295 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75296 && !InitIds(cx, atomsCache)) ||
75297 !JS_GetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, &rval)) {
75298 aRv.Throw(NS_ERROR_UNEXPECTED);
75299 return bool(0);
75300 }
75301 bool rvalDecl;
75302 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.throwingSetterAttr", &rvalDecl)) {
75303 aRv.Throw(NS_ERROR_UNEXPECTED);
75304 return bool(0);
75305 }
75306 return rvalDecl;
75307}
75308
75309bool
75310TestJSImplInterfaceJSImpl::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm)
75311{
75312 CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75313 if (aRv.Failed()) {
75314 return bool(0);
75315 }
75316 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75316); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75316; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75317 BindingCallContext& cx = s.GetCallContext();
75318
75319 JS::Rooted<JS::Value> rval(cx);
75320
75321 JS::Rooted<JSObject *> callback(cx, mCallback);
75322 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75323 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75324 && !InitIds(cx, atomsCache)) ||
75325 !JS_GetPropertyById(cx, callback, atomsCache->canOOMAttr_id, &rval)) {
75326 aRv.Throw(NS_ERROR_UNEXPECTED);
75327 return bool(0);
75328 }
75329 bool rvalDecl;
75330 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMAttr", &rvalDecl)) {
75331 aRv.Throw(NS_ERROR_UNEXPECTED);
75332 return bool(0);
75333 }
75334 return rvalDecl;
75335}
75336
75337bool
75338TestJSImplInterfaceJSImpl::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75339{
75340 CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75341 if (aRv.Failed()) {
75342 return bool(0);
75343 }
75344 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75344); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75344; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75345 BindingCallContext& cx = s.GetCallContext();
75346
75347 JS::Rooted<JS::Value> rval(cx);
75348
75349 JS::Rooted<JSObject *> callback(cx, mCallback);
75350 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75351 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75352 && !InitIds(cx, atomsCache)) ||
75353 !JS_GetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, &rval)) {
75354 aRv.Throw(NS_ERROR_UNEXPECTED);
75355 return bool(0);
75356 }
75357 bool rvalDecl;
75358 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMGetterAttr", &rvalDecl)) {
75359 aRv.Throw(NS_ERROR_UNEXPECTED);
75360 return bool(0);
75361 }
75362 return rvalDecl;
75363}
75364
75365bool
75366TestJSImplInterfaceJSImpl::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm)
75367{
75368 CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75369 if (aRv.Failed()) {
75370 return bool(0);
75371 }
75372 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75372); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75372; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75373 BindingCallContext& cx = s.GetCallContext();
75374
75375 JS::Rooted<JS::Value> rval(cx);
75376
75377 JS::Rooted<JSObject *> callback(cx, mCallback);
75378 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75379 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75380 && !InitIds(cx, atomsCache)) ||
75381 !JS_GetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, &rval)) {
75382 aRv.Throw(NS_ERROR_UNEXPECTED);
75383 return bool(0);
75384 }
75385 bool rvalDecl;
75386 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.canOOMSetterAttr", &rvalDecl)) {
75387 aRv.Throw(NS_ERROR_UNEXPECTED);
75388 return bool(0);
75389 }
75390 return rvalDecl;
75391}
75392
75393bool
75394TestJSImplInterfaceJSImpl::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm)
75395{
75396 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75397 if (aRv.Failed()) {
75398 return bool(0);
75399 }
75400 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75400); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75400; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75401 BindingCallContext& cx = s.GetCallContext();
75402
75403 JS::Rooted<JS::Value> rval(cx);
75404
75405 JS::Rooted<JSObject *> callback(cx, mCallback);
75406 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75407 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75408 && !InitIds(cx, atomsCache)) ||
75409 !JS_GetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, &rval)) {
75410 aRv.Throw(NS_ERROR_UNEXPECTED);
75411 return bool(0);
75412 }
75413 bool rvalDecl;
75414 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.ceReactionsAttr", &rvalDecl)) {
75415 aRv.Throw(NS_ERROR_UNEXPECTED);
75416 return bool(0);
75417 }
75418 return rvalDecl;
75419}
75420
75421void
75422TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75423{
75424 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75425 if (aRv.Failed()) {
75426 return;
75427 }
75428 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75428); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75428; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75429 BindingCallContext& cx = s.GetCallContext();
75430
75431 JS::Rooted<JS::Value> rval(cx);
75432
75433 JS::Rooted<JSObject *> callback(cx, mCallback);
75434 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75435 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75436 && !InitIds(cx, atomsCache)) ||
75437 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, &rval)) {
75438 aRv.Throw(NS_ERROR_UNEXPECTED);
75439 return;
75440 }
75441 JS::Rooted<JS::Value> rvalDecl(cx);
75442#ifdef __clang__1
75443#pragma clang diagnostic push
75444#pragma clang diagnostic ignored "-Wunreachable-code"
75445#pragma clang diagnostic ignored "-Wunreachable-code-return"
75446#endif // __clang__
75447 if ((false) && !CallerSubsumes(rval)) {
75448 cx.ThrowErrorMessage<MSG_PERMISSION_DENIED_TO_PASS_ARG>("return value of TestJSImplInterface.toJSONShouldSkipThis");
75449 aRv.Throw(NS_ERROR_UNEXPECTED);
75450 return;
75451 }
75452#ifdef __clang__1
75453#pragma clang diagnostic pop
75454#endif // __clang__
75455 rvalDecl = rval;
75456 aRetVal.set(rvalDecl);
75457}
75458
75459already_AddRefed<TestParentInterface>
75460TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm)
75461{
75462 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75463 if (aRv.Failed()) {
75464 return nullptr;
75465 }
75466 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75466); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75466; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75467 BindingCallContext& cx = s.GetCallContext();
75468
75469 JS::Rooted<JS::Value> rval(cx);
75470
75471 JS::Rooted<JSObject *> callback(cx, mCallback);
75472 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75473 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75474 && !InitIds(cx, atomsCache)) ||
75475 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, &rval)) {
75476 aRv.Throw(NS_ERROR_UNEXPECTED);
75477 return nullptr;
75478 }
75479 RefPtr<mozilla::dom::TestParentInterface> rvalDecl;
75480 if (rval.isObject()) {
75481 static_assert(IsRefcounted<mozilla::dom::TestParentInterface>::value, "We can only store refcounted classes.");
75482 {
75483 // Our JSContext should be in the right global to do unwrapping in.
75484 nsresult rv = UnwrapObject<prototypes::id::TestParentInterface, mozilla::dom::TestParentInterface>(rval, rvalDecl, cx);
75485 if (NS_FAILED(rv)((bool)(__builtin_expect(!!(NS_FAILED_impl(rv)), 0)))) {
75486 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.toJSONShouldSkipThis2", "TestParentInterface");
75487 aRv.Throw(NS_ERROR_UNEXPECTED);
75488 return nullptr;
75489 }
75490 }
75491 } else {
75492 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis2");
75493 aRv.Throw(NS_ERROR_UNEXPECTED);
75494 return nullptr;
75495 }
75496 return rvalDecl.forget();
75497}
75498
75499already_AddRefed<TestCallbackInterface>
75500TestJSImplInterfaceJSImpl::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm)
75501{
75502 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75503 if (aRv.Failed()) {
75504 return nullptr;
75505 }
75506 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75506); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75506; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75507 BindingCallContext& cx = s.GetCallContext();
75508
75509 JS::Rooted<JS::Value> rval(cx);
75510
75511 JS::Rooted<JSObject *> callback(cx, mCallback);
75512 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75513 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75514 && !InitIds(cx, atomsCache)) ||
75515 !JS_GetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, &rval)) {
75516 aRv.Throw(NS_ERROR_UNEXPECTED);
75517 return nullptr;
75518 }
75519 RefPtr<TestCallbackInterface> rvalDecl;
75520 if (rval.isObject()) {
75521 { // scope for tempRoot and tempGlobalRoot if needed
75522 JS::Rooted<JSObject*> tempRoot(cx, &rval.toObject());
75523 JS::Rooted<JSObject*> tempGlobalRoot(cx, JS::CurrentGlobalOrNull(cx));
75524 rvalDecl = new TestCallbackInterface(cx, tempRoot, tempGlobalRoot, GetIncumbentGlobal());
75525 }
75526 } else {
75527 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.toJSONShouldSkipThis3");
75528 aRv.Throw(NS_ERROR_UNEXPECTED);
75529 return nullptr;
75530 }
75531 return rvalDecl.forget();
75532}
75533
75534int8_t
75535TestJSImplInterfaceJSImpl::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm)
75536{
75537 CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75538 if (aRv.Failed()) {
75539 return int8_t(0);
75540 }
75541 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75541); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75541; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75542 BindingCallContext& cx = s.GetCallContext();
75543
75544 JS::Rooted<JS::Value> rval(cx);
75545
75546 JS::Rooted<JSObject *> callback(cx, mCallback);
75547 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75548 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75549 && !InitIds(cx, atomsCache)) ||
75550 !JS_GetPropertyById(cx, callback, atomsCache->dashed_attribute_id, &rval)) {
75551 aRv.Throw(NS_ERROR_UNEXPECTED);
75552 return int8_t(0);
75553 }
75554 int8_t rvalDecl;
75555 if (!ValueToPrimitive<int8_t, eDefault>(cx, rval, "Return value of TestJSImplInterface.dashed-attribute", &rvalDecl)) {
75556 aRv.Throw(NS_ERROR_UNEXPECTED);
75557 return int8_t(0);
75558 }
75559 return rvalDecl;
75560}
75561
75562bool
75563TestJSImplInterfaceJSImpl::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm)
75564{
75565 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75566 if (aRv.Failed()) {
75567 return bool(0);
75568 }
75569 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75569); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75569; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75570 BindingCallContext& cx = s.GetCallContext();
75571
75572 JS::Rooted<JS::Value> rval(cx);
75573
75574 JS::Rooted<JSObject *> callback(cx, mCallback);
75575 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75576 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75577 && !InitIds(cx, atomsCache)) ||
75578 !JS_GetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, &rval)) {
75579 aRv.Throw(NS_ERROR_UNEXPECTED);
75580 return bool(0);
75581 }
75582 bool rvalDecl;
75583 if (!ValueToPrimitive<bool, eDefault>(cx, rval, "Return value of TestJSImplInterface.nonEnumerableAttr", &rvalDecl)) {
75584 aRv.Throw(NS_ERROR_UNEXPECTED);
75585 return bool(0);
75586 }
75587 return rvalDecl;
75588}
75589
75590void
75591TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75592{
75593 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75594 if (aRv.Failed()) {
75595 return;
75596 }
75597 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75597); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75597; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75598 BindingCallContext& cx = s.GetCallContext();
75599
75600 JS::Rooted<JS::Value> rval(cx);
75601
75602 JS::Rooted<JSObject *> callback(cx, mCallback);
75603 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75604 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75605 && !InitIds(cx, atomsCache)) ||
75606 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, &rval)) {
75607 aRv.Throw(NS_ERROR_UNEXPECTED);
75608 return;
75609 }
75610 RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx);
75611 if (rval.isObject()) {
75612 if (!rvalDecl.Init(&rval.toObject())) {
75613 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef", "ArrayBufferView");
75614 aRv.Throw(NS_ERROR_UNEXPECTED);
75615 return;
75616 }
75617 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
75618 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75619 aRv.Throw(NS_ERROR_UNEXPECTED);
75620 return;
75621 }
75622 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
75623 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75624 aRv.Throw(NS_ERROR_UNEXPECTED);
75625 return;
75626 }
75627 } else {
75628 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferViewTypedef");
75629 aRv.Throw(NS_ERROR_UNEXPECTED);
75630 return;
75631 }
75632 aRetVal.set(rvalDecl.Obj());
75633}
75634
75635void
75636TestJSImplInterfaceJSImpl::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75637{
75638 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75639 if (aRv.Failed()) {
75640 return;
75641 }
75642 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75642); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75642; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75643 BindingCallContext& cx = s.GetCallContext();
75644
75645 JS::Rooted<JS::Value> rval(cx);
75646
75647 JS::Rooted<JSObject *> callback(cx, mCallback);
75648 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75649 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75650 && !InitIds(cx, atomsCache)) ||
75651 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, &rval)) {
75652 aRv.Throw(NS_ERROR_UNEXPECTED);
75653 return;
75654 }
75655 RootedSpiderMonkeyInterface<ArrayBufferView> rvalDecl(cx);
75656 if (rval.isObject()) {
75657 if (!rvalDecl.Init(&rval.toObject())) {
75658 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBufferView", "ArrayBufferView");
75659 aRv.Throw(NS_ERROR_UNEXPECTED);
75660 return;
75661 }
75662 if (JS::IsLargeArrayBufferView(rvalDecl.Obj())) {
75663 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75664 aRv.Throw(NS_ERROR_UNEXPECTED);
75665 return;
75666 }
75667 if (JS::IsResizableArrayBufferView(rvalDecl.Obj())) {
75668 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75669 aRv.Throw(NS_ERROR_UNEXPECTED);
75670 return;
75671 }
75672 } else {
75673 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBufferView");
75674 aRv.Throw(NS_ERROR_UNEXPECTED);
75675 return;
75676 }
75677 aRetVal.set(rvalDecl.Obj());
75678}
75679
75680void
75681TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75682{
75683 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75684 if (aRv.Failed()) {
75685 return;
75686 }
75687 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75687); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75687; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75688 BindingCallContext& cx = s.GetCallContext();
75689
75690 JS::Rooted<JS::Value> rval(cx);
75691
75692 JS::Rooted<JSObject *> callback(cx, mCallback);
75693 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75694 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75695 && !InitIds(cx, atomsCache)) ||
75696 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, &rval)) {
75697 aRv.Throw(NS_ERROR_UNEXPECTED);
75698 return;
75699 }
75700 RootedSpiderMonkeyInterface<Nullable<ArrayBufferView>> rvalDecl(cx);
75701 if (rval.isObject()) {
75702 if (!rvalDecl.SetValue().Init(&rval.toObject())) {
75703 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView", "ArrayBufferViewOrNull");
75704 aRv.Throw(NS_ERROR_UNEXPECTED);
75705 return;
75706 }
75707 if (JS::IsLargeArrayBufferView(rvalDecl.SetValue().Obj())) {
75708 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75709 aRv.Throw(NS_ERROR_UNEXPECTED);
75710 return;
75711 }
75712 if (JS::IsResizableArrayBufferView(rvalDecl.SetValue().Obj())) {
75713 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75714 aRv.Throw(NS_ERROR_UNEXPECTED);
75715 return;
75716 }
75717 } else if (rval.isNullOrUndefined()) {
75718 rvalDecl.SetNull();
75719 } else {
75720 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBufferView");
75721 aRv.Throw(NS_ERROR_UNEXPECTED);
75722 return;
75723 }
75724 aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj());
75725}
75726
75727void
75728TestJSImplInterfaceJSImpl::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75729{
75730 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75731 if (aRv.Failed()) {
75732 return;
75733 }
75734 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75734); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75734; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75735 BindingCallContext& cx = s.GetCallContext();
75736
75737 JS::Rooted<JS::Value> rval(cx);
75738
75739 JS::Rooted<JSObject *> callback(cx, mCallback);
75740 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75741 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75742 && !InitIds(cx, atomsCache)) ||
75743 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, &rval)) {
75744 aRv.Throw(NS_ERROR_UNEXPECTED);
75745 return;
75746 }
75747 RootedSpiderMonkeyInterface<ArrayBuffer> rvalDecl(cx);
75748 if (rval.isObject()) {
75749 if (!rvalDecl.Init(&rval.toObject())) {
75750 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedArrayBuffer", "ArrayBuffer");
75751 aRv.Throw(NS_ERROR_UNEXPECTED);
75752 return;
75753 }
75754 if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.Obj())) {
75755 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75756 aRv.Throw(NS_ERROR_UNEXPECTED);
75757 return;
75758 }
75759 if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.Obj())) {
75760 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75761 aRv.Throw(NS_ERROR_UNEXPECTED);
75762 return;
75763 }
75764 } else {
75765 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedArrayBuffer");
75766 aRv.Throw(NS_ERROR_UNEXPECTED);
75767 return;
75768 }
75769 aRetVal.set(rvalDecl.Obj());
75770}
75771
75772void
75773TestJSImplInterfaceJSImpl::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
75774{
75775 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75776 if (aRv.Failed()) {
75777 return;
75778 }
75779 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75779); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75779; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75780 BindingCallContext& cx = s.GetCallContext();
75781
75782 JS::Rooted<JS::Value> rval(cx);
75783
75784 JS::Rooted<JSObject *> callback(cx, mCallback);
75785 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75786 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid()
75787 && !InitIds(cx, atomsCache)) ||
75788 !JS_GetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBuffer_id, &rval)) {
75789 aRv.Throw(NS_ERROR_UNEXPECTED);
75790 return;
75791 }
75792 RootedSpiderMonkeyInterface<Nullable<ArrayBuffer>> rvalDecl(cx);
75793 if (rval.isObject()) {
75794 if (!rvalDecl.SetValue().Init(&rval.toObject())) {
75795 cx.ThrowErrorMessage<MSG_DOES_NOT_IMPLEMENT_INTERFACE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer", "ArrayBufferOrNull");
75796 aRv.Throw(NS_ERROR_UNEXPECTED);
75797 return;
75798 }
75799 if (JS::IsLargeArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) {
75800 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_LARGE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
75801 aRv.Throw(NS_ERROR_UNEXPECTED);
75802 return;
75803 }
75804 if (JS::IsResizableArrayBufferMaybeShared(rvalDecl.SetValue().Obj())) {
75805 cx.ThrowErrorMessage<MSG_TYPEDARRAY_IS_RESIZABLE>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
75806 aRv.Throw(NS_ERROR_UNEXPECTED);
75807 return;
75808 }
75809 } else if (rval.isNullOrUndefined()) {
75810 rvalDecl.SetNull();
75811 } else {
75812 cx.ThrowErrorMessage<MSG_NOT_OBJECT>("Return value of TestJSImplInterface.allowSharedNullableArrayBuffer");
75813 aRv.Throw(NS_ERROR_UNEXPECTED);
75814 return;
75815 }
75816 aRetVal.set(rvalDecl.IsNull() ? nullptr : rvalDecl.Value().Obj());
75817}
75818
75819void
75820TestJSImplInterfaceJSImpl::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75821{
75822 CallSetup s(this, aRv, "TestJSImplInterface.writableByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75823 if (aRv.Failed()) {
75824 return;
75825 }
75826 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75826); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75826; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75827 BindingCallContext& cx = s.GetCallContext();
75828
75829 JS::RootedVector<JS::Value> argv(cx);
75830 if (!argv.resize(1)) {
75831 // That threw an exception on the JSContext, and our CallSetup will do
75832 // the right thing with that.
75833 return;
75834 }
75835 do {
75836 argv[0].setInt32(int32_t(arg));
75837 break;
75838 } while (false);
75839
75840 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 75840); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 75840; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75841 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
75842 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75843 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
75844 !InitIds(cx, atomsCache)) ||
75845 !JS_SetPropertyById(cx, callback, atomsCache->writableByte_id, argv[0])) {
75846 aRv.Throw(NS_ERROR_UNEXPECTED);
75847 return;
75848 }
75849}
75850
75851void
75852TestJSImplInterfaceJSImpl::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75853{
75854 CallSetup s(this, aRv, "TestJSImplInterface.sideEffectFreeByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75855 if (aRv.Failed()) {
75856 return;
75857 }
75858 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75858); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75858; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75859 BindingCallContext& cx = s.GetCallContext();
75860
75861 JS::RootedVector<JS::Value> argv(cx);
75862 if (!argv.resize(1)) {
75863 // That threw an exception on the JSContext, and our CallSetup will do
75864 // the right thing with that.
75865 return;
75866 }
75867 do {
75868 argv[0].setInt32(int32_t(arg));
75869 break;
75870 } while (false);
75871
75872 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 75872); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 75872; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75873 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
75874 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75875 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
75876 !InitIds(cx, atomsCache)) ||
75877 !JS_SetPropertyById(cx, callback, atomsCache->sideEffectFreeByte_id, argv[0])) {
75878 aRv.Throw(NS_ERROR_UNEXPECTED);
75879 return;
75880 }
75881}
75882
75883void
75884TestJSImplInterfaceJSImpl::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75885{
75886 CallSetup s(this, aRv, "TestJSImplInterface.domDependentByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75887 if (aRv.Failed()) {
75888 return;
75889 }
75890 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75890); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75890; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75891 BindingCallContext& cx = s.GetCallContext();
75892
75893 JS::RootedVector<JS::Value> argv(cx);
75894 if (!argv.resize(1)) {
75895 // That threw an exception on the JSContext, and our CallSetup will do
75896 // the right thing with that.
75897 return;
75898 }
75899 do {
75900 argv[0].setInt32(int32_t(arg));
75901 break;
75902 } while (false);
75903
75904 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 75904); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 75904; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75905 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
75906 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75907 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
75908 !InitIds(cx, atomsCache)) ||
75909 !JS_SetPropertyById(cx, callback, atomsCache->domDependentByte_id, argv[0])) {
75910 aRv.Throw(NS_ERROR_UNEXPECTED);
75911 return;
75912 }
75913}
75914
75915void
75916TestJSImplInterfaceJSImpl::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75917{
75918 CallSetup s(this, aRv, "TestJSImplInterface.writableShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75919 if (aRv.Failed()) {
75920 return;
75921 }
75922 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75922); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75922; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75923 BindingCallContext& cx = s.GetCallContext();
75924
75925 JS::RootedVector<JS::Value> argv(cx);
75926 if (!argv.resize(1)) {
75927 // That threw an exception on the JSContext, and our CallSetup will do
75928 // the right thing with that.
75929 return;
75930 }
75931 do {
75932 argv[0].setInt32(int32_t(arg));
75933 break;
75934 } while (false);
75935
75936 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 75936); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 75936; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75937 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
75938 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75939 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
75940 !InitIds(cx, atomsCache)) ||
75941 !JS_SetPropertyById(cx, callback, atomsCache->writableShort_id, argv[0])) {
75942 aRv.Throw(NS_ERROR_UNEXPECTED);
75943 return;
75944 }
75945}
75946
75947void
75948TestJSImplInterfaceJSImpl::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75949{
75950 CallSetup s(this, aRv, "TestJSImplInterface.writableLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75951 if (aRv.Failed()) {
75952 return;
75953 }
75954 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75954); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75954; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75955 BindingCallContext& cx = s.GetCallContext();
75956
75957 JS::RootedVector<JS::Value> argv(cx);
75958 if (!argv.resize(1)) {
75959 // That threw an exception on the JSContext, and our CallSetup will do
75960 // the right thing with that.
75961 return;
75962 }
75963 do {
75964 argv[0].setInt32(int32_t(arg));
75965 break;
75966 } while (false);
75967
75968 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 75968); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 75968; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75969 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
75970 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
75971 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
75972 !InitIds(cx, atomsCache)) ||
75973 !JS_SetPropertyById(cx, callback, atomsCache->writableLong_id, argv[0])) {
75974 aRv.Throw(NS_ERROR_UNEXPECTED);
75975 return;
75976 }
75977}
75978
75979void
75980TestJSImplInterfaceJSImpl::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
75981{
75982 CallSetup s(this, aRv, "TestJSImplInterface.writableLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
75983 if (aRv.Failed()) {
75984 return;
75985 }
75986 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 75986); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 75986; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
75987 BindingCallContext& cx = s.GetCallContext();
75988
75989 JS::RootedVector<JS::Value> argv(cx);
75990 if (!argv.resize(1)) {
75991 // That threw an exception on the JSContext, and our CallSetup will do
75992 // the right thing with that.
75993 return;
75994 }
75995 do {
75996 argv[0].set(JS_NumberValue(double(arg)));
75997 break;
75998 } while (false);
75999
76000 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76000); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76000; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76001 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76002 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76003 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76004 !InitIds(cx, atomsCache)) ||
76005 !JS_SetPropertyById(cx, callback, atomsCache->writableLongLong_id, argv[0])) {
76006 aRv.Throw(NS_ERROR_UNEXPECTED);
76007 return;
76008 }
76009}
76010
76011void
76012TestJSImplInterfaceJSImpl::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76013{
76014 CallSetup s(this, aRv, "TestJSImplInterface.writableOctet", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76015 if (aRv.Failed()) {
76016 return;
76017 }
76018 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76018); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76018; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76019 BindingCallContext& cx = s.GetCallContext();
76020
76021 JS::RootedVector<JS::Value> argv(cx);
76022 if (!argv.resize(1)) {
76023 // That threw an exception on the JSContext, and our CallSetup will do
76024 // the right thing with that.
76025 return;
76026 }
76027 do {
76028 argv[0].setInt32(int32_t(arg));
76029 break;
76030 } while (false);
76031
76032 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76032); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76032; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76033 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76034 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76035 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76036 !InitIds(cx, atomsCache)) ||
76037 !JS_SetPropertyById(cx, callback, atomsCache->writableOctet_id, argv[0])) {
76038 aRv.Throw(NS_ERROR_UNEXPECTED);
76039 return;
76040 }
76041}
76042
76043void
76044TestJSImplInterfaceJSImpl::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76045{
76046 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedShort", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76047 if (aRv.Failed()) {
76048 return;
76049 }
76050 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76050); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76050; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76051 BindingCallContext& cx = s.GetCallContext();
76052
76053 JS::RootedVector<JS::Value> argv(cx);
76054 if (!argv.resize(1)) {
76055 // That threw an exception on the JSContext, and our CallSetup will do
76056 // the right thing with that.
76057 return;
76058 }
76059 do {
76060 argv[0].setInt32(int32_t(arg));
76061 break;
76062 } while (false);
76063
76064 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76064); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76064; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76065 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76066 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76067 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76068 !InitIds(cx, atomsCache)) ||
76069 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedShort_id, argv[0])) {
76070 aRv.Throw(NS_ERROR_UNEXPECTED);
76071 return;
76072 }
76073}
76074
76075void
76076TestJSImplInterfaceJSImpl::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76077{
76078 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76079 if (aRv.Failed()) {
76080 return;
76081 }
76082 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76082); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76082; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76083 BindingCallContext& cx = s.GetCallContext();
76084
76085 JS::RootedVector<JS::Value> argv(cx);
76086 if (!argv.resize(1)) {
76087 // That threw an exception on the JSContext, and our CallSetup will do
76088 // the right thing with that.
76089 return;
76090 }
76091 do {
76092 argv[0].setNumber(arg);
76093 break;
76094 } while (false);
76095
76096 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76096); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76096; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76097 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76098 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76099 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76100 !InitIds(cx, atomsCache)) ||
76101 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLong_id, argv[0])) {
76102 aRv.Throw(NS_ERROR_UNEXPECTED);
76103 return;
76104 }
76105}
76106
76107void
76108TestJSImplInterfaceJSImpl::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76109{
76110 CallSetup s(this, aRv, "TestJSImplInterface.writableUnsignedLongLong", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76111 if (aRv.Failed()) {
76112 return;
76113 }
76114 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76114); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76114; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76115 BindingCallContext& cx = s.GetCallContext();
76116
76117 JS::RootedVector<JS::Value> argv(cx);
76118 if (!argv.resize(1)) {
76119 // That threw an exception on the JSContext, and our CallSetup will do
76120 // the right thing with that.
76121 return;
76122 }
76123 do {
76124 argv[0].set(JS_NumberValue(double(arg)));
76125 break;
76126 } while (false);
76127
76128 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76128; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76129 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76130 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76131 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76132 !InitIds(cx, atomsCache)) ||
76133 !JS_SetPropertyById(cx, callback, atomsCache->writableUnsignedLongLong_id, argv[0])) {
76134 aRv.Throw(NS_ERROR_UNEXPECTED);
76135 return;
76136 }
76137}
76138
76139void
76140TestJSImplInterfaceJSImpl::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76141{
76142 CallSetup s(this, aRv, "TestJSImplInterface.writableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76143 if (aRv.Failed()) {
76144 return;
76145 }
76146 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76146); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76146; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76147 BindingCallContext& cx = s.GetCallContext();
76148
76149 JS::RootedVector<JS::Value> argv(cx);
76150 if (!argv.resize(1)) {
76151 // That threw an exception on the JSContext, and our CallSetup will do
76152 // the right thing with that.
76153 return;
76154 }
76155 do {
76156 argv[0].set(JS_NumberValue(double(arg)));
76157 break;
76158 } while (false);
76159
76160 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76160; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76161 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76162 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76163 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76164 !InitIds(cx, atomsCache)) ||
76165 !JS_SetPropertyById(cx, callback, atomsCache->writableFloat_id, argv[0])) {
76166 aRv.Throw(NS_ERROR_UNEXPECTED);
76167 return;
76168 }
76169}
76170
76171void
76172TestJSImplInterfaceJSImpl::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76173{
76174 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76175 if (aRv.Failed()) {
76176 return;
76177 }
76178 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76178); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76178; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76179 BindingCallContext& cx = s.GetCallContext();
76180
76181 JS::RootedVector<JS::Value> argv(cx);
76182 if (!argv.resize(1)) {
76183 // That threw an exception on the JSContext, and our CallSetup will do
76184 // the right thing with that.
76185 return;
76186 }
76187 do {
76188 argv[0].set(JS_NumberValue(double(arg)));
76189 break;
76190 } while (false);
76191
76192 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76192); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76192; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76193 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76194 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76195 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76196 !InitIds(cx, atomsCache)) ||
76197 !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedFloat_id, argv[0])) {
76198 aRv.Throw(NS_ERROR_UNEXPECTED);
76199 return;
76200 }
76201}
76202
76203void
76204TestJSImplInterfaceJSImpl::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76205{
76206 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76207 if (aRv.Failed()) {
76208 return;
76209 }
76210 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76210); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76210; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76211 BindingCallContext& cx = s.GetCallContext();
76212
76213 JS::RootedVector<JS::Value> argv(cx);
76214 if (!argv.resize(1)) {
76215 // That threw an exception on the JSContext, and our CallSetup will do
76216 // the right thing with that.
76217 return;
76218 }
76219 do {
76220 if (arg.IsNull()) {
76221 argv[0].setNull();
76222 break;
76223 }
76224 argv[0].set(JS_NumberValue(double(arg.Value())));
76225 break;
76226 } while (false);
76227
76228 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76228); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76228; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76229 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76230 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76231 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76232 !InitIds(cx, atomsCache)) ||
76233 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableFloat_id, argv[0])) {
76234 aRv.Throw(NS_ERROR_UNEXPECTED);
76235 return;
76236 }
76237}
76238
76239void
76240TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76241{
76242 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedFloat", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76243 if (aRv.Failed()) {
76244 return;
76245 }
76246 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76246); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76246; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76247 BindingCallContext& cx = s.GetCallContext();
76248
76249 JS::RootedVector<JS::Value> argv(cx);
76250 if (!argv.resize(1)) {
76251 // That threw an exception on the JSContext, and our CallSetup will do
76252 // the right thing with that.
76253 return;
76254 }
76255 do {
76256 if (arg.IsNull()) {
76257 argv[0].setNull();
76258 break;
76259 }
76260 argv[0].set(JS_NumberValue(double(arg.Value())));
76261 break;
76262 } while (false);
76263
76264 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76264); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76264; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76265 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76266 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76267 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76268 !InitIds(cx, atomsCache)) ||
76269 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedFloat_id, argv[0])) {
76270 aRv.Throw(NS_ERROR_UNEXPECTED);
76271 return;
76272 }
76273}
76274
76275void
76276TestJSImplInterfaceJSImpl::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76277{
76278 CallSetup s(this, aRv, "TestJSImplInterface.writableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76279 if (aRv.Failed()) {
76280 return;
76281 }
76282 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76282); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76282; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76283 BindingCallContext& cx = s.GetCallContext();
76284
76285 JS::RootedVector<JS::Value> argv(cx);
76286 if (!argv.resize(1)) {
76287 // That threw an exception on the JSContext, and our CallSetup will do
76288 // the right thing with that.
76289 return;
76290 }
76291 do {
76292 argv[0].set(JS_NumberValue(double(arg)));
76293 break;
76294 } while (false);
76295
76296 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76296); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76296; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76297 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76298 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76299 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76300 !InitIds(cx, atomsCache)) ||
76301 !JS_SetPropertyById(cx, callback, atomsCache->writableDouble_id, argv[0])) {
76302 aRv.Throw(NS_ERROR_UNEXPECTED);
76303 return;
76304 }
76305}
76306
76307void
76308TestJSImplInterfaceJSImpl::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76309{
76310 CallSetup s(this, aRv, "TestJSImplInterface.writableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76311 if (aRv.Failed()) {
76312 return;
76313 }
76314 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76314); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76314; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76315 BindingCallContext& cx = s.GetCallContext();
76316
76317 JS::RootedVector<JS::Value> argv(cx);
76318 if (!argv.resize(1)) {
76319 // That threw an exception on the JSContext, and our CallSetup will do
76320 // the right thing with that.
76321 return;
76322 }
76323 do {
76324 argv[0].set(JS_NumberValue(double(arg)));
76325 break;
76326 } while (false);
76327
76328 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76328); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76328; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76329 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76330 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76331 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76332 !InitIds(cx, atomsCache)) ||
76333 !JS_SetPropertyById(cx, callback, atomsCache->writableUnrestrictedDouble_id, argv[0])) {
76334 aRv.Throw(NS_ERROR_UNEXPECTED);
76335 return;
76336 }
76337}
76338
76339void
76340TestJSImplInterfaceJSImpl::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76341{
76342 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76343 if (aRv.Failed()) {
76344 return;
76345 }
76346 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76346); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76346; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76347 BindingCallContext& cx = s.GetCallContext();
76348
76349 JS::RootedVector<JS::Value> argv(cx);
76350 if (!argv.resize(1)) {
76351 // That threw an exception on the JSContext, and our CallSetup will do
76352 // the right thing with that.
76353 return;
76354 }
76355 do {
76356 if (arg.IsNull()) {
76357 argv[0].setNull();
76358 break;
76359 }
76360 argv[0].set(JS_NumberValue(double(arg.Value())));
76361 break;
76362 } while (false);
76363
76364 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76364); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76364; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76365 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76366 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76367 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76368 !InitIds(cx, atomsCache)) ||
76369 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableDouble_id, argv[0])) {
76370 aRv.Throw(NS_ERROR_UNEXPECTED);
76371 return;
76372 }
76373}
76374
76375void
76376TestJSImplInterfaceJSImpl::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76377{
76378 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnrestrictedDouble", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76379 if (aRv.Failed()) {
76380 return;
76381 }
76382 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76382); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76382; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76383 BindingCallContext& cx = s.GetCallContext();
76384
76385 JS::RootedVector<JS::Value> argv(cx);
76386 if (!argv.resize(1)) {
76387 // That threw an exception on the JSContext, and our CallSetup will do
76388 // the right thing with that.
76389 return;
76390 }
76391 do {
76392 if (arg.IsNull()) {
76393 argv[0].setNull();
76394 break;
76395 }
76396 argv[0].set(JS_NumberValue(double(arg.Value())));
76397 break;
76398 } while (false);
76399
76400 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76400); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76400; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76401 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76402 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76403 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76404 !InitIds(cx, atomsCache)) ||
76405 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnrestrictedDouble_id, argv[0])) {
76406 aRv.Throw(NS_ERROR_UNEXPECTED);
76407 return;
76408 }
76409}
76410
76411void
76412TestJSImplInterfaceJSImpl::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm)
76413{
76414 CallSetup s(this, aRv, "TestJSImplInterface.lenientFloatAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76415 if (aRv.Failed()) {
76416 return;
76417 }
76418 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76418); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76418; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76419 BindingCallContext& cx = s.GetCallContext();
76420
76421 JS::RootedVector<JS::Value> argv(cx);
76422 if (!argv.resize(1)) {
76423 // That threw an exception on the JSContext, and our CallSetup will do
76424 // the right thing with that.
76425 return;
76426 }
76427 do {
76428 argv[0].set(JS_NumberValue(double(arg)));
76429 break;
76430 } while (false);
76431
76432 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76432); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76432; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76433 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76434 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76435 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76436 !InitIds(cx, atomsCache)) ||
76437 !JS_SetPropertyById(cx, callback, atomsCache->lenientFloatAttr_id, argv[0])) {
76438 aRv.Throw(NS_ERROR_UNEXPECTED);
76439 return;
76440 }
76441}
76442
76443void
76444TestJSImplInterfaceJSImpl::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm)
76445{
76446 CallSetup s(this, aRv, "TestJSImplInterface.lenientDoubleAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76447 if (aRv.Failed()) {
76448 return;
76449 }
76450 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76450); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76450; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76451 BindingCallContext& cx = s.GetCallContext();
76452
76453 JS::RootedVector<JS::Value> argv(cx);
76454 if (!argv.resize(1)) {
76455 // That threw an exception on the JSContext, and our CallSetup will do
76456 // the right thing with that.
76457 return;
76458 }
76459 do {
76460 argv[0].set(JS_NumberValue(double(arg)));
76461 break;
76462 } while (false);
76463
76464 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76464); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76464; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76465 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76466 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76467 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76468 !InitIds(cx, atomsCache)) ||
76469 !JS_SetPropertyById(cx, callback, atomsCache->lenientDoubleAttr_id, argv[0])) {
76470 aRv.Throw(NS_ERROR_UNEXPECTED);
76471 return;
76472 }
76473}
76474
76475void
76476TestJSImplInterfaceJSImpl::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
76477{
76478 CallSetup s(this, aRv, "TestJSImplInterface.nonNullSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76479 if (aRv.Failed()) {
76480 return;
76481 }
76482 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76482); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76482; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76483 BindingCallContext& cx = s.GetCallContext();
76484
76485 JS::RootedVector<JS::Value> argv(cx);
76486 if (!argv.resize(1)) {
76487 // That threw an exception on the JSContext, and our CallSetup will do
76488 // the right thing with that.
76489 return;
76490 }
76491 do {
76492 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
76493 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 76493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 76493; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76494 aRv.Throw(NS_ERROR_UNEXPECTED);
76495 return;
76496 }
76497 break;
76498 } while (false);
76499
76500 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76500); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76500; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76501 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76502 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76503 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76504 !InitIds(cx, atomsCache)) ||
76505 !JS_SetPropertyById(cx, callback, atomsCache->nonNullSelf_id, argv[0])) {
76506 aRv.Throw(NS_ERROR_UNEXPECTED);
76507 return;
76508 }
76509}
76510
76511void
76512TestJSImplInterfaceJSImpl::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76513{
76514 CallSetup s(this, aRv, "TestJSImplInterface.nullableSelf", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76515 if (aRv.Failed()) {
76516 return;
76517 }
76518 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76518); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76518; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76519 BindingCallContext& cx = s.GetCallContext();
76520
76521 JS::RootedVector<JS::Value> argv(cx);
76522 if (!argv.resize(1)) {
76523 // That threw an exception on the JSContext, and our CallSetup will do
76524 // the right thing with that.
76525 return;
76526 }
76527 do {
76528 if (!arg) {
76529 argv[0].setNull();
76530 break;
76531 }
76532 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
76533 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 76533); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 76533; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76534 aRv.Throw(NS_ERROR_UNEXPECTED);
76535 return;
76536 }
76537 break;
76538 } while (false);
76539
76540 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76540); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76540; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76541 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76542 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76543 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76544 !InitIds(cx, atomsCache)) ||
76545 !JS_SetPropertyById(cx, callback, atomsCache->nullableSelf_id, argv[0])) {
76546 aRv.Throw(NS_ERROR_UNEXPECTED);
76547 return;
76548 }
76549}
76550
76551void
76552TestJSImplInterfaceJSImpl::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76553{
76554 CallSetup s(this, aRv, "TestJSImplInterface.nonNullExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76555 if (aRv.Failed()) {
76556 return;
76557 }
76558 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76558); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76558; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76559 BindingCallContext& cx = s.GetCallContext();
76560
76561 JS::RootedVector<JS::Value> argv(cx);
76562 if (!argv.resize(1)) {
76563 // That threw an exception on the JSContext, and our CallSetup will do
76564 // the right thing with that.
76565 return;
76566 }
76567 do {
76568 if (!WrapObject(cx, arg, argv[0])) {
76569 aRv.Throw(NS_ERROR_UNEXPECTED);
76570 return;
76571 }
76572 break;
76573 } while (false);
76574
76575 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76575; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76576 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76577 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76578 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76579 !InitIds(cx, atomsCache)) ||
76580 !JS_SetPropertyById(cx, callback, atomsCache->nonNullExternal_id, argv[0])) {
76581 aRv.Throw(NS_ERROR_UNEXPECTED);
76582 return;
76583 }
76584}
76585
76586void
76587TestJSImplInterfaceJSImpl::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76588{
76589 CallSetup s(this, aRv, "TestJSImplInterface.nullableExternal", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76590 if (aRv.Failed()) {
76591 return;
76592 }
76593 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76593); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76593; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76594 BindingCallContext& cx = s.GetCallContext();
76595
76596 JS::RootedVector<JS::Value> argv(cx);
76597 if (!argv.resize(1)) {
76598 // That threw an exception on the JSContext, and our CallSetup will do
76599 // the right thing with that.
76600 return;
76601 }
76602 do {
76603 if (!arg) {
76604 argv[0].setNull();
76605 break;
76606 }
76607 if (!WrapObject(cx, arg, argv[0])) {
76608 aRv.Throw(NS_ERROR_UNEXPECTED);
76609 return;
76610 }
76611 break;
76612 } while (false);
76613
76614 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76614); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76614; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76615 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76616 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76617 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76618 !InitIds(cx, atomsCache)) ||
76619 !JS_SetPropertyById(cx, callback, atomsCache->nullableExternal_id, argv[0])) {
76620 aRv.Throw(NS_ERROR_UNEXPECTED);
76621 return;
76622 }
76623}
76624
76625void
76626TestJSImplInterfaceJSImpl::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
76627{
76628 CallSetup s(this, aRv, "TestJSImplInterface.nonNullCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76629 if (aRv.Failed()) {
76630 return;
76631 }
76632 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76632); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76632; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76633 BindingCallContext& cx = s.GetCallContext();
76634
76635 JS::RootedVector<JS::Value> argv(cx);
76636 if (!argv.resize(1)) {
76637 // That threw an exception on the JSContext, and our CallSetup will do
76638 // the right thing with that.
76639 return;
76640 }
76641 do {
76642 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
76643 if (!MaybeWrapObjectValue(cx, argv[0])) {
76644 aRv.Throw(NS_ERROR_UNEXPECTED);
76645 return;
76646 }
76647 break;
76648 } while (false);
76649
76650 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76650); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76650; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76651 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76652 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76653 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76654 !InitIds(cx, atomsCache)) ||
76655 !JS_SetPropertyById(cx, callback, atomsCache->nonNullCallbackInterface_id, argv[0])) {
76656 aRv.Throw(NS_ERROR_UNEXPECTED);
76657 return;
76658 }
76659}
76660
76661void
76662TestJSImplInterfaceJSImpl::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
76663{
76664 CallSetup s(this, aRv, "TestJSImplInterface.nullableCallbackInterface", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76665 if (aRv.Failed()) {
76666 return;
76667 }
76668 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76668); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76668; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76669 BindingCallContext& cx = s.GetCallContext();
76670
76671 JS::RootedVector<JS::Value> argv(cx);
76672 if (!argv.resize(1)) {
76673 // That threw an exception on the JSContext, and our CallSetup will do
76674 // the right thing with that.
76675 return;
76676 }
76677 do {
76678 if (arg) {
76679 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
76680 if (!MaybeWrapObjectOrNullValue(cx, argv[0])) {
76681 aRv.Throw(NS_ERROR_UNEXPECTED);
76682 return;
76683 }
76684 break;
76685 } else {
76686 argv[0].setNull();
76687 break;
76688 }
76689 } while (false);
76690
76691 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76691); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76691; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76692 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76693 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76694 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76695 !InitIds(cx, atomsCache)) ||
76696 !JS_SetPropertyById(cx, callback, atomsCache->nullableCallbackInterface_id, argv[0])) {
76697 aRv.Throw(NS_ERROR_UNEXPECTED);
76698 return;
76699 }
76700}
76701
76702void
76703TestJSImplInterfaceJSImpl::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
76704{
76705 CallSetup s(this, aRv, "TestJSImplInterface.uint8ArrayAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76706 if (aRv.Failed()) {
76707 return;
76708 }
76709 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76709); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76709; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76710 BindingCallContext& cx = s.GetCallContext();
76711
76712 JS::RootedVector<JS::Value> argv(cx);
76713 if (!argv.resize(1)) {
76714 // That threw an exception on the JSContext, and our CallSetup will do
76715 // the right thing with that.
76716 return;
76717 }
76718 do {
76719 argv[0].setObject(*arg.Obj());
76720 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
76721 aRv.Throw(NS_ERROR_UNEXPECTED);
76722 return;
76723 }
76724 break;
76725 } while (false);
76726
76727 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76727); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76727; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76728 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76729 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76730 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76731 !InitIds(cx, atomsCache)) ||
76732 !JS_SetPropertyById(cx, callback, atomsCache->uint8ArrayAttr_id, argv[0])) {
76733 aRv.Throw(NS_ERROR_UNEXPECTED);
76734 return;
76735 }
76736}
76737
76738void
76739TestJSImplInterfaceJSImpl::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
76740{
76741 CallSetup s(this, aRv, "TestJSImplInterface.jsStringAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76742 if (aRv.Failed()) {
76743 return;
76744 }
76745 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76745); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76745; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76746 BindingCallContext& cx = s.GetCallContext();
76747
76748 JS::RootedVector<JS::Value> argv(cx);
76749 if (!argv.resize(1)) {
76750 // That threw an exception on the JSContext, and our CallSetup will do
76751 // the right thing with that.
76752 return;
76753 }
76754 do {
76755 argv[0].setString(arg);
76756 if (!MaybeWrapStringValue(cx, argv[0])) {
76757 aRv.Throw(NS_ERROR_UNEXPECTED);
76758 return;
76759 }
76760 break;
76761 } while (false);
76762
76763 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76763); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76763; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76764 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76765 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76766 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76767 !InitIds(cx, atomsCache)) ||
76768 !JS_SetPropertyById(cx, callback, atomsCache->jsStringAttr_id, argv[0])) {
76769 aRv.Throw(NS_ERROR_UNEXPECTED);
76770 return;
76771 }
76772}
76773
76774void
76775TestJSImplInterfaceJSImpl::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
76776{
76777 CallSetup s(this, aRv, "TestJSImplInterface.enumAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76778 if (aRv.Failed()) {
76779 return;
76780 }
76781 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76781); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76781; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76782 BindingCallContext& cx = s.GetCallContext();
76783
76784 JS::RootedVector<JS::Value> argv(cx);
76785 if (!argv.resize(1)) {
76786 // That threw an exception on the JSContext, and our CallSetup will do
76787 // the right thing with that.
76788 return;
76789 }
76790 do {
76791 if (!ToJSValue(cx, arg, argv[0])) {
76792 aRv.Throw(NS_ERROR_UNEXPECTED);
76793 return;
76794 }
76795 break;
76796 } while (false);
76797
76798 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76798); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76798; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76799 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76800 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76801 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76802 !InitIds(cx, atomsCache)) ||
76803 !JS_SetPropertyById(cx, callback, atomsCache->enumAttribute_id, argv[0])) {
76804 aRv.Throw(NS_ERROR_UNEXPECTED);
76805 return;
76806 }
76807}
76808
76809void
76810TestJSImplInterfaceJSImpl::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
76811{
76812 CallSetup s(this, aRv, "TestJSImplInterface.writableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76813 if (aRv.Failed()) {
76814 return;
76815 }
76816 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76816); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76816; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76817 BindingCallContext& cx = s.GetCallContext();
76818
76819 JS::RootedVector<JS::Value> argv(cx);
76820 if (!argv.resize(1)) {
76821 // That threw an exception on the JSContext, and our CallSetup will do
76822 // the right thing with that.
76823 return;
76824 }
76825 do {
76826 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
76827 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
76828 aRv.Throw(NS_ERROR_UNEXPECTED);
76829 return;
76830 }
76831 break;
76832 } while (false);
76833
76834 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76834); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76834; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76835 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76836 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76837 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76838 !InitIds(cx, atomsCache)) ||
76839 !JS_SetPropertyById(cx, callback, atomsCache->writableUnion_id, argv[0])) {
76840 aRv.Throw(NS_ERROR_UNEXPECTED);
76841 return;
76842 }
76843}
76844
76845void
76846TestJSImplInterfaceJSImpl::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
76847{
76848 CallSetup s(this, aRv, "TestJSImplInterface.writableUnionContainingNull", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76849 if (aRv.Failed()) {
76850 return;
76851 }
76852 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76852); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76852; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76853 BindingCallContext& cx = s.GetCallContext();
76854
76855 JS::RootedVector<JS::Value> argv(cx);
76856 if (!argv.resize(1)) {
76857 // That threw an exception on the JSContext, and our CallSetup will do
76858 // the right thing with that.
76859 return;
76860 }
76861 do {
76862 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
76863 if (!arg.ToJSVal(cx, callbackObj, argv[0])) {
76864 aRv.Throw(NS_ERROR_UNEXPECTED);
76865 return;
76866 }
76867 break;
76868 } while (false);
76869
76870 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76870); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76870; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76871 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76872 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76873 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76874 !InitIds(cx, atomsCache)) ||
76875 !JS_SetPropertyById(cx, callback, atomsCache->writableUnionContainingNull_id, argv[0])) {
76876 aRv.Throw(NS_ERROR_UNEXPECTED);
76877 return;
76878 }
76879}
76880
76881void
76882TestJSImplInterfaceJSImpl::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76883{
76884 CallSetup s(this, aRv, "TestJSImplInterface.writableNullableUnion", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76885 if (aRv.Failed()) {
76886 return;
76887 }
76888 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76888); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76888; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76889 BindingCallContext& cx = s.GetCallContext();
76890
76891 JS::RootedVector<JS::Value> argv(cx);
76892 if (!argv.resize(1)) {
76893 // That threw an exception on the JSContext, and our CallSetup will do
76894 // the right thing with that.
76895 return;
76896 }
76897 do {
76898 JS::Rooted<JSObject*> callbackObj(cx, CallbackKnownNotGray());
76899 if (arg.IsNull()) {
76900 argv[0].setNull();
76901 break;
76902 }
76903 if (!arg.Value().ToJSVal(cx, callbackObj, argv[0])) {
76904 aRv.Throw(NS_ERROR_UNEXPECTED);
76905 return;
76906 }
76907 break;
76908 } while (false);
76909
76910 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76910); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76910; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76911 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76912 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76913 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76914 !InitIds(cx, atomsCache)) ||
76915 !JS_SetPropertyById(cx, callback, atomsCache->writableNullableUnion_id, argv[0])) {
76916 aRv.Throw(NS_ERROR_UNEXPECTED);
76917 return;
76918 }
76919}
76920
76921void
76922TestJSImplInterfaceJSImpl::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76923{
76924 CallSetup s(this, aRv, "TestJSImplInterface.attributeRenamedFrom", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76925 if (aRv.Failed()) {
76926 return;
76927 }
76928 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76928); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76928; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76929 BindingCallContext& cx = s.GetCallContext();
76930
76931 JS::RootedVector<JS::Value> argv(cx);
76932 if (!argv.resize(1)) {
76933 // That threw an exception on the JSContext, and our CallSetup will do
76934 // the right thing with that.
76935 return;
76936 }
76937 do {
76938 argv[0].setInt32(int32_t(arg));
76939 break;
76940 } while (false);
76941
76942 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76942); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76942; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76943 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76944 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76945 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76946 !InitIds(cx, atomsCache)) ||
76947 !JS_SetPropertyById(cx, callback, atomsCache->attributeRenamedTo_id, argv[0])) {
76948 aRv.Throw(NS_ERROR_UNEXPECTED);
76949 return;
76950 }
76951}
76952
76953void
76954TestJSImplInterfaceJSImpl::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
76955{
76956 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76957 if (aRv.Failed()) {
76958 return;
76959 }
76960 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76960); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76960; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76961 BindingCallContext& cx = s.GetCallContext();
76962
76963 JS::RootedVector<JS::Value> argv(cx);
76964 if (!argv.resize(1)) {
76965 // That threw an exception on the JSContext, and our CallSetup will do
76966 // the right thing with that.
76967 return;
76968 }
76969 do {
76970 argv[0].setInt32(int32_t(arg));
76971 break;
76972 } while (false);
76973
76974 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 76974); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 76974; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76975 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
76976 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
76977 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
76978 !InitIds(cx, atomsCache)) ||
76979 !JS_SetPropertyById(cx, callback, atomsCache->enforcedByte_id, argv[0])) {
76980 aRv.Throw(NS_ERROR_UNEXPECTED);
76981 return;
76982 }
76983}
76984
76985void
76986TestJSImplInterfaceJSImpl::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
76987{
76988 CallSetup s(this, aRv, "TestJSImplInterface.enforcedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
76989 if (aRv.Failed()) {
76990 return;
76991 }
76992 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 76992); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 76992; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
76993 BindingCallContext& cx = s.GetCallContext();
76994
76995 JS::RootedVector<JS::Value> argv(cx);
76996 if (!argv.resize(1)) {
76997 // That threw an exception on the JSContext, and our CallSetup will do
76998 // the right thing with that.
76999 return;
77000 }
77001 do {
77002 if (arg.IsNull()) {
77003 argv[0].setNull();
77004 break;
77005 }
77006 argv[0].setInt32(int32_t(arg.Value()));
77007 break;
77008 } while (false);
77009
77010 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77010); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77010; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77011 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77012 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77013 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77014 !InitIds(cx, atomsCache)) ||
77015 !JS_SetPropertyById(cx, callback, atomsCache->enforcedByteNullable_id, argv[0])) {
77016 aRv.Throw(NS_ERROR_UNEXPECTED);
77017 return;
77018 }
77019}
77020
77021void
77022TestJSImplInterfaceJSImpl::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77023{
77024 CallSetup s(this, aRv, "TestJSImplInterface.clampedByte", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77025 if (aRv.Failed()) {
77026 return;
77027 }
77028 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77028); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77028; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77029 BindingCallContext& cx = s.GetCallContext();
77030
77031 JS::RootedVector<JS::Value> argv(cx);
77032 if (!argv.resize(1)) {
77033 // That threw an exception on the JSContext, and our CallSetup will do
77034 // the right thing with that.
77035 return;
77036 }
77037 do {
77038 argv[0].setInt32(int32_t(arg));
77039 break;
77040 } while (false);
77041
77042 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77042); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77042; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77043 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77044 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77045 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77046 !InitIds(cx, atomsCache)) ||
77047 !JS_SetPropertyById(cx, callback, atomsCache->clampedByte_id, argv[0])) {
77048 aRv.Throw(NS_ERROR_UNEXPECTED);
77049 return;
77050 }
77051}
77052
77053void
77054TestJSImplInterfaceJSImpl::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77055{
77056 CallSetup s(this, aRv, "TestJSImplInterface.clampedByteNullable", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77057 if (aRv.Failed()) {
77058 return;
77059 }
77060 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77060); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77060; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77061 BindingCallContext& cx = s.GetCallContext();
77062
77063 JS::RootedVector<JS::Value> argv(cx);
77064 if (!argv.resize(1)) {
77065 // That threw an exception on the JSContext, and our CallSetup will do
77066 // the right thing with that.
77067 return;
77068 }
77069 do {
77070 if (arg.IsNull()) {
77071 argv[0].setNull();
77072 break;
77073 }
77074 argv[0].setInt32(int32_t(arg.Value()));
77075 break;
77076 } while (false);
77077
77078 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77078); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77078; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77079 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77080 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77081 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77082 !InitIds(cx, atomsCache)) ||
77083 !JS_SetPropertyById(cx, callback, atomsCache->clampedByteNullable_id, argv[0])) {
77084 aRv.Throw(NS_ERROR_UNEXPECTED);
77085 return;
77086 }
77087}
77088
77089void
77090TestJSImplInterfaceJSImpl::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77091{
77092 CallSetup s(this, aRv, "TestJSImplInterface.deprecatedAttribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77093 if (aRv.Failed()) {
77094 return;
77095 }
77096 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77096); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77096; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77097 BindingCallContext& cx = s.GetCallContext();
77098
77099 JS::RootedVector<JS::Value> argv(cx);
77100 if (!argv.resize(1)) {
77101 // That threw an exception on the JSContext, and our CallSetup will do
77102 // the right thing with that.
77103 return;
77104 }
77105 do {
77106 argv[0].setInt32(int32_t(arg));
77107 break;
77108 } while (false);
77109
77110 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77110); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77110; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77111 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77112 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77113 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77114 !InitIds(cx, atomsCache)) ||
77115 !JS_SetPropertyById(cx, callback, atomsCache->deprecatedAttribute_id, argv[0])) {
77116 aRv.Throw(NS_ERROR_UNEXPECTED);
77117 return;
77118 }
77119}
77120
77121void
77122TestJSImplInterfaceJSImpl::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77123{
77124 CallSetup s(this, aRv, "TestJSImplInterface.attrWithLenientThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77125 if (aRv.Failed()) {
77126 return;
77127 }
77128 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77128); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77128; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77129 BindingCallContext& cx = s.GetCallContext();
77130
77131 JS::RootedVector<JS::Value> argv(cx);
77132 if (!argv.resize(1)) {
77133 // That threw an exception on the JSContext, and our CallSetup will do
77134 // the right thing with that.
77135 return;
77136 }
77137 do {
77138 argv[0].setInt32(int32_t(arg));
77139 break;
77140 } while (false);
77141
77142 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77142); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77142; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77143 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77144 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77145 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77146 !InitIds(cx, atomsCache)) ||
77147 !JS_SetPropertyById(cx, callback, atomsCache->attrWithLenientThis_id, argv[0])) {
77148 aRv.Throw(NS_ERROR_UNEXPECTED);
77149 return;
77150 }
77151}
77152
77153void
77154TestJSImplInterfaceJSImpl::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77155{
77156 CallSetup s(this, aRv, "TestJSImplInterface.throwingAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77157 if (aRv.Failed()) {
77158 return;
77159 }
77160 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77160); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77160; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77161 BindingCallContext& cx = s.GetCallContext();
77162
77163 JS::RootedVector<JS::Value> argv(cx);
77164 if (!argv.resize(1)) {
77165 // That threw an exception on the JSContext, and our CallSetup will do
77166 // the right thing with that.
77167 return;
77168 }
77169 do {
77170 argv[0].setBoolean(arg);
77171 break;
77172 } while (false);
77173
77174 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77174); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77174; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77175 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77176 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77177 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77178 !InitIds(cx, atomsCache)) ||
77179 !JS_SetPropertyById(cx, callback, atomsCache->throwingAttr_id, argv[0])) {
77180 aRv.Throw(NS_ERROR_UNEXPECTED);
77181 return;
77182 }
77183}
77184
77185void
77186TestJSImplInterfaceJSImpl::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77187{
77188 CallSetup s(this, aRv, "TestJSImplInterface.throwingGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77189 if (aRv.Failed()) {
77190 return;
77191 }
77192 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77192); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77192; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77193 BindingCallContext& cx = s.GetCallContext();
77194
77195 JS::RootedVector<JS::Value> argv(cx);
77196 if (!argv.resize(1)) {
77197 // That threw an exception on the JSContext, and our CallSetup will do
77198 // the right thing with that.
77199 return;
77200 }
77201 do {
77202 argv[0].setBoolean(arg);
77203 break;
77204 } while (false);
77205
77206 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77206); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77206; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77207 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77208 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77209 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77210 !InitIds(cx, atomsCache)) ||
77211 !JS_SetPropertyById(cx, callback, atomsCache->throwingGetterAttr_id, argv[0])) {
77212 aRv.Throw(NS_ERROR_UNEXPECTED);
77213 return;
77214 }
77215}
77216
77217void
77218TestJSImplInterfaceJSImpl::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77219{
77220 CallSetup s(this, aRv, "TestJSImplInterface.throwingSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77221 if (aRv.Failed()) {
77222 return;
77223 }
77224 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77224); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77224; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77225 BindingCallContext& cx = s.GetCallContext();
77226
77227 JS::RootedVector<JS::Value> argv(cx);
77228 if (!argv.resize(1)) {
77229 // That threw an exception on the JSContext, and our CallSetup will do
77230 // the right thing with that.
77231 return;
77232 }
77233 do {
77234 argv[0].setBoolean(arg);
77235 break;
77236 } while (false);
77237
77238 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77238); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77238; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77239 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77240 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77241 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77242 !InitIds(cx, atomsCache)) ||
77243 !JS_SetPropertyById(cx, callback, atomsCache->throwingSetterAttr_id, argv[0])) {
77244 aRv.Throw(NS_ERROR_UNEXPECTED);
77245 return;
77246 }
77247}
77248
77249void
77250TestJSImplInterfaceJSImpl::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77251{
77252 CallSetup s(this, aRv, "TestJSImplInterface.canOOMAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77253 if (aRv.Failed()) {
77254 return;
77255 }
77256 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77256); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77256; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77257 BindingCallContext& cx = s.GetCallContext();
77258
77259 JS::RootedVector<JS::Value> argv(cx);
77260 if (!argv.resize(1)) {
77261 // That threw an exception on the JSContext, and our CallSetup will do
77262 // the right thing with that.
77263 return;
77264 }
77265 do {
77266 argv[0].setBoolean(arg);
77267 break;
77268 } while (false);
77269
77270 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77270); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77270; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77271 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77272 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77273 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77274 !InitIds(cx, atomsCache)) ||
77275 !JS_SetPropertyById(cx, callback, atomsCache->canOOMAttr_id, argv[0])) {
77276 aRv.Throw(NS_ERROR_UNEXPECTED);
77277 return;
77278 }
77279}
77280
77281void
77282TestJSImplInterfaceJSImpl::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77283{
77284 CallSetup s(this, aRv, "TestJSImplInterface.canOOMGetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77285 if (aRv.Failed()) {
77286 return;
77287 }
77288 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77288); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77288; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77289 BindingCallContext& cx = s.GetCallContext();
77290
77291 JS::RootedVector<JS::Value> argv(cx);
77292 if (!argv.resize(1)) {
77293 // That threw an exception on the JSContext, and our CallSetup will do
77294 // the right thing with that.
77295 return;
77296 }
77297 do {
77298 argv[0].setBoolean(arg);
77299 break;
77300 } while (false);
77301
77302 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77302); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77302; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77303 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77304 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77305 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77306 !InitIds(cx, atomsCache)) ||
77307 !JS_SetPropertyById(cx, callback, atomsCache->canOOMGetterAttr_id, argv[0])) {
77308 aRv.Throw(NS_ERROR_UNEXPECTED);
77309 return;
77310 }
77311}
77312
77313void
77314TestJSImplInterfaceJSImpl::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77315{
77316 CallSetup s(this, aRv, "TestJSImplInterface.canOOMSetterAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77317 if (aRv.Failed()) {
77318 return;
77319 }
77320 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77320); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77320; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77321 BindingCallContext& cx = s.GetCallContext();
77322
77323 JS::RootedVector<JS::Value> argv(cx);
77324 if (!argv.resize(1)) {
77325 // That threw an exception on the JSContext, and our CallSetup will do
77326 // the right thing with that.
77327 return;
77328 }
77329 do {
77330 argv[0].setBoolean(arg);
77331 break;
77332 } while (false);
77333
77334 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77334); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77334; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77335 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77336 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77337 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77338 !InitIds(cx, atomsCache)) ||
77339 !JS_SetPropertyById(cx, callback, atomsCache->canOOMSetterAttr_id, argv[0])) {
77340 aRv.Throw(NS_ERROR_UNEXPECTED);
77341 return;
77342 }
77343}
77344
77345void
77346TestJSImplInterfaceJSImpl::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77347{
77348 CallSetup s(this, aRv, "TestJSImplInterface.ceReactionsAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77349 if (aRv.Failed()) {
77350 return;
77351 }
77352 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77352); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77352; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77353 BindingCallContext& cx = s.GetCallContext();
77354
77355 JS::RootedVector<JS::Value> argv(cx);
77356 if (!argv.resize(1)) {
77357 // That threw an exception on the JSContext, and our CallSetup will do
77358 // the right thing with that.
77359 return;
77360 }
77361 do {
77362 argv[0].setBoolean(arg);
77363 break;
77364 } while (false);
77365
77366 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77366); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77366; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77367 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77368 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77369 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77370 !InitIds(cx, atomsCache)) ||
77371 !JS_SetPropertyById(cx, callback, atomsCache->ceReactionsAttr_id, argv[0])) {
77372 aRv.Throw(NS_ERROR_UNEXPECTED);
77373 return;
77374 }
77375}
77376
77377void
77378TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
77379{
77380 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77381 if (aRv.Failed()) {
77382 return;
77383 }
77384 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77384); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77384; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77385 BindingCallContext& cx = s.GetCallContext();
77386
77387 JS::RootedVector<JS::Value> argv(cx);
77388 if (!argv.resize(1)) {
77389 // That threw an exception on the JSContext, and our CallSetup will do
77390 // the right thing with that.
77391 return;
77392 }
77393 do {
77394 JS::ExposeValueToActiveJS(arg);
77395 argv[0].set(arg);
77396 if (!MaybeWrapValue(cx, argv[0])) {
77397 aRv.Throw(NS_ERROR_UNEXPECTED);
77398 return;
77399 }
77400 break;
77401 } while (false);
77402
77403 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77403); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77403; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77404 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77405 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77406 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77407 !InitIds(cx, atomsCache)) ||
77408 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis_id, argv[0])) {
77409 aRv.Throw(NS_ERROR_UNEXPECTED);
77410 return;
77411 }
77412}
77413
77414void
77415TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
77416{
77417 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis2", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77418 if (aRv.Failed()) {
77419 return;
77420 }
77421 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77421); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77421; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77422 BindingCallContext& cx = s.GetCallContext();
77423
77424 JS::RootedVector<JS::Value> argv(cx);
77425 if (!argv.resize(1)) {
77426 // That threw an exception on the JSContext, and our CallSetup will do
77427 // the right thing with that.
77428 return;
77429 }
77430 do {
77431 if (!GetOrCreateDOMReflector(cx, arg, argv[0])) {
77432 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 77432); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 77432; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77433 aRv.Throw(NS_ERROR_UNEXPECTED);
77434 return;
77435 }
77436 break;
77437 } while (false);
77438
77439 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77439); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77439; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77440 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77441 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77442 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77443 !InitIds(cx, atomsCache)) ||
77444 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis2_id, argv[0])) {
77445 aRv.Throw(NS_ERROR_UNEXPECTED);
77446 return;
77447 }
77448}
77449
77450void
77451TestJSImplInterfaceJSImpl::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
77452{
77453 CallSetup s(this, aRv, "TestJSImplInterface.toJSONShouldSkipThis3", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77454 if (aRv.Failed()) {
77455 return;
77456 }
77457 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77457); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77457; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77458 BindingCallContext& cx = s.GetCallContext();
77459
77460 JS::RootedVector<JS::Value> argv(cx);
77461 if (!argv.resize(1)) {
77462 // That threw an exception on the JSContext, and our CallSetup will do
77463 // the right thing with that.
77464 return;
77465 }
77466 do {
77467 argv[0].setObjectOrNull(GetCallbackFromCallbackObject(cx, arg));
77468 if (!MaybeWrapObjectValue(cx, argv[0])) {
77469 aRv.Throw(NS_ERROR_UNEXPECTED);
77470 return;
77471 }
77472 break;
77473 } while (false);
77474
77475 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77475); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77475; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77476 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77477 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77478 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77479 !InitIds(cx, atomsCache)) ||
77480 !JS_SetPropertyById(cx, callback, atomsCache->toJSONShouldSkipThis3_id, argv[0])) {
77481 aRv.Throw(NS_ERROR_UNEXPECTED);
77482 return;
77483 }
77484}
77485
77486void
77487TestJSImplInterfaceJSImpl::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77488{
77489 CallSetup s(this, aRv, "TestJSImplInterface.dashed-attribute", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77490 if (aRv.Failed()) {
77491 return;
77492 }
77493 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77493); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77493; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77494 BindingCallContext& cx = s.GetCallContext();
77495
77496 JS::RootedVector<JS::Value> argv(cx);
77497 if (!argv.resize(1)) {
77498 // That threw an exception on the JSContext, and our CallSetup will do
77499 // the right thing with that.
77500 return;
77501 }
77502 do {
77503 argv[0].setInt32(int32_t(arg));
77504 break;
77505 } while (false);
77506
77507 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77507); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77507; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77508 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77509 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77510 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77511 !InitIds(cx, atomsCache)) ||
77512 !JS_SetPropertyById(cx, callback, atomsCache->dashed_attribute_id, argv[0])) {
77513 aRv.Throw(NS_ERROR_UNEXPECTED);
77514 return;
77515 }
77516}
77517
77518void
77519TestJSImplInterfaceJSImpl::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
77520{
77521 CallSetup s(this, aRv, "TestJSImplInterface.nonEnumerableAttr", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77522 if (aRv.Failed()) {
77523 return;
77524 }
77525 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77525); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77525; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77526 BindingCallContext& cx = s.GetCallContext();
77527
77528 JS::RootedVector<JS::Value> argv(cx);
77529 if (!argv.resize(1)) {
77530 // That threw an exception on the JSContext, and our CallSetup will do
77531 // the right thing with that.
77532 return;
77533 }
77534 do {
77535 argv[0].setBoolean(arg);
77536 break;
77537 } while (false);
77538
77539 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77539); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77539; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77540 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77541 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77542 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77543 !InitIds(cx, atomsCache)) ||
77544 !JS_SetPropertyById(cx, callback, atomsCache->nonEnumerableAttr_id, argv[0])) {
77545 aRv.Throw(NS_ERROR_UNEXPECTED);
77546 return;
77547 }
77548}
77549
77550void
77551TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
77552{
77553 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferViewTypedef", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77554 if (aRv.Failed()) {
77555 return;
77556 }
77557 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77557); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77557; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77558 BindingCallContext& cx = s.GetCallContext();
77559
77560 JS::RootedVector<JS::Value> argv(cx);
77561 if (!argv.resize(1)) {
77562 // That threw an exception on the JSContext, and our CallSetup will do
77563 // the right thing with that.
77564 return;
77565 }
77566 do {
77567 argv[0].setObject(*arg.Obj());
77568 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77569 aRv.Throw(NS_ERROR_UNEXPECTED);
77570 return;
77571 }
77572 break;
77573 } while (false);
77574
77575 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77575); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77575; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77576 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77577 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77578 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77579 !InitIds(cx, atomsCache)) ||
77580 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferViewTypedef_id, argv[0])) {
77581 aRv.Throw(NS_ERROR_UNEXPECTED);
77582 return;
77583 }
77584}
77585
77586void
77587TestJSImplInterfaceJSImpl::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
77588{
77589 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77590 if (aRv.Failed()) {
77591 return;
77592 }
77593 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77593); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77593; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77594 BindingCallContext& cx = s.GetCallContext();
77595
77596 JS::RootedVector<JS::Value> argv(cx);
77597 if (!argv.resize(1)) {
77598 // That threw an exception on the JSContext, and our CallSetup will do
77599 // the right thing with that.
77600 return;
77601 }
77602 do {
77603 argv[0].setObject(*arg.Obj());
77604 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77605 aRv.Throw(NS_ERROR_UNEXPECTED);
77606 return;
77607 }
77608 break;
77609 } while (false);
77610
77611 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77611); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77611; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77612 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77613 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77614 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77615 !InitIds(cx, atomsCache)) ||
77616 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBufferView_id, argv[0])) {
77617 aRv.Throw(NS_ERROR_UNEXPECTED);
77618 return;
77619 }
77620}
77621
77622void
77623TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77624{
77625 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBufferView", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77626 if (aRv.Failed()) {
77627 return;
77628 }
77629 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77629); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77629; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77630 BindingCallContext& cx = s.GetCallContext();
77631
77632 JS::RootedVector<JS::Value> argv(cx);
77633 if (!argv.resize(1)) {
77634 // That threw an exception on the JSContext, and our CallSetup will do
77635 // the right thing with that.
77636 return;
77637 }
77638 do {
77639 if (arg.IsNull()) {
77640 argv[0].setNull();
77641 break;
77642 }
77643 argv[0].setObject(*arg.Value().Obj());
77644 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77645 aRv.Throw(NS_ERROR_UNEXPECTED);
77646 return;
77647 }
77648 break;
77649 } while (false);
77650
77651 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77651); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77651; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77652 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77653 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77654 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77655 !InitIds(cx, atomsCache)) ||
77656 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBufferView_id, argv[0])) {
77657 aRv.Throw(NS_ERROR_UNEXPECTED);
77658 return;
77659 }
77660}
77661
77662void
77663TestJSImplInterfaceJSImpl::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
77664{
77665 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77666 if (aRv.Failed()) {
77667 return;
77668 }
77669 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77669); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77669; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77670 BindingCallContext& cx = s.GetCallContext();
77671
77672 JS::RootedVector<JS::Value> argv(cx);
77673 if (!argv.resize(1)) {
77674 // That threw an exception on the JSContext, and our CallSetup will do
77675 // the right thing with that.
77676 return;
77677 }
77678 do {
77679 argv[0].setObject(*arg.Obj());
77680 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77681 aRv.Throw(NS_ERROR_UNEXPECTED);
77682 return;
77683 }
77684 break;
77685 } while (false);
77686
77687 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77687); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77687; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77688 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77689 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77690 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77691 !InitIds(cx, atomsCache)) ||
77692 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedArrayBuffer_id, argv[0])) {
77693 aRv.Throw(NS_ERROR_UNEXPECTED);
77694 return;
77695 }
77696}
77697
77698void
77699TestJSImplInterfaceJSImpl::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77700{
77701 CallSetup s(this, aRv, "TestJSImplInterface.allowSharedNullableArrayBuffer", eRethrowContentExceptions, aRealm, /* aIsJSImplementedWebIDL = */ true);
77702 if (aRv.Failed()) {
77703 return;
77704 }
77705 MOZ_ASSERT(s.GetContext())do { static_assert( mozilla::detail::AssertionConditionType<
decltype(s.GetContext())>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(s.GetContext()))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("s.GetContext()"
, "../TestJSImplGenBinding.cpp", 77705); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "s.GetContext()" ")"); do { *((volatile int
*)__null) = 77705; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77706 BindingCallContext& cx = s.GetCallContext();
77707
77708 JS::RootedVector<JS::Value> argv(cx);
77709 if (!argv.resize(1)) {
77710 // That threw an exception on the JSContext, and our CallSetup will do
77711 // the right thing with that.
77712 return;
77713 }
77714 do {
77715 if (arg.IsNull()) {
77716 argv[0].setNull();
77717 break;
77718 }
77719 argv[0].setObject(*arg.Value().Obj());
77720 if (!MaybeWrapNonDOMObjectValue(cx, argv[0])) {
77721 aRv.Throw(NS_ERROR_UNEXPECTED);
77722 return;
77723 }
77724 break;
77725 } while (false);
77726
77727 MOZ_ASSERT(argv.length() == 1)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(argv.length() == 1)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(argv.length() == 1))), 0))) {
do { } while (false); MOZ_ReportAssertionFailure("argv.length() == 1"
, "../TestJSImplGenBinding.cpp", 77727); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "argv.length() == 1" ")"); do { *((volatile
int*)__null) = 77727; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77728 JS::Rooted<JSObject*> callback(cx, CallbackKnownNotGray());
77729 TestJSImplInterfaceAtoms* atomsCache = GetAtomCache<TestJSImplInterfaceAtoms>(cx);
77730 if ((reinterpret_cast<jsid*>(atomsCache)->isVoid() &&
77731 !InitIds(cx, atomsCache)) ||
77732 !JS_SetPropertyById(cx, callback, atomsCache->allowSharedNullableArrayBuffer_id, argv[0])) {
77733 aRv.Throw(NS_ERROR_UNEXPECTED);
77734 return;
77735 }
77736}
77737
77738
77739NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestJSImplInterface)static_assert(std::is_base_of<nsWrapperCache, TestJSImplInterface
>::value, "Class should inherit nsWrapperCache"); TestJSImplInterface
::cycleCollection TestJSImplInterface::_cycleCollectorGlobal(
nsCycleCollectionParticipant::FlagMaybeSingleZoneJSHolder); void
TestJSImplInterface::cycleCollection::Trace( void* p, const TraceCallbacks
& aCallbacks, void* aClosure) { TestJSImplInterface* tmp =
DowncastCCParticipant<TestJSImplInterface>(p); TraceWrapper
(p, aCallbacks, aClosure); (void)tmp; } void TestJSImplInterface
::cycleCollection::TraceWrapper( void* p, const TraceCallbacks
& aCallbacks, void* aClosure) { TestJSImplInterface* tmp =
DowncastCCParticipant<TestJSImplInterface>(p); tmp->
TraceWrapper(aCallbacks, aClosure); }
77740NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplInterface)void TestJSImplInterface::cycleCollection::Unlink(void* p) { TestJSImplInterface
* tmp = DowncastCCParticipant<TestJSImplInterface>(p);
77741 NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl);
77742 NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent);
77743 NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p);
77744 tmp->ClearWeakReferences();
77745NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; }
77746NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TestJSImplInterface)nsresult TestJSImplInterface::cycleCollection::TraverseNative
( void* p, nsCycleCollectionTraversalCallback& cb) { TestJSImplInterface
* tmp = DowncastCCParticipant<TestJSImplInterface>(p); cb
.DescribeRefCountedNode(tmp->mRefCnt.get(), "TestJSImplInterface"
);
77747 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0);
77748 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0
);
77749NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; }
77750NS_IMPL_CYCLE_COLLECTING_ADDREF(TestJSImplInterface)MozExternalRefCountType TestJSImplInterface::AddRef(void) { static_assert
(!std::is_destructible_v<TestJSImplInterface>, "Reference-counted class "
"TestJSImplInterface" " should not have a public destructor. "
"Make this class's destructor non-public"); do { static_assert
( mozilla::detail::AssertionConditionType<decltype(int32_t
(mRefCnt) >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(int32_t(mRefCnt) >= 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("int32_t(mRefCnt) >= 0"
" (" "illegal refcnt" ")", "../TestJSImplGenBinding.cpp", 77750
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0"
") (" "illegal refcnt" ")"); do { *((volatile int*)__null) =
77750; __attribute__((nomerge)) ::abort(); } while (false); }
} while (false); _mOwningThread.AssertOwnership("TestJSImplInterface"
" not thread-safe"); nsISupports* base = TestJSImplInterface
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.incr
(base); NS_LogAddRef((this), (count), ("TestJSImplInterface")
, (uint32_t)(sizeof(*this))); return count; }
77751NS_IMPL_CYCLE_COLLECTING_RELEASE(TestJSImplInterface)MozExternalRefCountType TestJSImplInterface::Release(void) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(int32_t(mRefCnt) > 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(int32_t(mRefCnt) > 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("int32_t(mRefCnt) > 0"
" (" "dup release" ")", "../TestJSImplGenBinding.cpp", 77751
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0"
") (" "dup release" ")"); do { *((volatile int*)__null) = 77751
; __attribute__((nomerge)) ::abort(); } while (false); } } while
(false); _mOwningThread.AssertOwnership("TestJSImplInterface"
" not thread-safe"); nsISupports* base = TestJSImplInterface
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr
(base); NS_LogRelease((this), (count), ("TestJSImplInterface"
)); return count; } void TestJSImplInterface::DeleteCycleCollectable
(void) { delete (this); }
77752NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestJSImplInterface)nsresult TestJSImplInterface::QueryInterface(const nsIID&
aIID, void** aInstancePtr) { do { if (!(aInstancePtr)) { NS_DebugBreak
(NS_DEBUG_ASSERTION, "QueryInterface requires a non-NULL destination!"
, "aInstancePtr", "../TestJSImplGenBinding.cpp", 77752); MOZ_PretendNoReturn
(); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals
( aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant
, void>::kIID), (nsCycleCollectionISupports::COMTypeInfo<
nsCycleCollectionISupports, void>::kIID)) && (LowWordEquals
(aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant
, void>::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports
::COMTypeInfo<nsCycleCollectionISupports, void>::kIID))
)) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::COMTypeInfo<nsXPCOMCycleCollectionParticipant, void>::
kIID))) { *aInstancePtr = TestJSImplInterface::cycleCollection
::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, (
nsCycleCollectionISupports::COMTypeInfo<nsCycleCollectionISupports
, void>::kIID))) { *aInstancePtr = TestJSImplInterface::cycleCollection
::Upcast(this); return NS_OK; } foundInterface = nullptr; } else
77753 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::COMTypeInfo<nsWrapperCache
, void>::kIID))) { *aInstancePtr = static_cast<nsWrapperCache
*>(this); return NS_OK; } else
77754 NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupports>)) foundInterface = static_cast
<nsISupports*>(this); else
77755 NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupportsWeakReference>)) foundInterface
= static_cast<nsISupportsWeakReference*>(this); else
77756NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(!aIID.Equals((nsISupports::COMTypeInfo<nsISupports
, void>::kIID)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::COMTypeInfo
<nsISupports, void>::kIID))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))"
, "../TestJSImplGenBinding.cpp", 77756); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))"
")"); do { *((volatile int*)__null) = 77756; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); status
= NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status
= NS_OK; } *aInstancePtr = foundInterface; return status; }
77757
77758TestJSImplInterface::TestJSImplInterface(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent)
77759 : mImpl(new TestJSImplInterfaceJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)),
77760 mParent(aParent)
77761{
77762}
77763
77764
77765TestJSImplInterface::~TestJSImplInterface()
77766{
77767}
77768
77769nsISupports*
77770TestJSImplInterface::GetParentObject() const
77771{
77772 return mParent;
77773}
77774
77775DocGroup*
77776TestJSImplInterface::GetDocGroup() const
77777{
77778 nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(mParent);
77779 if (!window) {
77780 return nullptr;
77781 }
77782 return window->GetDocGroup();
77783}
77784
77785JSObject*
77786TestJSImplInterface::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
77787{
77788 JS::Rooted<JSObject*> obj(aCx, TestJSImplInterface_Binding::Wrap(aCx, this, aGivenProto));
77789 if (!obj) {
77790 return nullptr;
77791 }
77792
77793 // Now define it on our chrome object
77794 JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull());
77795 if (!JS_WrapObject(aCx, &obj)) {
77796 return nullptr;
77797 }
77798 JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull());
77799 if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) {
77800 return nullptr;
77801 }
77802 return obj;
77803}
77804
77805already_AddRefed<TestJSImplInterface>
77806TestJSImplInterface::Constructor(const GlobalObject& global, JSContext* cx, const nsAString& str, uint32_t num, const Nullable<bool>& boolArg, TestInterface* iface, int32_t arg1, const DictForConstructor& dict, JS::Handle<JS::Value> any1, JS::Handle<JSObject*> obj1, JS::Handle<JSObject*> obj2, const Sequence<Dict>& seq, JS::Handle<JS::Value> any2, const Optional<JS::Handle<JSObject*>>& obj3, const Optional<JS::Handle<JSObject*>>& obj4, const Uint8Array& typedArr, const ArrayBuffer& arrayBuf, ErrorResult& aRv, JS::Handle<JSObject*> aGivenProto)
77807{
77808 RefPtr<TestJSImplInterface> impl =
77809 ConstructJSImplementation<TestJSImplInterface>("@mozilla.org/test-js-impl-interface;1", global, aRv);
77810 if (aRv.Failed()) {
77811 return nullptr;
77812 }
77813 // Wrap the object before calling __Init so that __DOM_IMPL__ is available.
77814 JS::Rooted<JSObject*> scopeObj(cx, global.Get());
77815 MOZ_ASSERT(js::IsObjectInContextCompartment(scopeObj, cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(js::IsObjectInContextCompartment(scopeObj, cx))>::
isValid, "invalid assertion condition"); if ((__builtin_expect
(!!(!(!!(js::IsObjectInContextCompartment(scopeObj, cx)))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("js::IsObjectInContextCompartment(scopeObj, cx)"
, "../TestJSImplGenBinding.cpp", 77815); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(scopeObj, cx)"
")"); do { *((volatile int*)__null) = 77815; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
77816 JS::Rooted<JS::Value> wrappedVal(cx);
77817 if (!GetOrCreateDOMReflector(cx, impl, &wrappedVal, aGivenProto)) {
77818 MOZ_ASSERT(JS_IsExceptionPending(cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(JS_IsExceptionPending(cx))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(JS_IsExceptionPending(cx))))
, 0))) { do { } while (false); MOZ_ReportAssertionFailure("JS_IsExceptionPending(cx)"
, "../TestJSImplGenBinding.cpp", 77818); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "JS_IsExceptionPending(cx)" ")"); do { *((volatile
int*)__null) = 77818; __attribute__((nomerge)) ::abort(); } while
(false); } } while (false)
;
77819 aRv.Throw(NS_ERROR_UNEXPECTED);
77820 return nullptr;
77821 }
77822 // Initialize the object with the constructor arguments.
77823 impl->mImpl->__Init(str, num, boolArg, iface, arg1, dict, any1, obj1, obj2, seq, any2, obj3, obj4, typedArr, arrayBuf, aRv, js::GetNonCCWObjectRealm(scopeObj));
77824 if (aRv.Failed()) {
77825 return nullptr;
77826 }
77827 return impl.forget();
77828}
77829
77830int8_t
77831TestJSImplInterface::GetReadonlyByte(ErrorResult& aRv, JS::Realm* aRealm) const
77832{
77833 return mImpl->GetReadonlyByte(aRv, aRealm);
77834}
77835
77836int8_t
77837TestJSImplInterface::GetWritableByte(ErrorResult& aRv, JS::Realm* aRealm) const
77838{
77839 return mImpl->GetWritableByte(aRv, aRealm);
77840}
77841
77842void
77843TestJSImplInterface::SetWritableByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77844{
77845 mImpl->SetWritableByte(arg, aRv, aRealm);
77846}
77847
77848void
77849TestJSImplInterface::PassByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77850{
77851 return mImpl->PassByte(arg, aRv, aRealm);
77852}
77853
77854int8_t
77855TestJSImplInterface::ReceiveByte(ErrorResult& aRv, JS::Realm* aRealm)
77856{
77857 return mImpl->ReceiveByte(aRv, aRealm);
77858}
77859
77860void
77861TestJSImplInterface::PassOptionalByte(const Optional<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77862{
77863 return mImpl->PassOptionalByte(arg, aRv, aRealm);
77864}
77865
77866void
77867TestJSImplInterface::PassOptionalByteBeforeRequired(const Optional<int8_t>& arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
77868{
77869 return mImpl->PassOptionalByteBeforeRequired(arg1, arg2, aRv, aRealm);
77870}
77871
77872void
77873TestJSImplInterface::PassOptionalByteWithDefault(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77874{
77875 return mImpl->PassOptionalByteWithDefault(arg, aRv, aRealm);
77876}
77877
77878void
77879TestJSImplInterface::PassOptionalByteWithDefaultBeforeRequired(int8_t arg1, int8_t arg2, ErrorResult& aRv, JS::Realm* aRealm)
77880{
77881 return mImpl->PassOptionalByteWithDefaultBeforeRequired(arg1, arg2, aRv, aRealm);
77882}
77883
77884void
77885TestJSImplInterface::PassNullableByte(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77886{
77887 return mImpl->PassNullableByte(arg, aRv, aRealm);
77888}
77889
77890void
77891TestJSImplInterface::PassOptionalNullableByte(const Optional<Nullable<int8_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77892{
77893 return mImpl->PassOptionalNullableByte(arg, aRv, aRealm);
77894}
77895
77896void
77897TestJSImplInterface::PassVariadicByte(const Sequence<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77898{
77899 return mImpl->PassVariadicByte(arg, aRv, aRealm);
77900}
77901
77902int8_t
77903TestJSImplInterface::GetSideEffectFreeByte(ErrorResult& aRv, JS::Realm* aRealm) const
77904{
77905 return mImpl->GetSideEffectFreeByte(aRv, aRealm);
77906}
77907
77908void
77909TestJSImplInterface::SetSideEffectFreeByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77910{
77911 mImpl->SetSideEffectFreeByte(arg, aRv, aRealm);
77912}
77913
77914int8_t
77915TestJSImplInterface::GetDomDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const
77916{
77917 return mImpl->GetDomDependentByte(aRv, aRealm);
77918}
77919
77920void
77921TestJSImplInterface::SetDomDependentByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77922{
77923 mImpl->SetDomDependentByte(arg, aRv, aRealm);
77924}
77925
77926int8_t
77927TestJSImplInterface::GetConstantByte(ErrorResult& aRv, JS::Realm* aRealm) const
77928{
77929 return mImpl->GetConstantByte(aRv, aRealm);
77930}
77931
77932int8_t
77933TestJSImplInterface::GetDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm) const
77934{
77935 return mImpl->GetDeviceStateDependentByte(aRv, aRealm);
77936}
77937
77938int8_t
77939TestJSImplInterface::ReturnByteSideEffectFree(ErrorResult& aRv, JS::Realm* aRealm)
77940{
77941 return mImpl->ReturnByteSideEffectFree(aRv, aRealm);
77942}
77943
77944int8_t
77945TestJSImplInterface::ReturnDOMDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
77946{
77947 return mImpl->ReturnDOMDependentByte(aRv, aRealm);
77948}
77949
77950int8_t
77951TestJSImplInterface::ReturnConstantByte(ErrorResult& aRv, JS::Realm* aRealm)
77952{
77953 return mImpl->ReturnConstantByte(aRv, aRealm);
77954}
77955
77956int8_t
77957TestJSImplInterface::ReturnDeviceStateDependentByte(ErrorResult& aRv, JS::Realm* aRealm)
77958{
77959 return mImpl->ReturnDeviceStateDependentByte(aRv, aRealm);
77960}
77961
77962int16_t
77963TestJSImplInterface::GetReadonlyShort(ErrorResult& aRv, JS::Realm* aRealm) const
77964{
77965 return mImpl->GetReadonlyShort(aRv, aRealm);
77966}
77967
77968int16_t
77969TestJSImplInterface::GetWritableShort(ErrorResult& aRv, JS::Realm* aRealm) const
77970{
77971 return mImpl->GetWritableShort(aRv, aRealm);
77972}
77973
77974void
77975TestJSImplInterface::SetWritableShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77976{
77977 mImpl->SetWritableShort(arg, aRv, aRealm);
77978}
77979
77980void
77981TestJSImplInterface::PassShort(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
77982{
77983 return mImpl->PassShort(arg, aRv, aRealm);
77984}
77985
77986int16_t
77987TestJSImplInterface::ReceiveShort(ErrorResult& aRv, JS::Realm* aRealm)
77988{
77989 return mImpl->ReceiveShort(aRv, aRealm);
77990}
77991
77992void
77993TestJSImplInterface::PassOptionalShort(const Optional<int16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
77994{
77995 return mImpl->PassOptionalShort(arg, aRv, aRealm);
77996}
77997
77998void
77999TestJSImplInterface::PassOptionalShortWithDefault(int16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78000{
78001 return mImpl->PassOptionalShortWithDefault(arg, aRv, aRealm);
78002}
78003
78004int32_t
78005TestJSImplInterface::GetReadonlyLong(ErrorResult& aRv, JS::Realm* aRealm) const
78006{
78007 return mImpl->GetReadonlyLong(aRv, aRealm);
78008}
78009
78010int32_t
78011TestJSImplInterface::GetWritableLong(ErrorResult& aRv, JS::Realm* aRealm) const
78012{
78013 return mImpl->GetWritableLong(aRv, aRealm);
78014}
78015
78016void
78017TestJSImplInterface::SetWritableLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78018{
78019 mImpl->SetWritableLong(arg, aRv, aRealm);
78020}
78021
78022void
78023TestJSImplInterface::PassLong(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78024{
78025 return mImpl->PassLong(arg, aRv, aRealm);
78026}
78027
78028int32_t
78029TestJSImplInterface::ReceiveLong(ErrorResult& aRv, JS::Realm* aRealm)
78030{
78031 return mImpl->ReceiveLong(aRv, aRealm);
78032}
78033
78034void
78035TestJSImplInterface::PassOptionalLong(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78036{
78037 return mImpl->PassOptionalLong(arg, aRv, aRealm);
78038}
78039
78040void
78041TestJSImplInterface::PassOptionalLongWithDefault(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78042{
78043 return mImpl->PassOptionalLongWithDefault(arg, aRv, aRealm);
78044}
78045
78046int64_t
78047TestJSImplInterface::GetReadonlyLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78048{
78049 return mImpl->GetReadonlyLongLong(aRv, aRealm);
78050}
78051
78052int64_t
78053TestJSImplInterface::GetWritableLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78054{
78055 return mImpl->GetWritableLongLong(aRv, aRealm);
78056}
78057
78058void
78059TestJSImplInterface::SetWritableLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78060{
78061 mImpl->SetWritableLongLong(arg, aRv, aRealm);
78062}
78063
78064void
78065TestJSImplInterface::PassLongLong(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78066{
78067 return mImpl->PassLongLong(arg, aRv, aRealm);
78068}
78069
78070int64_t
78071TestJSImplInterface::ReceiveLongLong(ErrorResult& aRv, JS::Realm* aRealm)
78072{
78073 return mImpl->ReceiveLongLong(aRv, aRealm);
78074}
78075
78076void
78077TestJSImplInterface::PassOptionalLongLong(const Optional<int64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78078{
78079 return mImpl->PassOptionalLongLong(arg, aRv, aRealm);
78080}
78081
78082void
78083TestJSImplInterface::PassOptionalLongLongWithDefault(int64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78084{
78085 return mImpl->PassOptionalLongLongWithDefault(arg, aRv, aRealm);
78086}
78087
78088uint8_t
78089TestJSImplInterface::GetReadonlyOctet(ErrorResult& aRv, JS::Realm* aRealm) const
78090{
78091 return mImpl->GetReadonlyOctet(aRv, aRealm);
78092}
78093
78094uint8_t
78095TestJSImplInterface::GetWritableOctet(ErrorResult& aRv, JS::Realm* aRealm) const
78096{
78097 return mImpl->GetWritableOctet(aRv, aRealm);
78098}
78099
78100void
78101TestJSImplInterface::SetWritableOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78102{
78103 mImpl->SetWritableOctet(arg, aRv, aRealm);
78104}
78105
78106void
78107TestJSImplInterface::PassOctet(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78108{
78109 return mImpl->PassOctet(arg, aRv, aRealm);
78110}
78111
78112uint8_t
78113TestJSImplInterface::ReceiveOctet(ErrorResult& aRv, JS::Realm* aRealm)
78114{
78115 return mImpl->ReceiveOctet(aRv, aRealm);
78116}
78117
78118void
78119TestJSImplInterface::PassOptionalOctet(const Optional<uint8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78120{
78121 return mImpl->PassOptionalOctet(arg, aRv, aRealm);
78122}
78123
78124void
78125TestJSImplInterface::PassOptionalOctetWithDefault(uint8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78126{
78127 return mImpl->PassOptionalOctetWithDefault(arg, aRv, aRealm);
78128}
78129
78130uint16_t
78131TestJSImplInterface::GetReadonlyUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const
78132{
78133 return mImpl->GetReadonlyUnsignedShort(aRv, aRealm);
78134}
78135
78136uint16_t
78137TestJSImplInterface::GetWritableUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm) const
78138{
78139 return mImpl->GetWritableUnsignedShort(aRv, aRealm);
78140}
78141
78142void
78143TestJSImplInterface::SetWritableUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78144{
78145 mImpl->SetWritableUnsignedShort(arg, aRv, aRealm);
78146}
78147
78148void
78149TestJSImplInterface::PassUnsignedShort(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78150{
78151 return mImpl->PassUnsignedShort(arg, aRv, aRealm);
78152}
78153
78154uint16_t
78155TestJSImplInterface::ReceiveUnsignedShort(ErrorResult& aRv, JS::Realm* aRealm)
78156{
78157 return mImpl->ReceiveUnsignedShort(aRv, aRealm);
78158}
78159
78160void
78161TestJSImplInterface::PassOptionalUnsignedShort(const Optional<uint16_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78162{
78163 return mImpl->PassOptionalUnsignedShort(arg, aRv, aRealm);
78164}
78165
78166void
78167TestJSImplInterface::PassOptionalUnsignedShortWithDefault(uint16_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78168{
78169 return mImpl->PassOptionalUnsignedShortWithDefault(arg, aRv, aRealm);
78170}
78171
78172uint32_t
78173TestJSImplInterface::GetReadonlyUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const
78174{
78175 return mImpl->GetReadonlyUnsignedLong(aRv, aRealm);
78176}
78177
78178uint32_t
78179TestJSImplInterface::GetWritableUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm) const
78180{
78181 return mImpl->GetWritableUnsignedLong(aRv, aRealm);
78182}
78183
78184void
78185TestJSImplInterface::SetWritableUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78186{
78187 mImpl->SetWritableUnsignedLong(arg, aRv, aRealm);
78188}
78189
78190void
78191TestJSImplInterface::PassUnsignedLong(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78192{
78193 return mImpl->PassUnsignedLong(arg, aRv, aRealm);
78194}
78195
78196uint32_t
78197TestJSImplInterface::ReceiveUnsignedLong(ErrorResult& aRv, JS::Realm* aRealm)
78198{
78199 return mImpl->ReceiveUnsignedLong(aRv, aRealm);
78200}
78201
78202void
78203TestJSImplInterface::PassOptionalUnsignedLong(const Optional<uint32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78204{
78205 return mImpl->PassOptionalUnsignedLong(arg, aRv, aRealm);
78206}
78207
78208void
78209TestJSImplInterface::PassOptionalUnsignedLongWithDefault(uint32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78210{
78211 return mImpl->PassOptionalUnsignedLongWithDefault(arg, aRv, aRealm);
78212}
78213
78214uint64_t
78215TestJSImplInterface::GetReadonlyUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78216{
78217 return mImpl->GetReadonlyUnsignedLongLong(aRv, aRealm);
78218}
78219
78220uint64_t
78221TestJSImplInterface::GetWritableUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm) const
78222{
78223 return mImpl->GetWritableUnsignedLongLong(aRv, aRealm);
78224}
78225
78226void
78227TestJSImplInterface::SetWritableUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78228{
78229 mImpl->SetWritableUnsignedLongLong(arg, aRv, aRealm);
78230}
78231
78232void
78233TestJSImplInterface::PassUnsignedLongLong(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78234{
78235 return mImpl->PassUnsignedLongLong(arg, aRv, aRealm);
78236}
78237
78238uint64_t
78239TestJSImplInterface::ReceiveUnsignedLongLong(ErrorResult& aRv, JS::Realm* aRealm)
78240{
78241 return mImpl->ReceiveUnsignedLongLong(aRv, aRealm);
78242}
78243
78244void
78245TestJSImplInterface::PassOptionalUnsignedLongLong(const Optional<uint64_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78246{
78247 return mImpl->PassOptionalUnsignedLongLong(arg, aRv, aRealm);
78248}
78249
78250void
78251TestJSImplInterface::PassOptionalUnsignedLongLongWithDefault(uint64_t arg, ErrorResult& aRv, JS::Realm* aRealm)
78252{
78253 return mImpl->PassOptionalUnsignedLongLongWithDefault(arg, aRv, aRealm);
78254}
78255
78256float
78257TestJSImplInterface::GetWritableFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78258{
78259 return mImpl->GetWritableFloat(aRv, aRealm);
78260}
78261
78262void
78263TestJSImplInterface::SetWritableFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78264{
78265 mImpl->SetWritableFloat(arg, aRv, aRealm);
78266}
78267
78268float
78269TestJSImplInterface::GetWritableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78270{
78271 return mImpl->GetWritableUnrestrictedFloat(aRv, aRealm);
78272}
78273
78274void
78275TestJSImplInterface::SetWritableUnrestrictedFloat(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78276{
78277 mImpl->SetWritableUnrestrictedFloat(arg, aRv, aRealm);
78278}
78279
78280Nullable<float>
78281TestJSImplInterface::GetWritableNullableFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78282{
78283 return mImpl->GetWritableNullableFloat(aRv, aRealm);
78284}
78285
78286void
78287TestJSImplInterface::SetWritableNullableFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78288{
78289 mImpl->SetWritableNullableFloat(arg, aRv, aRealm);
78290}
78291
78292Nullable<float>
78293TestJSImplInterface::GetWritableNullableUnrestrictedFloat(ErrorResult& aRv, JS::Realm* aRealm) const
78294{
78295 return mImpl->GetWritableNullableUnrestrictedFloat(aRv, aRealm);
78296}
78297
78298void
78299TestJSImplInterface::SetWritableNullableUnrestrictedFloat(const Nullable<float>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78300{
78301 mImpl->SetWritableNullableUnrestrictedFloat(arg, aRv, aRealm);
78302}
78303
78304double
78305TestJSImplInterface::GetWritableDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78306{
78307 return mImpl->GetWritableDouble(aRv, aRealm);
78308}
78309
78310void
78311TestJSImplInterface::SetWritableDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78312{
78313 mImpl->SetWritableDouble(arg, aRv, aRealm);
78314}
78315
78316double
78317TestJSImplInterface::GetWritableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78318{
78319 return mImpl->GetWritableUnrestrictedDouble(aRv, aRealm);
78320}
78321
78322void
78323TestJSImplInterface::SetWritableUnrestrictedDouble(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78324{
78325 mImpl->SetWritableUnrestrictedDouble(arg, aRv, aRealm);
78326}
78327
78328Nullable<double>
78329TestJSImplInterface::GetWritableNullableDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78330{
78331 return mImpl->GetWritableNullableDouble(aRv, aRealm);
78332}
78333
78334void
78335TestJSImplInterface::SetWritableNullableDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78336{
78337 mImpl->SetWritableNullableDouble(arg, aRv, aRealm);
78338}
78339
78340Nullable<double>
78341TestJSImplInterface::GetWritableNullableUnrestrictedDouble(ErrorResult& aRv, JS::Realm* aRealm) const
78342{
78343 return mImpl->GetWritableNullableUnrestrictedDouble(aRv, aRealm);
78344}
78345
78346void
78347TestJSImplInterface::SetWritableNullableUnrestrictedDouble(const Nullable<double>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78348{
78349 mImpl->SetWritableNullableUnrestrictedDouble(arg, aRv, aRealm);
78350}
78351
78352void
78353TestJSImplInterface::PassFloat(float arg1, float arg2, const Nullable<float>& arg3, const Nullable<float>& arg4, double arg5, double arg6, const Nullable<double>& arg7, const Nullable<double>& arg8, const Sequence<float>& arg9, const Sequence<float>& arg10, const Sequence<Nullable<float>>& arg11, const Sequence<Nullable<float>>& arg12, const Sequence<double>& arg13, const Sequence<double>& arg14, const Sequence<Nullable<double>>& arg15, const Sequence<Nullable<double>>& arg16, ErrorResult& aRv, JS::Realm* aRealm)
78354{
78355 return mImpl->PassFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm);
78356}
78357
78358void
78359TestJSImplInterface::PassLenientFloat(float arg1, float arg2, const Nullable<float>& arg3, const Nullable<float>& arg4, double arg5, double arg6, const Nullable<double>& arg7, const Nullable<double>& arg8, const Sequence<float>& arg9, const Sequence<float>& arg10, const Sequence<Nullable<float>>& arg11, const Sequence<Nullable<float>>& arg12, const Sequence<double>& arg13, const Sequence<double>& arg14, const Sequence<Nullable<double>>& arg15, const Sequence<Nullable<double>>& arg16, ErrorResult& aRv, JS::Realm* aRealm)
78360{
78361 return mImpl->PassLenientFloat(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14, arg15, arg16, aRv, aRealm);
78362}
78363
78364float
78365TestJSImplInterface::GetLenientFloatAttr(ErrorResult& aRv, JS::Realm* aRealm) const
78366{
78367 return mImpl->GetLenientFloatAttr(aRv, aRealm);
78368}
78369
78370void
78371TestJSImplInterface::SetLenientFloatAttr(float arg, ErrorResult& aRv, JS::Realm* aRealm)
78372{
78373 mImpl->SetLenientFloatAttr(arg, aRv, aRealm);
78374}
78375
78376double
78377TestJSImplInterface::GetLenientDoubleAttr(ErrorResult& aRv, JS::Realm* aRealm) const
78378{
78379 return mImpl->GetLenientDoubleAttr(aRv, aRealm);
78380}
78381
78382void
78383TestJSImplInterface::SetLenientDoubleAttr(double arg, ErrorResult& aRv, JS::Realm* aRealm)
78384{
78385 mImpl->SetLenientDoubleAttr(arg, aRv, aRealm);
78386}
78387
78388// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78389already_AddRefed<TestJSImplInterface>
78390TestJSImplInterface::ReceiveSelf(ErrorResult& aRv, JS::Realm* aRealm)
78391{
78392 return mImpl->ReceiveSelf(aRv, aRealm);
78393}
78394
78395// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78396already_AddRefed<TestJSImplInterface>
78397TestJSImplInterface::ReceiveNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
78398{
78399 return mImpl->ReceiveNullableSelf(aRv, aRealm);
78400}
78401
78402// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78403already_AddRefed<TestJSImplInterface>
78404TestJSImplInterface::ReceiveWeakSelf(ErrorResult& aRv, JS::Realm* aRealm)
78405{
78406 return mImpl->ReceiveWeakSelf(aRv, aRealm);
78407}
78408
78409// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78410already_AddRefed<TestJSImplInterface>
78411TestJSImplInterface::ReceiveWeakNullableSelf(ErrorResult& aRv, JS::Realm* aRealm)
78412{
78413 return mImpl->ReceiveWeakNullableSelf(aRv, aRealm);
78414}
78415
78416void
78417TestJSImplInterface::PassSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78418{
78419 return mImpl->PassSelf(arg, aRv, aRealm);
78420}
78421
78422void
78423TestJSImplInterface::PassNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78424{
78425 return mImpl->PassNullableSelf(arg, aRv, aRealm);
78426}
78427
78428// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78429already_AddRefed<TestJSImplInterface>
78430TestJSImplInterface::GetNonNullSelf(ErrorResult& aRv, JS::Realm* aRealm) const
78431{
78432 return mImpl->GetNonNullSelf(aRv, aRealm);
78433}
78434
78435void
78436TestJSImplInterface::SetNonNullSelf(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78437{
78438 mImpl->SetNonNullSelf(arg, aRv, aRealm);
78439}
78440
78441// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78442already_AddRefed<TestJSImplInterface>
78443TestJSImplInterface::GetNullableSelf(ErrorResult& aRv, JS::Realm* aRealm) const
78444{
78445 return mImpl->GetNullableSelf(aRv, aRealm);
78446}
78447
78448void
78449TestJSImplInterface::SetNullableSelf(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78450{
78451 mImpl->SetNullableSelf(arg, aRv, aRealm);
78452}
78453
78454void
78455TestJSImplInterface::PassOptionalSelf(const Optional<TestJSImplInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78456{
78457 return mImpl->PassOptionalSelf(arg, aRv, aRealm);
78458}
78459
78460void
78461TestJSImplInterface::PassOptionalNonNullSelf(const Optional<NonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78462{
78463 return mImpl->PassOptionalNonNullSelf(arg, aRv, aRealm);
78464}
78465
78466void
78467TestJSImplInterface::PassOptionalSelfWithDefault(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78468{
78469 return mImpl->PassOptionalSelfWithDefault(arg, aRv, aRealm);
78470}
78471
78472already_AddRefed<TestNonWrapperCacheInterface>
78473TestJSImplInterface::ReceiveNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
78474{
78475 return mImpl->ReceiveNonWrapperCacheInterface(aRv, aRealm);
78476}
78477
78478already_AddRefed<TestNonWrapperCacheInterface>
78479TestJSImplInterface::ReceiveNullableNonWrapperCacheInterface(ErrorResult& aRv, JS::Realm* aRealm)
78480{
78481 return mImpl->ReceiveNullableNonWrapperCacheInterface(aRv, aRealm);
78482}
78483
78484void
78485TestJSImplInterface::ReceiveNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78486{
78487 return mImpl->ReceiveNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm);
78488}
78489
78490void
78491TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceSequence(nsTArray<RefPtr<TestNonWrapperCacheInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78492{
78493 return mImpl->ReceiveNullableNonWrapperCacheInterfaceSequence(aRetVal, aRv, aRealm);
78494}
78495
78496void
78497TestJSImplInterface::ReceiveNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78498{
78499 return mImpl->ReceiveNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm);
78500}
78501
78502void
78503TestJSImplInterface::ReceiveNullableNonWrapperCacheInterfaceNullableSequence(Nullable<nsTArray<RefPtr<TestNonWrapperCacheInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78504{
78505 return mImpl->ReceiveNullableNonWrapperCacheInterfaceNullableSequence(aRetVal, aRv, aRealm);
78506}
78507
78508// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78509already_AddRefed<TestExternalInterface>
78510TestJSImplInterface::ReceiveExternal(ErrorResult& aRv, JS::Realm* aRealm)
78511{
78512 return mImpl->ReceiveExternal(aRv, aRealm);
78513}
78514
78515// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78516already_AddRefed<TestExternalInterface>
78517TestJSImplInterface::ReceiveNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
78518{
78519 return mImpl->ReceiveNullableExternal(aRv, aRealm);
78520}
78521
78522// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78523already_AddRefed<TestExternalInterface>
78524TestJSImplInterface::ReceiveWeakExternal(ErrorResult& aRv, JS::Realm* aRealm)
78525{
78526 return mImpl->ReceiveWeakExternal(aRv, aRealm);
78527}
78528
78529// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78530already_AddRefed<TestExternalInterface>
78531TestJSImplInterface::ReceiveWeakNullableExternal(ErrorResult& aRv, JS::Realm* aRealm)
78532{
78533 return mImpl->ReceiveWeakNullableExternal(aRv, aRealm);
78534}
78535
78536void
78537TestJSImplInterface::PassExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78538{
78539 return mImpl->PassExternal(arg, aRv, aRealm);
78540}
78541
78542void
78543TestJSImplInterface::PassNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78544{
78545 return mImpl->PassNullableExternal(arg, aRv, aRealm);
78546}
78547
78548// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78549already_AddRefed<TestExternalInterface>
78550TestJSImplInterface::GetNonNullExternal(ErrorResult& aRv, JS::Realm* aRealm) const
78551{
78552 return mImpl->GetNonNullExternal(aRv, aRealm);
78553}
78554
78555void
78556TestJSImplInterface::SetNonNullExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78557{
78558 mImpl->SetNonNullExternal(arg, aRv, aRealm);
78559}
78560
78561// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78562already_AddRefed<TestExternalInterface>
78563TestJSImplInterface::GetNullableExternal(ErrorResult& aRv, JS::Realm* aRealm) const
78564{
78565 return mImpl->GetNullableExternal(aRv, aRealm);
78566}
78567
78568void
78569TestJSImplInterface::SetNullableExternal(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78570{
78571 mImpl->SetNullableExternal(arg, aRv, aRealm);
78572}
78573
78574void
78575TestJSImplInterface::PassOptionalExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78576{
78577 return mImpl->PassOptionalExternal(arg, aRv, aRealm);
78578}
78579
78580void
78581TestJSImplInterface::PassOptionalNonNullExternal(const Optional<TestExternalInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78582{
78583 return mImpl->PassOptionalNonNullExternal(arg, aRv, aRealm);
78584}
78585
78586void
78587TestJSImplInterface::PassOptionalExternalWithDefault(TestExternalInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78588{
78589 return mImpl->PassOptionalExternalWithDefault(arg, aRv, aRealm);
78590}
78591
78592// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78593already_AddRefed<TestCallbackInterface>
78594TestJSImplInterface::ReceiveCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78595{
78596 return mImpl->ReceiveCallbackInterface(aRv, aRealm);
78597}
78598
78599// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78600already_AddRefed<TestCallbackInterface>
78601TestJSImplInterface::ReceiveNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78602{
78603 return mImpl->ReceiveNullableCallbackInterface(aRv, aRealm);
78604}
78605
78606// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78607already_AddRefed<TestCallbackInterface>
78608TestJSImplInterface::ReceiveWeakCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78609{
78610 return mImpl->ReceiveWeakCallbackInterface(aRv, aRealm);
78611}
78612
78613// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78614already_AddRefed<TestCallbackInterface>
78615TestJSImplInterface::ReceiveWeakNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm)
78616{
78617 return mImpl->ReceiveWeakNullableCallbackInterface(aRv, aRealm);
78618}
78619
78620void
78621TestJSImplInterface::PassCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78622{
78623 return mImpl->PassCallbackInterface(arg, aRv, aRealm);
78624}
78625
78626void
78627TestJSImplInterface::PassNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78628{
78629 return mImpl->PassNullableCallbackInterface(arg, aRv, aRealm);
78630}
78631
78632// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78633already_AddRefed<TestCallbackInterface>
78634TestJSImplInterface::GetNonNullCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const
78635{
78636 return mImpl->GetNonNullCallbackInterface(aRv, aRealm);
78637}
78638
78639void
78640TestJSImplInterface::SetNonNullCallbackInterface(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
78641{
78642 mImpl->SetNonNullCallbackInterface(arg, aRv, aRealm);
78643}
78644
78645// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
78646already_AddRefed<TestCallbackInterface>
78647TestJSImplInterface::GetNullableCallbackInterface(ErrorResult& aRv, JS::Realm* aRealm) const
78648{
78649 return mImpl->GetNullableCallbackInterface(aRv, aRealm);
78650}
78651
78652void
78653TestJSImplInterface::SetNullableCallbackInterface(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78654{
78655 mImpl->SetNullableCallbackInterface(arg, aRv, aRealm);
78656}
78657
78658void
78659TestJSImplInterface::PassOptionalCallbackInterface(const Optional<RefPtr<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78660{
78661 return mImpl->PassOptionalCallbackInterface(arg, aRv, aRealm);
78662}
78663
78664void
78665TestJSImplInterface::PassOptionalNonNullCallbackInterface(const Optional<OwningNonNull<TestCallbackInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78666{
78667 return mImpl->PassOptionalNonNullCallbackInterface(arg, aRv, aRealm);
78668}
78669
78670void
78671TestJSImplInterface::PassOptionalCallbackInterfaceWithDefault(TestCallbackInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
78672{
78673 return mImpl->PassOptionalCallbackInterfaceWithDefault(arg, aRv, aRealm);
78674}
78675
78676void
78677TestJSImplInterface::ReceiveSequence(nsTArray<int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78678{
78679 return mImpl->ReceiveSequence(aRetVal, aRv, aRealm);
78680}
78681
78682void
78683TestJSImplInterface::ReceiveNullableSequence(Nullable<nsTArray<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78684{
78685 return mImpl->ReceiveNullableSequence(aRetVal, aRv, aRealm);
78686}
78687
78688void
78689TestJSImplInterface::ReceiveSequenceOfNullableInts(nsTArray<Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78690{
78691 return mImpl->ReceiveSequenceOfNullableInts(aRetVal, aRv, aRealm);
78692}
78693
78694void
78695TestJSImplInterface::ReceiveNullableSequenceOfNullableInts(Nullable<nsTArray<Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78696{
78697 return mImpl->ReceiveNullableSequenceOfNullableInts(aRetVal, aRv, aRealm);
78698}
78699
78700void
78701TestJSImplInterface::PassSequence(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78702{
78703 return mImpl->PassSequence(arg, aRv, aRealm);
78704}
78705
78706void
78707TestJSImplInterface::PassNullableSequence(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78708{
78709 return mImpl->PassNullableSequence(arg, aRv, aRealm);
78710}
78711
78712void
78713TestJSImplInterface::PassSequenceOfNullableInts(const Sequence<Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78714{
78715 return mImpl->PassSequenceOfNullableInts(arg, aRv, aRealm);
78716}
78717
78718void
78719TestJSImplInterface::PassOptionalSequenceOfNullableInts(const Optional<Sequence<Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78720{
78721 return mImpl->PassOptionalSequenceOfNullableInts(arg, aRv, aRealm);
78722}
78723
78724void
78725TestJSImplInterface::PassOptionalNullableSequenceOfNullableInts(const Optional<Nullable<Sequence<Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78726{
78727 return mImpl->PassOptionalNullableSequenceOfNullableInts(arg, aRv, aRealm);
78728}
78729
78730void
78731TestJSImplInterface::ReceiveCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78732{
78733 return mImpl->ReceiveCastableObjectSequence(aRetVal, aRv, aRealm);
78734}
78735
78736void
78737TestJSImplInterface::ReceiveCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78738{
78739 return mImpl->ReceiveCallbackObjectSequence(aRetVal, aRv, aRealm);
78740}
78741
78742void
78743TestJSImplInterface::ReceiveNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78744{
78745 return mImpl->ReceiveNullableCastableObjectSequence(aRetVal, aRv, aRealm);
78746}
78747
78748void
78749TestJSImplInterface::ReceiveNullableCallbackObjectSequence(nsTArray<RefPtr<TestCallbackInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78750{
78751 return mImpl->ReceiveNullableCallbackObjectSequence(aRetVal, aRv, aRealm);
78752}
78753
78754void
78755TestJSImplInterface::ReceiveCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78756{
78757 return mImpl->ReceiveCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78758}
78759
78760void
78761TestJSImplInterface::ReceiveNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78762{
78763 return mImpl->ReceiveNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78764}
78765
78766void
78767TestJSImplInterface::ReceiveWeakCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78768{
78769 return mImpl->ReceiveWeakCastableObjectSequence(aRetVal, aRv, aRealm);
78770}
78771
78772void
78773TestJSImplInterface::ReceiveWeakNullableCastableObjectSequence(nsTArray<RefPtr<TestJSImplInterface>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78774{
78775 return mImpl->ReceiveWeakNullableCastableObjectSequence(aRetVal, aRv, aRealm);
78776}
78777
78778void
78779TestJSImplInterface::ReceiveWeakCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78780{
78781 return mImpl->ReceiveWeakCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78782}
78783
78784void
78785TestJSImplInterface::ReceiveWeakNullableCastableObjectNullableSequence(Nullable<nsTArray<RefPtr<TestJSImplInterface>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78786{
78787 return mImpl->ReceiveWeakNullableCastableObjectNullableSequence(aRetVal, aRv, aRealm);
78788}
78789
78790void
78791TestJSImplInterface::PassCastableObjectSequence(const Sequence<OwningNonNull<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78792{
78793 return mImpl->PassCastableObjectSequence(arg, aRv, aRealm);
78794}
78795
78796void
78797TestJSImplInterface::PassNullableCastableObjectSequence(const Sequence<RefPtr<TestJSImplInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78798{
78799 return mImpl->PassNullableCastableObjectSequence(arg, aRv, aRealm);
78800}
78801
78802void
78803TestJSImplInterface::PassCastableObjectNullableSequence(const Nullable<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78804{
78805 return mImpl->PassCastableObjectNullableSequence(arg, aRv, aRealm);
78806}
78807
78808void
78809TestJSImplInterface::PassNullableCastableObjectNullableSequence(const Nullable<Sequence<RefPtr<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78810{
78811 return mImpl->PassNullableCastableObjectNullableSequence(arg, aRv, aRealm);
78812}
78813
78814void
78815TestJSImplInterface::PassOptionalSequence(const Optional<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78816{
78817 return mImpl->PassOptionalSequence(arg, aRv, aRealm);
78818}
78819
78820void
78821TestJSImplInterface::PassOptionalSequenceWithDefaultValue(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78822{
78823 return mImpl->PassOptionalSequenceWithDefaultValue(arg, aRv, aRealm);
78824}
78825
78826void
78827TestJSImplInterface::PassOptionalNullableSequence(const Optional<Nullable<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78828{
78829 return mImpl->PassOptionalNullableSequence(arg, aRv, aRealm);
78830}
78831
78832void
78833TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78834{
78835 return mImpl->PassOptionalNullableSequenceWithDefaultValue(arg, aRv, aRealm);
78836}
78837
78838void
78839TestJSImplInterface::PassOptionalNullableSequenceWithDefaultValue2(const Nullable<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78840{
78841 return mImpl->PassOptionalNullableSequenceWithDefaultValue2(arg, aRv, aRealm);
78842}
78843
78844void
78845TestJSImplInterface::PassOptionalObjectSequence(const Optional<Sequence<OwningNonNull<TestJSImplInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78846{
78847 return mImpl->PassOptionalObjectSequence(arg, aRv, aRealm);
78848}
78849
78850void
78851TestJSImplInterface::PassExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78852{
78853 return mImpl->PassExternalInterfaceSequence(arg, aRv, aRealm);
78854}
78855
78856void
78857TestJSImplInterface::PassNullableExternalInterfaceSequence(const Sequence<RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78858{
78859 return mImpl->PassNullableExternalInterfaceSequence(arg, aRv, aRealm);
78860}
78861
78862void
78863TestJSImplInterface::ReceiveStringSequence(nsTArray<nsString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78864{
78865 return mImpl->ReceiveStringSequence(aRetVal, aRv, aRealm);
78866}
78867
78868void
78869TestJSImplInterface::ReceiveByteStringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78870{
78871 return mImpl->ReceiveByteStringSequence(aRetVal, aRv, aRealm);
78872}
78873
78874void
78875TestJSImplInterface::ReceiveUTF8StringSequence(nsTArray<nsCString>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78876{
78877 return mImpl->ReceiveUTF8StringSequence(aRetVal, aRv, aRealm);
78878}
78879
78880void
78881TestJSImplInterface::ReceiveAnySequence(nsTArray<JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78882{
78883 return mImpl->ReceiveAnySequence(aRetVal, aRv, aRealm);
78884}
78885
78886void
78887TestJSImplInterface::ReceiveNullableAnySequence(Nullable<nsTArray<JS::Value>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78888{
78889 return mImpl->ReceiveNullableAnySequence(aRetVal, aRv, aRealm);
78890}
78891
78892void
78893TestJSImplInterface::ReceiveObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78894{
78895 return mImpl->ReceiveObjectSequence(aRetVal, aRv, aRealm);
78896}
78897
78898void
78899TestJSImplInterface::ReceiveNullableObjectSequence(nsTArray<JSObject*>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
78900{
78901 return mImpl->ReceiveNullableObjectSequence(aRetVal, aRv, aRealm);
78902}
78903
78904void
78905TestJSImplInterface::PassSequenceOfSequences(const Sequence<Sequence<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78906{
78907 return mImpl->PassSequenceOfSequences(arg, aRv, aRealm);
78908}
78909
78910void
78911TestJSImplInterface::PassSequenceOfSequencesOfSequences(const Sequence<Sequence<Sequence<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78912{
78913 return mImpl->PassSequenceOfSequencesOfSequences(arg, aRv, aRealm);
78914}
78915
78916void
78917TestJSImplInterface::PassRecord(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78918{
78919 return mImpl->PassRecord(arg, aRv, aRealm);
78920}
78921
78922void
78923TestJSImplInterface::PassNullableRecord(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78924{
78925 return mImpl->PassNullableRecord(arg, aRv, aRealm);
78926}
78927
78928void
78929TestJSImplInterface::PassRecordOfNullableInts(const Record<nsString, Nullable<int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78930{
78931 return mImpl->PassRecordOfNullableInts(arg, aRv, aRealm);
78932}
78933
78934void
78935TestJSImplInterface::PassOptionalRecordOfNullableInts(const Optional<Record<nsString, Nullable<int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78936{
78937 return mImpl->PassOptionalRecordOfNullableInts(arg, aRv, aRealm);
78938}
78939
78940void
78941TestJSImplInterface::PassOptionalNullableRecordOfNullableInts(const Optional<Nullable<Record<nsString, Nullable<int32_t>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78942{
78943 return mImpl->PassOptionalNullableRecordOfNullableInts(arg, aRv, aRealm);
78944}
78945
78946void
78947TestJSImplInterface::PassCastableObjectRecord(const Record<nsString, OwningNonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78948{
78949 return mImpl->PassCastableObjectRecord(arg, aRv, aRealm);
78950}
78951
78952void
78953TestJSImplInterface::PassNullableCastableObjectRecord(const Record<nsString, RefPtr<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78954{
78955 return mImpl->PassNullableCastableObjectRecord(arg, aRv, aRealm);
78956}
78957
78958void
78959TestJSImplInterface::PassCastableObjectNullableRecord(const Nullable<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78960{
78961 return mImpl->PassCastableObjectNullableRecord(arg, aRv, aRealm);
78962}
78963
78964void
78965TestJSImplInterface::PassNullableCastableObjectNullableRecord(const Nullable<Record<nsString, RefPtr<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78966{
78967 return mImpl->PassNullableCastableObjectNullableRecord(arg, aRv, aRealm);
78968}
78969
78970void
78971TestJSImplInterface::PassOptionalRecord(const Optional<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78972{
78973 return mImpl->PassOptionalRecord(arg, aRv, aRealm);
78974}
78975
78976void
78977TestJSImplInterface::PassOptionalNullableRecord(const Optional<Nullable<Record<nsString, int32_t>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78978{
78979 return mImpl->PassOptionalNullableRecord(arg, aRv, aRealm);
78980}
78981
78982void
78983TestJSImplInterface::PassOptionalNullableRecordWithDefaultValue(const Nullable<Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78984{
78985 return mImpl->PassOptionalNullableRecordWithDefaultValue(arg, aRv, aRealm);
78986}
78987
78988void
78989TestJSImplInterface::PassOptionalObjectRecord(const Optional<Record<nsString, OwningNonNull<TestInterface>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78990{
78991 return mImpl->PassOptionalObjectRecord(arg, aRv, aRealm);
78992}
78993
78994void
78995TestJSImplInterface::PassExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
78996{
78997 return mImpl->PassExternalInterfaceRecord(arg, aRv, aRealm);
78998}
78999
79000void
79001TestJSImplInterface::PassNullableExternalInterfaceRecord(const Record<nsString, RefPtr<TestExternalInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79002{
79003 return mImpl->PassNullableExternalInterfaceRecord(arg, aRv, aRealm);
79004}
79005
79006void
79007TestJSImplInterface::PassStringRecord(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79008{
79009 return mImpl->PassStringRecord(arg, aRv, aRealm);
79010}
79011
79012void
79013TestJSImplInterface::PassByteStringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79014{
79015 return mImpl->PassByteStringRecord(arg, aRv, aRealm);
79016}
79017
79018void
79019TestJSImplInterface::PassUTF8StringRecord(const Record<nsString, nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79020{
79021 return mImpl->PassUTF8StringRecord(arg, aRv, aRealm);
79022}
79023
79024void
79025TestJSImplInterface::PassRecordOfRecords(const Record<nsString, Record<nsString, int32_t>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79026{
79027 return mImpl->PassRecordOfRecords(arg, aRv, aRealm);
79028}
79029
79030void
79031TestJSImplInterface::ReceiveRecord(Record<nsString, int32_t>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79032{
79033 return mImpl->ReceiveRecord(aRetVal, aRv, aRealm);
79034}
79035
79036void
79037TestJSImplInterface::ReceiveNullableRecord(Nullable<Record<nsString, int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79038{
79039 return mImpl->ReceiveNullableRecord(aRetVal, aRv, aRealm);
79040}
79041
79042void
79043TestJSImplInterface::ReceiveRecordOfNullableInts(Record<nsString, Nullable<int32_t>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79044{
79045 return mImpl->ReceiveRecordOfNullableInts(aRetVal, aRv, aRealm);
79046}
79047
79048void
79049TestJSImplInterface::ReceiveNullableRecordOfNullableInts(Nullable<Record<nsString, Nullable<int32_t>>>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79050{
79051 return mImpl->ReceiveNullableRecordOfNullableInts(aRetVal, aRv, aRealm);
79052}
79053
79054void
79055TestJSImplInterface::ReceiveAnyRecord(Record<nsString, JS::Value>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79056{
79057 return mImpl->ReceiveAnyRecord(aRetVal, aRv, aRealm);
79058}
79059
79060void
79061TestJSImplInterface::PassArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
79062{
79063 return mImpl->PassArrayBuffer(arg, aRv, aRealm);
79064}
79065
79066void
79067TestJSImplInterface::PassNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79068{
79069 return mImpl->PassNullableArrayBuffer(arg, aRv, aRealm);
79070}
79071
79072void
79073TestJSImplInterface::PassOptionalArrayBuffer(const Optional<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79074{
79075 return mImpl->PassOptionalArrayBuffer(arg, aRv, aRealm);
79076}
79077
79078void
79079TestJSImplInterface::PassOptionalNullableArrayBuffer(const Optional<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79080{
79081 return mImpl->PassOptionalNullableArrayBuffer(arg, aRv, aRealm);
79082}
79083
79084void
79085TestJSImplInterface::PassOptionalNullableArrayBufferWithDefaultValue(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79086{
79087 return mImpl->PassOptionalNullableArrayBufferWithDefaultValue(arg, aRv, aRealm);
79088}
79089
79090void
79091TestJSImplInterface::PassArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
79092{
79093 return mImpl->PassArrayBufferView(arg, aRv, aRealm);
79094}
79095
79096void
79097TestJSImplInterface::PassInt8Array(const Int8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79098{
79099 return mImpl->PassInt8Array(arg, aRv, aRealm);
79100}
79101
79102void
79103TestJSImplInterface::PassInt16Array(const Int16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79104{
79105 return mImpl->PassInt16Array(arg, aRv, aRealm);
79106}
79107
79108void
79109TestJSImplInterface::PassInt32Array(const Int32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79110{
79111 return mImpl->PassInt32Array(arg, aRv, aRealm);
79112}
79113
79114void
79115TestJSImplInterface::PassUint8Array(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79116{
79117 return mImpl->PassUint8Array(arg, aRv, aRealm);
79118}
79119
79120void
79121TestJSImplInterface::PassUint16Array(const Uint16Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79122{
79123 return mImpl->PassUint16Array(arg, aRv, aRealm);
79124}
79125
79126void
79127TestJSImplInterface::PassUint32Array(const Uint32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79128{
79129 return mImpl->PassUint32Array(arg, aRv, aRealm);
79130}
79131
79132void
79133TestJSImplInterface::PassUint8ClampedArray(const Uint8ClampedArray& arg, ErrorResult& aRv, JS::Realm* aRealm)
79134{
79135 return mImpl->PassUint8ClampedArray(arg, aRv, aRealm);
79136}
79137
79138void
79139TestJSImplInterface::PassFloat32Array(const Float32Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79140{
79141 return mImpl->PassFloat32Array(arg, aRv, aRealm);
79142}
79143
79144void
79145TestJSImplInterface::PassFloat64Array(const Float64Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79146{
79147 return mImpl->PassFloat64Array(arg, aRv, aRealm);
79148}
79149
79150void
79151TestJSImplInterface::PassSequenceOfArrayBuffers(const Sequence<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79152{
79153 return mImpl->PassSequenceOfArrayBuffers(arg, aRv, aRealm);
79154}
79155
79156void
79157TestJSImplInterface::PassSequenceOfNullableArrayBuffers(const Sequence<Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79158{
79159 return mImpl->PassSequenceOfNullableArrayBuffers(arg, aRv, aRealm);
79160}
79161
79162void
79163TestJSImplInterface::PassRecordOfArrayBuffers(const Record<nsString, ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79164{
79165 return mImpl->PassRecordOfArrayBuffers(arg, aRv, aRealm);
79166}
79167
79168void
79169TestJSImplInterface::PassRecordOfNullableArrayBuffers(const Record<nsString, Nullable<ArrayBuffer>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79170{
79171 return mImpl->PassRecordOfNullableArrayBuffers(arg, aRv, aRealm);
79172}
79173
79174void
79175TestJSImplInterface::PassVariadicTypedArray(const Sequence<Float32Array>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79176{
79177 return mImpl->PassVariadicTypedArray(arg, aRv, aRealm);
79178}
79179
79180void
79181TestJSImplInterface::PassVariadicNullableTypedArray(const Sequence<Nullable<Float32Array>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79182{
79183 return mImpl->PassVariadicNullableTypedArray(arg, aRv, aRealm);
79184}
79185
79186void
79187TestJSImplInterface::ReceiveUint8Array(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79188{
79189 return mImpl->ReceiveUint8Array(aRetVal, aRv, aRealm);
79190}
79191
79192void
79193TestJSImplInterface::GetUint8ArrayAttr(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79194{
79195 return mImpl->GetUint8ArrayAttr(aRetVal, aRv, aRealm);
79196}
79197
79198void
79199TestJSImplInterface::SetUint8ArrayAttr(const Uint8Array& arg, ErrorResult& aRv, JS::Realm* aRealm)
79200{
79201 mImpl->SetUint8ArrayAttr(arg, aRv, aRealm);
79202}
79203
79204void
79205TestJSImplInterface::PassString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79206{
79207 return mImpl->PassString(arg, aRv, aRealm);
79208}
79209
79210void
79211TestJSImplInterface::PassNullableString(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79212{
79213 return mImpl->PassNullableString(arg, aRv, aRealm);
79214}
79215
79216void
79217TestJSImplInterface::PassOptionalString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79218{
79219 return mImpl->PassOptionalString(arg, aRv, aRealm);
79220}
79221
79222void
79223TestJSImplInterface::PassOptionalStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79224{
79225 return mImpl->PassOptionalStringWithDefaultValue(arg, aRv, aRealm);
79226}
79227
79228void
79229TestJSImplInterface::PassOptionalNullableString(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79230{
79231 return mImpl->PassOptionalNullableString(arg, aRv, aRealm);
79232}
79233
79234void
79235TestJSImplInterface::PassOptionalNullableStringWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79236{
79237 return mImpl->PassOptionalNullableStringWithDefaultValue(arg, aRv, aRealm);
79238}
79239
79240void
79241TestJSImplInterface::PassVariadicString(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79242{
79243 return mImpl->PassVariadicString(arg, aRv, aRealm);
79244}
79245
79246void
79247TestJSImplInterface::PassByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79248{
79249 return mImpl->PassByteString(arg, aRv, aRealm);
79250}
79251
79252void
79253TestJSImplInterface::PassNullableByteString(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79254{
79255 return mImpl->PassNullableByteString(arg, aRv, aRealm);
79256}
79257
79258void
79259TestJSImplInterface::PassOptionalByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79260{
79261 return mImpl->PassOptionalByteString(arg, aRv, aRealm);
79262}
79263
79264void
79265TestJSImplInterface::PassOptionalByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79266{
79267 return mImpl->PassOptionalByteStringWithDefaultValue(arg, aRv, aRealm);
79268}
79269
79270void
79271TestJSImplInterface::PassOptionalNullableByteString(const Optional<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79272{
79273 return mImpl->PassOptionalNullableByteString(arg, aRv, aRealm);
79274}
79275
79276void
79277TestJSImplInterface::PassOptionalNullableByteStringWithDefaultValue(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79278{
79279 return mImpl->PassOptionalNullableByteStringWithDefaultValue(arg, aRv, aRealm);
79280}
79281
79282void
79283TestJSImplInterface::PassVariadicByteString(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79284{
79285 return mImpl->PassVariadicByteString(arg, aRv, aRealm);
79286}
79287
79288void
79289TestJSImplInterface::PassUnionByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79290{
79291 return mImpl->PassUnionByteString(arg, aRv, aRealm);
79292}
79293
79294void
79295TestJSImplInterface::PassOptionalUnionByteString(const Optional<ByteStringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79296{
79297 return mImpl->PassOptionalUnionByteString(arg, aRv, aRealm);
79298}
79299
79300void
79301TestJSImplInterface::PassOptionalUnionByteStringWithDefaultValue(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79302{
79303 return mImpl->PassOptionalUnionByteStringWithDefaultValue(arg, aRv, aRealm);
79304}
79305
79306void
79307TestJSImplInterface::PassUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79308{
79309 return mImpl->PassUTF8String(arg, aRv, aRealm);
79310}
79311
79312void
79313TestJSImplInterface::PassNullableUTF8String(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79314{
79315 return mImpl->PassNullableUTF8String(arg, aRv, aRealm);
79316}
79317
79318void
79319TestJSImplInterface::PassOptionalUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79320{
79321 return mImpl->PassOptionalUTF8String(arg, aRv, aRealm);
79322}
79323
79324void
79325TestJSImplInterface::PassOptionalUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79326{
79327 return mImpl->PassOptionalUTF8StringWithDefaultValue(arg, aRv, aRealm);
79328}
79329
79330void
79331TestJSImplInterface::PassOptionalNullableUTF8String(const Optional<nsACString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79332{
79333 return mImpl->PassOptionalNullableUTF8String(arg, aRv, aRealm);
79334}
79335
79336void
79337TestJSImplInterface::PassOptionalNullableUTF8StringWithDefaultValue(const nsACString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79338{
79339 return mImpl->PassOptionalNullableUTF8StringWithDefaultValue(arg, aRv, aRealm);
79340}
79341
79342void
79343TestJSImplInterface::PassVariadicUTF8String(const Sequence<nsCString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79344{
79345 return mImpl->PassVariadicUTF8String(arg, aRv, aRealm);
79346}
79347
79348void
79349TestJSImplInterface::PassUnionUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79350{
79351 return mImpl->PassUnionUTF8String(arg, aRv, aRealm);
79352}
79353
79354void
79355TestJSImplInterface::PassOptionalUnionUTF8String(const Optional<UTF8StringOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79356{
79357 return mImpl->PassOptionalUnionUTF8String(arg, aRv, aRealm);
79358}
79359
79360void
79361TestJSImplInterface::PassOptionalUnionUTF8StringWithDefaultValue(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79362{
79363 return mImpl->PassOptionalUnionUTF8StringWithDefaultValue(arg, aRv, aRealm);
79364}
79365
79366void
79367TestJSImplInterface::PassSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79368{
79369 return mImpl->PassSVS(arg, aRv, aRealm);
79370}
79371
79372void
79373TestJSImplInterface::PassNullableSVS(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79374{
79375 return mImpl->PassNullableSVS(arg, aRv, aRealm);
79376}
79377
79378void
79379TestJSImplInterface::PassOptionalSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79380{
79381 return mImpl->PassOptionalSVS(arg, aRv, aRealm);
79382}
79383
79384void
79385TestJSImplInterface::PassOptionalSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79386{
79387 return mImpl->PassOptionalSVSWithDefaultValue(arg, aRv, aRealm);
79388}
79389
79390void
79391TestJSImplInterface::PassOptionalNullableSVS(const Optional<nsAString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79392{
79393 return mImpl->PassOptionalNullableSVS(arg, aRv, aRealm);
79394}
79395
79396void
79397TestJSImplInterface::PassOptionalNullableSVSWithDefaultValue(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79398{
79399 return mImpl->PassOptionalNullableSVSWithDefaultValue(arg, aRv, aRealm);
79400}
79401
79402void
79403TestJSImplInterface::PassVariadicSVS(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79404{
79405 return mImpl->PassVariadicSVS(arg, aRv, aRealm);
79406}
79407
79408void
79409TestJSImplInterface::ReceiveSVS(nsString& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79410{
79411 return mImpl->ReceiveSVS(aRetVal, aRv, aRealm);
79412}
79413
79414void
79415TestJSImplInterface::PassJSString(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79416{
79417 return mImpl->PassJSString(arg, aRv, aRealm);
79418}
79419
79420void
79421TestJSImplInterface::PassOptionalJSStringWithDefaultValue(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79422{
79423 return mImpl->PassOptionalJSStringWithDefaultValue(arg, aRv, aRealm);
79424}
79425
79426void
79427TestJSImplInterface::ReceiveJSString(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79428{
79429 return mImpl->ReceiveJSString(aRetVal, aRv, aRealm);
79430}
79431
79432void
79433TestJSImplInterface::GetReadonlyJSStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79434{
79435 return mImpl->GetReadonlyJSStringAttr(aRetVal, aRv, aRealm);
79436}
79437
79438void
79439TestJSImplInterface::GetJsStringAttr(JS::MutableHandle<JSString*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
79440{
79441 return mImpl->GetJsStringAttr(aRetVal, aRv, aRealm);
79442}
79443
79444void
79445TestJSImplInterface::SetJsStringAttr(JS::Handle<JSString*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79446{
79447 mImpl->SetJsStringAttr(arg, aRv, aRealm);
79448}
79449
79450void
79451TestJSImplInterface::PassEnum(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79452{
79453 return mImpl->PassEnum(arg, aRv, aRealm);
79454}
79455
79456void
79457TestJSImplInterface::PassNullableEnum(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79458{
79459 return mImpl->PassNullableEnum(arg, aRv, aRealm);
79460}
79461
79462void
79463TestJSImplInterface::PassOptionalEnum(const Optional<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79464{
79465 return mImpl->PassOptionalEnum(arg, aRv, aRealm);
79466}
79467
79468void
79469TestJSImplInterface::PassEnumWithDefault(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79470{
79471 return mImpl->PassEnumWithDefault(arg, aRv, aRealm);
79472}
79473
79474void
79475TestJSImplInterface::PassOptionalNullableEnum(const Optional<Nullable<MyTestEnum>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79476{
79477 return mImpl->PassOptionalNullableEnum(arg, aRv, aRealm);
79478}
79479
79480void
79481TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79482{
79483 return mImpl->PassOptionalNullableEnumWithDefaultValue(arg, aRv, aRealm);
79484}
79485
79486void
79487TestJSImplInterface::PassOptionalNullableEnumWithDefaultValue2(const Nullable<MyTestEnum>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79488{
79489 return mImpl->PassOptionalNullableEnumWithDefaultValue2(arg, aRv, aRealm);
79490}
79491
79492MyTestEnum
79493TestJSImplInterface::ReceiveEnum(ErrorResult& aRv, JS::Realm* aRealm)
79494{
79495 return mImpl->ReceiveEnum(aRv, aRealm);
79496}
79497
79498Nullable<MyTestEnum>
79499TestJSImplInterface::ReceiveNullableEnum(ErrorResult& aRv, JS::Realm* aRealm)
79500{
79501 return mImpl->ReceiveNullableEnum(aRv, aRealm);
79502}
79503
79504MyTestEnum
79505TestJSImplInterface::GetEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
79506{
79507 return mImpl->GetEnumAttribute(aRv, aRealm);
79508}
79509
79510void
79511TestJSImplInterface::SetEnumAttribute(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
79512{
79513 mImpl->SetEnumAttribute(arg, aRv, aRealm);
79514}
79515
79516MyTestEnum
79517TestJSImplInterface::GetReadonlyEnumAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
79518{
79519 return mImpl->GetReadonlyEnumAttribute(aRv, aRealm);
79520}
79521
79522void
79523TestJSImplInterface::PassCallback(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
79524{
79525 return mImpl->PassCallback(arg, aRv, aRealm);
79526}
79527
79528void
79529TestJSImplInterface::PassNullableCallback(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79530{
79531 return mImpl->PassNullableCallback(arg, aRv, aRealm);
79532}
79533
79534void
79535TestJSImplInterface::PassOptionalCallback(const Optional<OwningNonNull<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79536{
79537 return mImpl->PassOptionalCallback(arg, aRv, aRealm);
79538}
79539
79540void
79541TestJSImplInterface::PassOptionalNullableCallback(const Optional<RefPtr<MyTestCallback>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79542{
79543 return mImpl->PassOptionalNullableCallback(arg, aRv, aRealm);
79544}
79545
79546void
79547TestJSImplInterface::PassOptionalNullableCallbackWithDefaultValue(MyTestCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79548{
79549 return mImpl->PassOptionalNullableCallbackWithDefaultValue(arg, aRv, aRealm);
79550}
79551
79552already_AddRefed<MyTestCallback>
79553TestJSImplInterface::ReceiveCallback(ErrorResult& aRv, JS::Realm* aRealm)
79554{
79555 return mImpl->ReceiveCallback(aRv, aRealm);
79556}
79557
79558already_AddRefed<MyTestCallback>
79559TestJSImplInterface::ReceiveNullableCallback(ErrorResult& aRv, JS::Realm* aRealm)
79560{
79561 return mImpl->ReceiveNullableCallback(aRv, aRealm);
79562}
79563
79564void
79565TestJSImplInterface::PassOptionalNullableTreatAsNullCallbackWithDefaultValue(TestTreatAsNullCallback* arg, ErrorResult& aRv, JS::Realm* aRealm)
79566{
79567 return mImpl->PassOptionalNullableTreatAsNullCallbackWithDefaultValue(arg, aRv, aRealm);
79568}
79569
79570void
79571TestJSImplInterface::PassAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79572{
79573 return mImpl->PassAny(arg, aRv, aRealm);
79574}
79575
79576void
79577TestJSImplInterface::PassVariadicAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79578{
79579 return mImpl->PassVariadicAny(arg, aRv, aRealm);
79580}
79581
79582void
79583TestJSImplInterface::PassOptionalAny(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79584{
79585 return mImpl->PassOptionalAny(arg, aRv, aRealm);
79586}
79587
79588void
79589TestJSImplInterface::PassAnyDefaultNull(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
79590{
79591 return mImpl->PassAnyDefaultNull(arg, aRv, aRealm);
79592}
79593
79594void
79595TestJSImplInterface::PassSequenceOfAny(const Sequence<JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79596{
79597 return mImpl->PassSequenceOfAny(arg, aRv, aRealm);
79598}
79599
79600void
79601TestJSImplInterface::PassNullableSequenceOfAny(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79602{
79603 return mImpl->PassNullableSequenceOfAny(arg, aRv, aRealm);
79604}
79605
79606void
79607TestJSImplInterface::PassOptionalSequenceOfAny(const Optional<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79608{
79609 return mImpl->PassOptionalSequenceOfAny(arg, aRv, aRealm);
79610}
79611
79612void
79613TestJSImplInterface::PassOptionalNullableSequenceOfAny(const Optional<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79614{
79615 return mImpl->PassOptionalNullableSequenceOfAny(arg, aRv, aRealm);
79616}
79617
79618void
79619TestJSImplInterface::PassOptionalSequenceOfAnyWithDefaultValue(const Nullable<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79620{
79621 return mImpl->PassOptionalSequenceOfAnyWithDefaultValue(arg, aRv, aRealm);
79622}
79623
79624void
79625TestJSImplInterface::PassSequenceOfSequenceOfAny(const Sequence<Sequence<JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79626{
79627 return mImpl->PassSequenceOfSequenceOfAny(arg, aRv, aRealm);
79628}
79629
79630void
79631TestJSImplInterface::PassSequenceOfNullableSequenceOfAny(const Sequence<Nullable<Sequence<JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79632{
79633 return mImpl->PassSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79634}
79635
79636void
79637TestJSImplInterface::PassNullableSequenceOfNullableSequenceOfAny(const Nullable<Sequence<Nullable<Sequence<JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79638{
79639 return mImpl->PassNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79640}
79641
79642void
79643TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfAny(const Optional<Nullable<Sequence<Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79644{
79645 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfAny(arg, aRv, aRealm);
79646}
79647
79648void
79649TestJSImplInterface::PassRecordOfAny(const Record<nsString, JS::Value>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79650{
79651 return mImpl->PassRecordOfAny(arg, aRv, aRealm);
79652}
79653
79654void
79655TestJSImplInterface::PassNullableRecordOfAny(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79656{
79657 return mImpl->PassNullableRecordOfAny(arg, aRv, aRealm);
79658}
79659
79660void
79661TestJSImplInterface::PassOptionalRecordOfAny(const Optional<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79662{
79663 return mImpl->PassOptionalRecordOfAny(arg, aRv, aRealm);
79664}
79665
79666void
79667TestJSImplInterface::PassOptionalNullableRecordOfAny(const Optional<Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79668{
79669 return mImpl->PassOptionalNullableRecordOfAny(arg, aRv, aRealm);
79670}
79671
79672void
79673TestJSImplInterface::PassOptionalRecordOfAnyWithDefaultValue(const Nullable<Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79674{
79675 return mImpl->PassOptionalRecordOfAnyWithDefaultValue(arg, aRv, aRealm);
79676}
79677
79678void
79679TestJSImplInterface::PassRecordOfRecordOfAny(const Record<nsString, Record<nsString, JS::Value>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79680{
79681 return mImpl->PassRecordOfRecordOfAny(arg, aRv, aRealm);
79682}
79683
79684void
79685TestJSImplInterface::PassRecordOfNullableRecordOfAny(const Record<nsString, Nullable<Record<nsString, JS::Value>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79686{
79687 return mImpl->PassRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79688}
79689
79690void
79691TestJSImplInterface::PassNullableRecordOfNullableRecordOfAny(const Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79692{
79693 return mImpl->PassNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79694}
79695
79696void
79697TestJSImplInterface::PassOptionalNullableRecordOfNullableRecordOfAny(const Optional<Nullable<Record<nsString, Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79698{
79699 return mImpl->PassOptionalNullableRecordOfNullableRecordOfAny(arg, aRv, aRealm);
79700}
79701
79702void
79703TestJSImplInterface::PassOptionalNullableRecordOfNullableSequenceOfAny(const Optional<Nullable<Record<nsString, Nullable<Sequence<JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79704{
79705 return mImpl->PassOptionalNullableRecordOfNullableSequenceOfAny(arg, aRv, aRealm);
79706}
79707
79708void
79709TestJSImplInterface::PassOptionalNullableSequenceOfNullableRecordOfAny(const Optional<Nullable<Sequence<Nullable<Record<nsString, JS::Value>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79710{
79711 return mImpl->PassOptionalNullableSequenceOfNullableRecordOfAny(arg, aRv, aRealm);
79712}
79713
79714void
79715TestJSImplInterface::ReceiveAny(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79716{
79717 return mImpl->ReceiveAny(aRetVal, aRv, aRealm);
79718}
79719
79720void
79721TestJSImplInterface::PassObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79722{
79723 return mImpl->PassObject(arg, aRv, aRealm);
79724}
79725
79726void
79727TestJSImplInterface::PassVariadicObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79728{
79729 return mImpl->PassVariadicObject(arg, aRv, aRealm);
79730}
79731
79732void
79733TestJSImplInterface::PassNullableObject(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79734{
79735 return mImpl->PassNullableObject(arg, aRv, aRealm);
79736}
79737
79738void
79739TestJSImplInterface::PassVariadicNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79740{
79741 return mImpl->PassVariadicNullableObject(arg, aRv, aRealm);
79742}
79743
79744void
79745TestJSImplInterface::PassOptionalObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79746{
79747 return mImpl->PassOptionalObject(arg, aRv, aRealm);
79748}
79749
79750void
79751TestJSImplInterface::PassOptionalNullableObject(const Optional<JS::Handle<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79752{
79753 return mImpl->PassOptionalNullableObject(arg, aRv, aRealm);
79754}
79755
79756void
79757TestJSImplInterface::PassOptionalNullableObjectWithDefaultValue(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
79758{
79759 return mImpl->PassOptionalNullableObjectWithDefaultValue(arg, aRv, aRealm);
79760}
79761
79762void
79763TestJSImplInterface::PassSequenceOfObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79764{
79765 return mImpl->PassSequenceOfObject(arg, aRv, aRealm);
79766}
79767
79768void
79769TestJSImplInterface::PassSequenceOfNullableObject(const Sequence<JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79770{
79771 return mImpl->PassSequenceOfNullableObject(arg, aRv, aRealm);
79772}
79773
79774void
79775TestJSImplInterface::PassNullableSequenceOfObject(const Nullable<Sequence<JSObject*>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79776{
79777 return mImpl->PassNullableSequenceOfObject(arg, aRv, aRealm);
79778}
79779
79780void
79781TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79782{
79783 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfObject(arg, aRv, aRealm);
79784}
79785
79786void
79787TestJSImplInterface::PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(const Optional<Nullable<Sequence<Nullable<Sequence<JSObject*>>>>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79788{
79789 return mImpl->PassOptionalNullableSequenceOfNullableSequenceOfNullableObject(arg, aRv, aRealm);
79790}
79791
79792void
79793TestJSImplInterface::PassRecordOfObject(const Record<nsString, JSObject*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79794{
79795 return mImpl->PassRecordOfObject(arg, aRv, aRealm);
79796}
79797
79798void
79799TestJSImplInterface::ReceiveObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79800{
79801 return mImpl->ReceiveObject(aRetVal, aRv, aRealm);
79802}
79803
79804void
79805TestJSImplInterface::ReceiveNullableObject(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
79806{
79807 return mImpl->ReceiveNullableObject(aRetVal, aRv, aRealm);
79808}
79809
79810void
79811TestJSImplInterface::PassUnion(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79812{
79813 return mImpl->PassUnion(arg, aRv, aRealm);
79814}
79815
79816void
79817TestJSImplInterface::PassUnion2(const LongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79818{
79819 return mImpl->PassUnion2(arg, aRv, aRealm);
79820}
79821
79822void
79823TestJSImplInterface::PassUnion3(const ObjectOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79824{
79825 return mImpl->PassUnion3(arg, aRv, aRealm);
79826}
79827
79828void
79829TestJSImplInterface::PassUnion4(const NodeOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79830{
79831 return mImpl->PassUnion4(arg, aRv, aRealm);
79832}
79833
79834void
79835TestJSImplInterface::PassUnion5(const ObjectOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79836{
79837 return mImpl->PassUnion5(arg, aRv, aRealm);
79838}
79839
79840void
79841TestJSImplInterface::PassUnion6(const ObjectOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79842{
79843 return mImpl->PassUnion6(arg, aRv, aRealm);
79844}
79845
79846void
79847TestJSImplInterface::PassUnion7(const ObjectOrStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79848{
79849 return mImpl->PassUnion7(arg, aRv, aRealm);
79850}
79851
79852void
79853TestJSImplInterface::PassUnion8(const ObjectOrStringOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79854{
79855 return mImpl->PassUnion8(arg, aRv, aRealm);
79856}
79857
79858void
79859TestJSImplInterface::PassUnion9(const ObjectOrStringOrLongOrBoolean& arg, ErrorResult& aRv, JS::Realm* aRealm)
79860{
79861 return mImpl->PassUnion9(arg, aRv, aRealm);
79862}
79863
79864void
79865TestJSImplInterface::PassUnion10(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79866{
79867 return mImpl->PassUnion10(arg, aRv, aRealm);
79868}
79869
79870void
79871TestJSImplInterface::PassUnion11(const CustomEventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79872{
79873 return mImpl->PassUnion11(arg, aRv, aRealm);
79874}
79875
79876void
79877TestJSImplInterface::PassUnion12(const EventInitOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79878{
79879 return mImpl->PassUnion12(arg, aRv, aRealm);
79880}
79881
79882void
79883TestJSImplInterface::PassUnion13(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
79884{
79885 return mImpl->PassUnion13(arg, aRv, aRealm);
79886}
79887
79888void
79889TestJSImplInterface::PassUnion14(const ObjectOrLongOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
79890{
79891 return mImpl->PassUnion14(arg, aRv, aRealm);
79892}
79893
79894void
79895TestJSImplInterface::PassUnion15(const LongSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79896{
79897 return mImpl->PassUnion15(arg, aRv, aRealm);
79898}
79899
79900void
79901TestJSImplInterface::PassUnion16(const Optional<LongSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79902{
79903 return mImpl->PassUnion16(arg, aRv, aRealm);
79904}
79905
79906void
79907TestJSImplInterface::PassUnion17(const LongSequenceOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79908{
79909 return mImpl->PassUnion17(arg, aRv, aRealm);
79910}
79911
79912void
79913TestJSImplInterface::PassUnion18(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79914{
79915 return mImpl->PassUnion18(arg, aRv, aRealm);
79916}
79917
79918void
79919TestJSImplInterface::PassUnion19(const Optional<ObjectSequenceOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
79920{
79921 return mImpl->PassUnion19(arg, aRv, aRealm);
79922}
79923
79924void
79925TestJSImplInterface::PassUnion20(const ObjectSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79926{
79927 return mImpl->PassUnion20(arg, aRv, aRealm);
79928}
79929
79930void
79931TestJSImplInterface::PassUnion21(const StringLongRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79932{
79933 return mImpl->PassUnion21(arg, aRv, aRealm);
79934}
79935
79936void
79937TestJSImplInterface::PassUnion22(const StringObjectRecordOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79938{
79939 return mImpl->PassUnion22(arg, aRv, aRealm);
79940}
79941
79942void
79943TestJSImplInterface::PassUnion23(const ImageDataSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79944{
79945 return mImpl->PassUnion23(arg, aRv, aRealm);
79946}
79947
79948void
79949TestJSImplInterface::PassUnion24(const ImageDataOrNullSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79950{
79951 return mImpl->PassUnion24(arg, aRv, aRealm);
79952}
79953
79954void
79955TestJSImplInterface::PassUnion25(const ImageDataSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79956{
79957 return mImpl->PassUnion25(arg, aRv, aRealm);
79958}
79959
79960void
79961TestJSImplInterface::PassUnion26(const ImageDataOrNullSequenceSequenceOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79962{
79963 return mImpl->PassUnion26(arg, aRv, aRealm);
79964}
79965
79966void
79967TestJSImplInterface::PassUnion27(const StringSequenceOrEventInit& arg, ErrorResult& aRv, JS::Realm* aRealm)
79968{
79969 return mImpl->PassUnion27(arg, aRv, aRealm);
79970}
79971
79972void
79973TestJSImplInterface::PassUnion28(const EventInitOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
79974{
79975 return mImpl->PassUnion28(arg, aRv, aRealm);
79976}
79977
79978void
79979TestJSImplInterface::PassUnionWithCallback(const EventHandlerNonNullOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79980{
79981 return mImpl->PassUnionWithCallback(arg, aRv, aRealm);
79982}
79983
79984void
79985TestJSImplInterface::PassUnionWithByteString(const ByteStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79986{
79987 return mImpl->PassUnionWithByteString(arg, aRv, aRealm);
79988}
79989
79990void
79991TestJSImplInterface::PassUnionWithUTF8String(const UTF8StringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
79992{
79993 return mImpl->PassUnionWithUTF8String(arg, aRv, aRealm);
79994}
79995
79996void
79997TestJSImplInterface::PassUnionWithRecord(const StringStringRecordOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
79998{
79999 return mImpl->PassUnionWithRecord(arg, aRv, aRealm);
80000}
80001
80002void
80003TestJSImplInterface::PassUnionWithRecordAndSequence(const StringStringRecordOrStringSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
80004{
80005 return mImpl->PassUnionWithRecordAndSequence(arg, aRv, aRealm);
80006}
80007
80008void
80009TestJSImplInterface::PassUnionWithSequenceAndRecord(const StringSequenceOrStringStringRecord& arg, ErrorResult& aRv, JS::Realm* aRealm)
80010{
80011 return mImpl->PassUnionWithSequenceAndRecord(arg, aRv, aRealm);
80012}
80013
80014void
80015TestJSImplInterface::PassUnionWithSVS(const USVStringOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80016{
80017 return mImpl->PassUnionWithSVS(arg, aRv, aRealm);
80018}
80019
80020void
80021TestJSImplInterface::PassUnionWithNullable(const ObjectOrNullOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80022{
80023 return mImpl->PassUnionWithNullable(arg, aRv, aRealm);
80024}
80025
80026void
80027TestJSImplInterface::PassNullableUnion(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80028{
80029 return mImpl->PassNullableUnion(arg, aRv, aRealm);
80030}
80031
80032void
80033TestJSImplInterface::PassOptionalUnion(const Optional<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80034{
80035 return mImpl->PassOptionalUnion(arg, aRv, aRealm);
80036}
80037
80038void
80039TestJSImplInterface::PassOptionalNullableUnion(const Optional<Nullable<ObjectOrLong>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80040{
80041 return mImpl->PassOptionalNullableUnion(arg, aRv, aRealm);
80042}
80043
80044void
80045TestJSImplInterface::PassOptionalNullableUnionWithDefaultValue(const Nullable<ObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80046{
80047 return mImpl->PassOptionalNullableUnionWithDefaultValue(arg, aRv, aRealm);
80048}
80049
80050void
80051TestJSImplInterface::PassUnionWithArrayBuffer(const UTF8StringOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
80052{
80053 return mImpl->PassUnionWithArrayBuffer(arg, aRv, aRealm);
80054}
80055
80056void
80057TestJSImplInterface::PassUnionWithArrayBufferOrNull(const UTF8StringOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80058{
80059 return mImpl->PassUnionWithArrayBufferOrNull(arg, aRv, aRealm);
80060}
80061
80062void
80063TestJSImplInterface::PassUnionWithTypedArrays(const ArrayBufferViewOrArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
80064{
80065 return mImpl->PassUnionWithTypedArrays(arg, aRv, aRealm);
80066}
80067
80068void
80069TestJSImplInterface::PassUnionWithTypedArraysOrNull(const ArrayBufferViewOrArrayBufferOrNull& arg, ErrorResult& aRv, JS::Realm* aRealm)
80070{
80071 return mImpl->PassUnionWithTypedArraysOrNull(arg, aRv, aRealm);
80072}
80073
80074void
80075TestJSImplInterface::PassUnionWithString(const StringOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
80076{
80077 return mImpl->PassUnionWithString(arg, aRv, aRealm);
80078}
80079
80080void
80081TestJSImplInterface::PassUnionWithEnum(const SupportedTypeOrObject& arg, ErrorResult& aRv, JS::Realm* aRealm)
80082{
80083 return mImpl->PassUnionWithEnum(arg, aRv, aRealm);
80084}
80085
80086void
80087TestJSImplInterface::PassUnionWithObject(const ObjectOrLong& arg, ErrorResult& aRv, JS::Realm* aRealm)
80088{
80089 return mImpl->PassUnionWithObject(arg, aRv, aRealm);
80090}
80091
80092void
80093TestJSImplInterface::PassUnionWithDefaultValue1(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80094{
80095 return mImpl->PassUnionWithDefaultValue1(arg, aRv, aRealm);
80096}
80097
80098void
80099TestJSImplInterface::PassUnionWithDefaultValue2(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80100{
80101 return mImpl->PassUnionWithDefaultValue2(arg, aRv, aRealm);
80102}
80103
80104void
80105TestJSImplInterface::PassUnionWithDefaultValue3(const DoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80106{
80107 return mImpl->PassUnionWithDefaultValue3(arg, aRv, aRealm);
80108}
80109
80110void
80111TestJSImplInterface::PassUnionWithDefaultValue4(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80112{
80113 return mImpl->PassUnionWithDefaultValue4(arg, aRv, aRealm);
80114}
80115
80116void
80117TestJSImplInterface::PassUnionWithDefaultValue5(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80118{
80119 return mImpl->PassUnionWithDefaultValue5(arg, aRv, aRealm);
80120}
80121
80122void
80123TestJSImplInterface::PassUnionWithDefaultValue6(const FloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80124{
80125 return mImpl->PassUnionWithDefaultValue6(arg, aRv, aRealm);
80126}
80127
80128void
80129TestJSImplInterface::PassUnionWithDefaultValue7(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80130{
80131 return mImpl->PassUnionWithDefaultValue7(arg, aRv, aRealm);
80132}
80133
80134void
80135TestJSImplInterface::PassUnionWithDefaultValue8(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80136{
80137 return mImpl->PassUnionWithDefaultValue8(arg, aRv, aRealm);
80138}
80139
80140void
80141TestJSImplInterface::PassUnionWithDefaultValue9(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80142{
80143 return mImpl->PassUnionWithDefaultValue9(arg, aRv, aRealm);
80144}
80145
80146void
80147TestJSImplInterface::PassUnionWithDefaultValue10(const UnrestrictedDoubleOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80148{
80149 return mImpl->PassUnionWithDefaultValue10(arg, aRv, aRealm);
80150}
80151
80152void
80153TestJSImplInterface::PassUnionWithDefaultValue11(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80154{
80155 return mImpl->PassUnionWithDefaultValue11(arg, aRv, aRealm);
80156}
80157
80158void
80159TestJSImplInterface::PassUnionWithDefaultValue12(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80160{
80161 return mImpl->PassUnionWithDefaultValue12(arg, aRv, aRealm);
80162}
80163
80164void
80165TestJSImplInterface::PassUnionWithDefaultValue13(const UnrestrictedFloatOrString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80166{
80167 return mImpl->PassUnionWithDefaultValue13(arg, aRv, aRealm);
80168}
80169
80170void
80171TestJSImplInterface::PassUnionWithDefaultValue14(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80172{
80173 return mImpl->PassUnionWithDefaultValue14(arg, aRv, aRealm);
80174}
80175
80176void
80177TestJSImplInterface::PassUnionWithDefaultValue15(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80178{
80179 return mImpl->PassUnionWithDefaultValue15(arg, aRv, aRealm);
80180}
80181
80182void
80183TestJSImplInterface::PassUnionWithDefaultValue16(const DoubleOrByteString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80184{
80185 return mImpl->PassUnionWithDefaultValue16(arg, aRv, aRealm);
80186}
80187
80188void
80189TestJSImplInterface::PassUnionWithDefaultValue17(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80190{
80191 return mImpl->PassUnionWithDefaultValue17(arg, aRv, aRealm);
80192}
80193
80194void
80195TestJSImplInterface::PassUnionWithDefaultValue18(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80196{
80197 return mImpl->PassUnionWithDefaultValue18(arg, aRv, aRealm);
80198}
80199
80200void
80201TestJSImplInterface::PassUnionWithDefaultValue19(const DoubleOrSupportedType& arg, ErrorResult& aRv, JS::Realm* aRealm)
80202{
80203 return mImpl->PassUnionWithDefaultValue19(arg, aRv, aRealm);
80204}
80205
80206void
80207TestJSImplInterface::PassUnionWithDefaultValue20(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80208{
80209 return mImpl->PassUnionWithDefaultValue20(arg, aRv, aRealm);
80210}
80211
80212void
80213TestJSImplInterface::PassUnionWithDefaultValue21(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80214{
80215 return mImpl->PassUnionWithDefaultValue21(arg, aRv, aRealm);
80216}
80217
80218void
80219TestJSImplInterface::PassUnionWithDefaultValue22(const DoubleOrUSVString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80220{
80221 return mImpl->PassUnionWithDefaultValue22(arg, aRv, aRealm);
80222}
80223
80224void
80225TestJSImplInterface::PassUnionWithDefaultValue23(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80226{
80227 return mImpl->PassUnionWithDefaultValue23(arg, aRv, aRealm);
80228}
80229
80230void
80231TestJSImplInterface::PassUnionWithDefaultValue24(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80232{
80233 return mImpl->PassUnionWithDefaultValue24(arg, aRv, aRealm);
80234}
80235
80236void
80237TestJSImplInterface::PassUnionWithDefaultValue25(const DoubleOrUTF8String& arg, ErrorResult& aRv, JS::Realm* aRealm)
80238{
80239 return mImpl->PassUnionWithDefaultValue25(arg, aRv, aRealm);
80240}
80241
80242void
80243TestJSImplInterface::PassNullableUnionWithDefaultValue1(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80244{
80245 return mImpl->PassNullableUnionWithDefaultValue1(arg, aRv, aRealm);
80246}
80247
80248void
80249TestJSImplInterface::PassNullableUnionWithDefaultValue2(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80250{
80251 return mImpl->PassNullableUnionWithDefaultValue2(arg, aRv, aRealm);
80252}
80253
80254void
80255TestJSImplInterface::PassNullableUnionWithDefaultValue3(const Nullable<DoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80256{
80257 return mImpl->PassNullableUnionWithDefaultValue3(arg, aRv, aRealm);
80258}
80259
80260void
80261TestJSImplInterface::PassNullableUnionWithDefaultValue4(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80262{
80263 return mImpl->PassNullableUnionWithDefaultValue4(arg, aRv, aRealm);
80264}
80265
80266void
80267TestJSImplInterface::PassNullableUnionWithDefaultValue5(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80268{
80269 return mImpl->PassNullableUnionWithDefaultValue5(arg, aRv, aRealm);
80270}
80271
80272void
80273TestJSImplInterface::PassNullableUnionWithDefaultValue6(const Nullable<FloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80274{
80275 return mImpl->PassNullableUnionWithDefaultValue6(arg, aRv, aRealm);
80276}
80277
80278void
80279TestJSImplInterface::PassNullableUnionWithDefaultValue7(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80280{
80281 return mImpl->PassNullableUnionWithDefaultValue7(arg, aRv, aRealm);
80282}
80283
80284void
80285TestJSImplInterface::PassNullableUnionWithDefaultValue8(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80286{
80287 return mImpl->PassNullableUnionWithDefaultValue8(arg, aRv, aRealm);
80288}
80289
80290void
80291TestJSImplInterface::PassNullableUnionWithDefaultValue9(const Nullable<UnrestrictedDoubleOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80292{
80293 return mImpl->PassNullableUnionWithDefaultValue9(arg, aRv, aRealm);
80294}
80295
80296void
80297TestJSImplInterface::PassNullableUnionWithDefaultValue10(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80298{
80299 return mImpl->PassNullableUnionWithDefaultValue10(arg, aRv, aRealm);
80300}
80301
80302void
80303TestJSImplInterface::PassNullableUnionWithDefaultValue11(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80304{
80305 return mImpl->PassNullableUnionWithDefaultValue11(arg, aRv, aRealm);
80306}
80307
80308void
80309TestJSImplInterface::PassNullableUnionWithDefaultValue12(const Nullable<UnrestrictedFloatOrString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80310{
80311 return mImpl->PassNullableUnionWithDefaultValue12(arg, aRv, aRealm);
80312}
80313
80314void
80315TestJSImplInterface::PassNullableUnionWithDefaultValue13(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80316{
80317 return mImpl->PassNullableUnionWithDefaultValue13(arg, aRv, aRealm);
80318}
80319
80320void
80321TestJSImplInterface::PassNullableUnionWithDefaultValue14(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80322{
80323 return mImpl->PassNullableUnionWithDefaultValue14(arg, aRv, aRealm);
80324}
80325
80326void
80327TestJSImplInterface::PassNullableUnionWithDefaultValue15(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80328{
80329 return mImpl->PassNullableUnionWithDefaultValue15(arg, aRv, aRealm);
80330}
80331
80332void
80333TestJSImplInterface::PassNullableUnionWithDefaultValue16(const Nullable<DoubleOrByteString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80334{
80335 return mImpl->PassNullableUnionWithDefaultValue16(arg, aRv, aRealm);
80336}
80337
80338void
80339TestJSImplInterface::PassNullableUnionWithDefaultValue17(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80340{
80341 return mImpl->PassNullableUnionWithDefaultValue17(arg, aRv, aRealm);
80342}
80343
80344void
80345TestJSImplInterface::PassNullableUnionWithDefaultValue18(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80346{
80347 return mImpl->PassNullableUnionWithDefaultValue18(arg, aRv, aRealm);
80348}
80349
80350void
80351TestJSImplInterface::PassNullableUnionWithDefaultValue19(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80352{
80353 return mImpl->PassNullableUnionWithDefaultValue19(arg, aRv, aRealm);
80354}
80355
80356void
80357TestJSImplInterface::PassNullableUnionWithDefaultValue20(const Nullable<DoubleOrSupportedType>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80358{
80359 return mImpl->PassNullableUnionWithDefaultValue20(arg, aRv, aRealm);
80360}
80361
80362void
80363TestJSImplInterface::PassNullableUnionWithDefaultValue21(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80364{
80365 return mImpl->PassNullableUnionWithDefaultValue21(arg, aRv, aRealm);
80366}
80367
80368void
80369TestJSImplInterface::PassNullableUnionWithDefaultValue22(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80370{
80371 return mImpl->PassNullableUnionWithDefaultValue22(arg, aRv, aRealm);
80372}
80373
80374void
80375TestJSImplInterface::PassNullableUnionWithDefaultValue23(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80376{
80377 return mImpl->PassNullableUnionWithDefaultValue23(arg, aRv, aRealm);
80378}
80379
80380void
80381TestJSImplInterface::PassNullableUnionWithDefaultValue24(const Nullable<DoubleOrUSVString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80382{
80383 return mImpl->PassNullableUnionWithDefaultValue24(arg, aRv, aRealm);
80384}
80385
80386void
80387TestJSImplInterface::PassNullableUnionWithDefaultValue25(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80388{
80389 return mImpl->PassNullableUnionWithDefaultValue25(arg, aRv, aRealm);
80390}
80391
80392void
80393TestJSImplInterface::PassNullableUnionWithDefaultValue26(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80394{
80395 return mImpl->PassNullableUnionWithDefaultValue26(arg, aRv, aRealm);
80396}
80397
80398void
80399TestJSImplInterface::PassNullableUnionWithDefaultValue27(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80400{
80401 return mImpl->PassNullableUnionWithDefaultValue27(arg, aRv, aRealm);
80402}
80403
80404void
80405TestJSImplInterface::PassNullableUnionWithDefaultValue28(const Nullable<DoubleOrUTF8String>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80406{
80407 return mImpl->PassNullableUnionWithDefaultValue28(arg, aRv, aRealm);
80408}
80409
80410void
80411TestJSImplInterface::PassSequenceOfUnions(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80412{
80413 return mImpl->PassSequenceOfUnions(arg, aRv, aRealm);
80414}
80415
80416void
80417TestJSImplInterface::PassSequenceOfUnions2(const Sequence<OwningObjectOrLong>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80418{
80419 return mImpl->PassSequenceOfUnions2(arg, aRv, aRealm);
80420}
80421
80422void
80423TestJSImplInterface::PassVariadicUnion(const Sequence<OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80424{
80425 return mImpl->PassVariadicUnion(arg, aRv, aRealm);
80426}
80427
80428void
80429TestJSImplInterface::PassSequenceOfNullableUnions(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80430{
80431 return mImpl->PassSequenceOfNullableUnions(arg, aRv, aRealm);
80432}
80433
80434void
80435TestJSImplInterface::PassVariadicNullableUnion(const Sequence<Nullable<OwningCanvasPatternOrCanvasGradient>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80436{
80437 return mImpl->PassVariadicNullableUnion(arg, aRv, aRealm);
80438}
80439
80440void
80441TestJSImplInterface::PassRecordOfUnions(const Record<nsString, OwningCanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80442{
80443 return mImpl->PassRecordOfUnions(arg, aRv, aRealm);
80444}
80445
80446void
80447TestJSImplInterface::ReceiveUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80448{
80449 return mImpl->ReceiveUnion(aRetVal, aRv, aRealm);
80450}
80451
80452void
80453TestJSImplInterface::ReceiveUnion2(OwningObjectOrLong& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80454{
80455 return mImpl->ReceiveUnion2(aRetVal, aRv, aRealm);
80456}
80457
80458void
80459TestJSImplInterface::ReceiveUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80460{
80461 return mImpl->ReceiveUnionContainingNull(aRetVal, aRv, aRealm);
80462}
80463
80464void
80465TestJSImplInterface::ReceiveNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80466{
80467 return mImpl->ReceiveNullableUnion(aRetVal, aRv, aRealm);
80468}
80469
80470void
80471TestJSImplInterface::ReceiveNullableUnion2(Nullable<OwningObjectOrLong>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80472{
80473 return mImpl->ReceiveNullableUnion2(aRetVal, aRv, aRealm);
80474}
80475
80476void
80477TestJSImplInterface::GetWritableUnion(OwningCanvasPatternOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80478{
80479 return mImpl->GetWritableUnion(aRetVal, aRv, aRealm);
80480}
80481
80482void
80483TestJSImplInterface::SetWritableUnion(const CanvasPatternOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
80484{
80485 mImpl->SetWritableUnion(arg, aRv, aRealm);
80486}
80487
80488void
80489TestJSImplInterface::GetWritableUnionContainingNull(OwningCanvasPatternOrNullOrCanvasGradient& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80490{
80491 return mImpl->GetWritableUnionContainingNull(aRetVal, aRv, aRealm);
80492}
80493
80494void
80495TestJSImplInterface::SetWritableUnionContainingNull(const CanvasPatternOrNullOrCanvasGradient& arg, ErrorResult& aRv, JS::Realm* aRealm)
80496{
80497 mImpl->SetWritableUnionContainingNull(arg, aRv, aRealm);
80498}
80499
80500void
80501TestJSImplInterface::GetWritableNullableUnion(Nullable<OwningCanvasPatternOrCanvasGradient>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
80502{
80503 return mImpl->GetWritableNullableUnion(aRetVal, aRv, aRealm);
80504}
80505
80506void
80507TestJSImplInterface::SetWritableNullableUnion(const Nullable<CanvasPatternOrCanvasGradient>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80508{
80509 mImpl->SetWritableNullableUnion(arg, aRv, aRealm);
80510}
80511
80512void
80513TestJSImplInterface::PassPromise(Promise& arg, ErrorResult& aRv, JS::Realm* aRealm)
80514{
80515 return mImpl->PassPromise(arg, aRv, aRealm);
80516}
80517
80518void
80519TestJSImplInterface::PassOptionalPromise(const Optional<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80520{
80521 return mImpl->PassOptionalPromise(arg, aRv, aRealm);
80522}
80523
80524void
80525TestJSImplInterface::PassPromiseSequence(const Sequence<OwningNonNull<Promise>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80526{
80527 return mImpl->PassPromiseSequence(arg, aRv, aRealm);
80528}
80529
80530// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80531already_AddRefed<Promise>
80532TestJSImplInterface::ReceivePromise(ErrorResult& aRv, JS::Realm* aRealm)
80533{
80534 return mImpl->ReceivePromise(aRv, aRealm);
80535}
80536
80537// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80538already_AddRefed<Promise>
80539TestJSImplInterface::ReceiveAddrefedPromise(ErrorResult& aRv, JS::Realm* aRealm)
80540{
80541 return mImpl->ReceiveAddrefedPromise(aRv, aRealm);
80542}
80543
80544void
80545TestJSImplInterface::MethodRenamedTo(ErrorResult& aRv, JS::Realm* aRealm)
80546{
80547 return mImpl->MethodRenamedTo(aRv, aRealm);
80548}
80549
80550void
80551TestJSImplInterface::MethodRenamedTo(int8_t argument, ErrorResult& aRv, JS::Realm* aRealm)
80552{
80553 return mImpl->MethodRenamedTo(argument, aRv, aRealm);
80554}
80555
80556int8_t
80557TestJSImplInterface::GetAttributeGetterRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const
80558{
80559 return mImpl->GetAttributeGetterRenamedTo(aRv, aRealm);
80560}
80561
80562int8_t
80563TestJSImplInterface::GetAttributeRenamedTo(ErrorResult& aRv, JS::Realm* aRealm) const
80564{
80565 return mImpl->GetAttributeRenamedTo(aRv, aRealm);
80566}
80567
80568void
80569TestJSImplInterface::SetAttributeRenamedTo(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80570{
80571 mImpl->SetAttributeRenamedTo(arg, aRv, aRealm);
80572}
80573
80574void
80575TestJSImplInterface::PassDictionary(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80576{
80577 return mImpl->PassDictionary(x, aRv, aRealm);
80578}
80579
80580void
80581TestJSImplInterface::PassDictionary2(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80582{
80583 return mImpl->PassDictionary2(x, aRv, aRealm);
80584}
80585
80586void
80587TestJSImplInterface::ReceiveDictionary(Dict& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80588{
80589 return mImpl->ReceiveDictionary(aRetVal, aRv, aRealm);
80590}
80591
80592void
80593TestJSImplInterface::ReceiveNullableDictionary(Nullable<Dict>& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80594{
80595 return mImpl->ReceiveNullableDictionary(aRetVal, aRv, aRealm);
80596}
80597
80598void
80599TestJSImplInterface::PassOtherDictionary(const GrandparentDict& x, ErrorResult& aRv, JS::Realm* aRealm)
80600{
80601 return mImpl->PassOtherDictionary(x, aRv, aRealm);
80602}
80603
80604void
80605TestJSImplInterface::PassSequenceOfDictionaries(const Sequence<Dict>& x, ErrorResult& aRv, JS::Realm* aRealm)
80606{
80607 return mImpl->PassSequenceOfDictionaries(x, aRv, aRealm);
80608}
80609
80610void
80611TestJSImplInterface::PassRecordOfDictionaries(const Record<nsString, GrandparentDict>& x, ErrorResult& aRv, JS::Realm* aRealm)
80612{
80613 return mImpl->PassRecordOfDictionaries(x, aRv, aRealm);
80614}
80615
80616void
80617TestJSImplInterface::PassDictionaryOrLong(const Dict& x, ErrorResult& aRv, JS::Realm* aRealm)
80618{
80619 return mImpl->PassDictionaryOrLong(x, aRv, aRealm);
80620}
80621
80622void
80623TestJSImplInterface::PassDictionaryOrLong(int32_t x, ErrorResult& aRv, JS::Realm* aRealm)
80624{
80625 return mImpl->PassDictionaryOrLong(x, aRv, aRealm);
80626}
80627
80628void
80629TestJSImplInterface::PassDictContainingDict(const DictContainingDict& arg, ErrorResult& aRv, JS::Realm* aRealm)
80630{
80631 return mImpl->PassDictContainingDict(arg, aRv, aRealm);
80632}
80633
80634void
80635TestJSImplInterface::PassDictContainingSequence(const DictContainingSequence& arg, ErrorResult& aRv, JS::Realm* aRealm)
80636{
80637 return mImpl->PassDictContainingSequence(arg, aRv, aRealm);
80638}
80639
80640void
80641TestJSImplInterface::ReceiveDictContainingSequence(DictContainingSequence& aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
80642{
80643 return mImpl->ReceiveDictContainingSequence(aRetVal, aRv, aRealm);
80644}
80645
80646void
80647TestJSImplInterface::PassVariadicDictionary(const Sequence<Dict>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80648{
80649 return mImpl->PassVariadicDictionary(arg, aRv, aRealm);
80650}
80651
80652void
80653TestJSImplInterface::DontEnforceRangeOrClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80654{
80655 return mImpl->DontEnforceRangeOrClamp(arg, aRv, aRealm);
80656}
80657
80658void
80659TestJSImplInterface::DoEnforceRange(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80660{
80661 return mImpl->DoEnforceRange(arg, aRv, aRealm);
80662}
80663
80664void
80665TestJSImplInterface::DoEnforceRangeNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80666{
80667 return mImpl->DoEnforceRangeNullable(arg, aRv, aRealm);
80668}
80669
80670void
80671TestJSImplInterface::DoClamp(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80672{
80673 return mImpl->DoClamp(arg, aRv, aRealm);
80674}
80675
80676void
80677TestJSImplInterface::DoClampNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80678{
80679 return mImpl->DoClampNullable(arg, aRv, aRealm);
80680}
80681
80682int8_t
80683TestJSImplInterface::GetEnforcedByte(ErrorResult& aRv, JS::Realm* aRealm) const
80684{
80685 return mImpl->GetEnforcedByte(aRv, aRealm);
80686}
80687
80688void
80689TestJSImplInterface::SetEnforcedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80690{
80691 mImpl->SetEnforcedByte(arg, aRv, aRealm);
80692}
80693
80694Nullable<int8_t>
80695TestJSImplInterface::GetEnforcedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const
80696{
80697 return mImpl->GetEnforcedByteNullable(aRv, aRealm);
5
Calling 'TestJSImplInterfaceJSImpl::GetEnforcedByteNullable'
80698}
80699
80700void
80701TestJSImplInterface::SetEnforcedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80702{
80703 mImpl->SetEnforcedByteNullable(arg, aRv, aRealm);
80704}
80705
80706int8_t
80707TestJSImplInterface::GetClampedByte(ErrorResult& aRv, JS::Realm* aRealm) const
80708{
80709 return mImpl->GetClampedByte(aRv, aRealm);
80710}
80711
80712void
80713TestJSImplInterface::SetClampedByte(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80714{
80715 mImpl->SetClampedByte(arg, aRv, aRealm);
80716}
80717
80718Nullable<int8_t>
80719TestJSImplInterface::GetClampedByteNullable(ErrorResult& aRv, JS::Realm* aRealm) const
80720{
80721 return mImpl->GetClampedByteNullable(aRv, aRealm);
80722}
80723
80724void
80725TestJSImplInterface::SetClampedByteNullable(const Nullable<int8_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80726{
80727 mImpl->SetClampedByteNullable(arg, aRv, aRealm);
80728}
80729
80730void
80731TestJSImplInterface::ExerciseTypedefInterfaces1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80732{
80733 return mImpl->ExerciseTypedefInterfaces1(arg, aRv, aRealm);
80734}
80735
80736// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80737already_AddRefed<TestJSImplInterface>
80738TestJSImplInterface::ExerciseTypedefInterfaces2(TestJSImplInterface* arg, ErrorResult& aRv, JS::Realm* aRealm)
80739{
80740 return mImpl->ExerciseTypedefInterfaces2(arg, aRv, aRealm);
80741}
80742
80743void
80744TestJSImplInterface::ExerciseTypedefInterfaces3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80745{
80746 return mImpl->ExerciseTypedefInterfaces3(arg, aRv, aRealm);
80747}
80748
80749int8_t
80750TestJSImplInterface::GetDeprecatedAttribute(ErrorResult& aRv, JS::Realm* aRealm) const
80751{
80752 return mImpl->GetDeprecatedAttribute(aRv, aRealm);
80753}
80754
80755void
80756TestJSImplInterface::SetDeprecatedAttribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80757{
80758 mImpl->SetDeprecatedAttribute(arg, aRv, aRealm);
80759}
80760
80761int8_t
80762TestJSImplInterface::DeprecatedMethod(ErrorResult& aRv, JS::Realm* aRealm)
80763{
80764 return mImpl->DeprecatedMethod(aRv, aRealm);
80765}
80766
80767void
80768TestJSImplInterface::DeprecatedMethodWithContext(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
80769{
80770 return mImpl->DeprecatedMethodWithContext(arg, aRv, aRealm);
80771}
80772
80773bool
80774TestJSImplInterface::Overload1(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80775{
80776 return mImpl->Overload1(arg, aRv, aRealm);
80777}
80778
80779// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
80780already_AddRefed<TestJSImplInterface>
80781TestJSImplInterface::Overload1(const nsAString& strs, TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80782{
80783 return mImpl->Overload1(strs, arg, aRv, aRealm);
80784}
80785
80786void
80787TestJSImplInterface::Overload2(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80788{
80789 return mImpl->Overload2(arg, aRv, aRealm);
80790}
80791
80792void
80793TestJSImplInterface::Overload2(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
80794{
80795 return mImpl->Overload2(arg, aRv, aRealm);
80796}
80797
80798void
80799TestJSImplInterface::Overload2(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
80800{
80801 return mImpl->Overload2(arg, aRv, aRealm);
80802}
80803
80804void
80805TestJSImplInterface::Overload2(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80806{
80807 return mImpl->Overload2(arg, aRv, aRealm);
80808}
80809
80810void
80811TestJSImplInterface::Overload3(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80812{
80813 return mImpl->Overload3(arg, aRv, aRealm);
80814}
80815
80816void
80817TestJSImplInterface::Overload3(MyTestCallback& arg, ErrorResult& aRv, JS::Realm* aRealm)
80818{
80819 return mImpl->Overload3(arg, aRv, aRealm);
80820}
80821
80822void
80823TestJSImplInterface::Overload3(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
80824{
80825 return mImpl->Overload3(arg, aRv, aRealm);
80826}
80827
80828void
80829TestJSImplInterface::Overload4(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80830{
80831 return mImpl->Overload4(arg, aRv, aRealm);
80832}
80833
80834void
80835TestJSImplInterface::Overload4(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80836{
80837 return mImpl->Overload4(arg, aRv, aRealm);
80838}
80839
80840void
80841TestJSImplInterface::Overload4(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80842{
80843 return mImpl->Overload4(arg, aRv, aRealm);
80844}
80845
80846void
80847TestJSImplInterface::Overload5(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80848{
80849 return mImpl->Overload5(arg, aRv, aRealm);
80850}
80851
80852void
80853TestJSImplInterface::Overload5(MyTestEnum arg, ErrorResult& aRv, JS::Realm* aRealm)
80854{
80855 return mImpl->Overload5(arg, aRv, aRealm);
80856}
80857
80858void
80859TestJSImplInterface::Overload6(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80860{
80861 return mImpl->Overload6(arg, aRv, aRealm);
80862}
80863
80864void
80865TestJSImplInterface::Overload6(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
80866{
80867 return mImpl->Overload6(arg, aRv, aRealm);
80868}
80869
80870void
80871TestJSImplInterface::Overload7(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80872{
80873 return mImpl->Overload7(arg, aRv, aRealm);
80874}
80875
80876void
80877TestJSImplInterface::Overload7(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
80878{
80879 return mImpl->Overload7(arg, aRv, aRealm);
80880}
80881
80882void
80883TestJSImplInterface::Overload7(const nsCString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80884{
80885 return mImpl->Overload7(arg, aRv, aRealm);
80886}
80887
80888void
80889TestJSImplInterface::Overload8(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80890{
80891 return mImpl->Overload8(arg, aRv, aRealm);
80892}
80893
80894void
80895TestJSImplInterface::Overload8(TestJSImplInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80896{
80897 return mImpl->Overload8(arg, aRv, aRealm);
80898}
80899
80900void
80901TestJSImplInterface::Overload9(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80902{
80903 return mImpl->Overload9(arg, aRv, aRealm);
80904}
80905
80906void
80907TestJSImplInterface::Overload9(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80908{
80909 return mImpl->Overload9(arg, aRv, aRealm);
80910}
80911
80912void
80913TestJSImplInterface::Overload10(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80914{
80915 return mImpl->Overload10(arg, aRv, aRealm);
80916}
80917
80918void
80919TestJSImplInterface::Overload10(JS::Handle<JSObject*> arg, ErrorResult& aRv, JS::Realm* aRealm)
80920{
80921 return mImpl->Overload10(arg, aRv, aRealm);
80922}
80923
80924void
80925TestJSImplInterface::Overload11(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80926{
80927 return mImpl->Overload11(arg, aRv, aRealm);
80928}
80929
80930void
80931TestJSImplInterface::Overload11(const nsAString& arg, ErrorResult& aRv, JS::Realm* aRealm)
80932{
80933 return mImpl->Overload11(arg, aRv, aRealm);
80934}
80935
80936void
80937TestJSImplInterface::Overload12(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80938{
80939 return mImpl->Overload12(arg, aRv, aRealm);
80940}
80941
80942void
80943TestJSImplInterface::Overload12(const Nullable<bool>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80944{
80945 return mImpl->Overload12(arg, aRv, aRealm);
80946}
80947
80948void
80949TestJSImplInterface::Overload13(const Nullable<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80950{
80951 return mImpl->Overload13(arg, aRv, aRealm);
80952}
80953
80954void
80955TestJSImplInterface::Overload13(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
80956{
80957 return mImpl->Overload13(arg, aRv, aRealm);
80958}
80959
80960void
80961TestJSImplInterface::Overload14(const Optional<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80962{
80963 return mImpl->Overload14(arg, aRv, aRealm);
80964}
80965
80966void
80967TestJSImplInterface::Overload14(TestInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
80968{
80969 return mImpl->Overload14(arg, aRv, aRealm);
80970}
80971
80972void
80973TestJSImplInterface::Overload15(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80974{
80975 return mImpl->Overload15(arg, aRv, aRealm);
80976}
80977
80978void
80979TestJSImplInterface::Overload15(const Optional<NonNull<TestInterface>>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80980{
80981 return mImpl->Overload15(arg, aRv, aRealm);
80982}
80983
80984void
80985TestJSImplInterface::Overload16(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
80986{
80987 return mImpl->Overload16(arg, aRv, aRealm);
80988}
80989
80990void
80991TestJSImplInterface::Overload16(const Optional<TestInterface*>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80992{
80993 return mImpl->Overload16(arg, aRv, aRealm);
80994}
80995
80996void
80997TestJSImplInterface::Overload17(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
80998{
80999 return mImpl->Overload17(arg, aRv, aRealm);
81000}
81001
81002void
81003TestJSImplInterface::Overload17(const Record<nsString, int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81004{
81005 return mImpl->Overload17(arg, aRv, aRealm);
81006}
81007
81008void
81009TestJSImplInterface::Overload18(const Record<nsString, nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81010{
81011 return mImpl->Overload18(arg, aRv, aRealm);
81012}
81013
81014void
81015TestJSImplInterface::Overload18(const Sequence<nsString>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81016{
81017 return mImpl->Overload18(arg, aRv, aRealm);
81018}
81019
81020void
81021TestJSImplInterface::Overload19(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81022{
81023 return mImpl->Overload19(arg, aRv, aRealm);
81024}
81025
81026void
81027TestJSImplInterface::Overload19(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
81028{
81029 return mImpl->Overload19(arg, aRv, aRealm);
81030}
81031
81032void
81033TestJSImplInterface::Overload20(const Dict& arg, ErrorResult& aRv, JS::Realm* aRealm)
81034{
81035 return mImpl->Overload20(arg, aRv, aRealm);
81036}
81037
81038void
81039TestJSImplInterface::Overload20(const Sequence<int32_t>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81040{
81041 return mImpl->Overload20(arg, aRv, aRealm);
81042}
81043
81044void
81045TestJSImplInterface::PassVariadicThirdArg(const nsAString& arg1, int32_t arg2, const Sequence<OwningNonNull<TestJSImplInterface>>& arg3, ErrorResult& aRv, JS::Realm* aRealm)
81046{
81047 return mImpl->PassVariadicThirdArg(arg1, arg2, arg3, aRv, aRealm);
81048}
81049
81050bool
81051TestJSImplInterface::GetPrefable1(ErrorResult& aRv, JS::Realm* aRealm) const
81052{
81053 return mImpl->GetPrefable1(aRv, aRealm);
81054}
81055
81056bool
81057TestJSImplInterface::GetPrefable2(ErrorResult& aRv, JS::Realm* aRealm) const
81058{
81059 return mImpl->GetPrefable2(aRv, aRealm);
81060}
81061
81062bool
81063TestJSImplInterface::GetPrefable3(ErrorResult& aRv, JS::Realm* aRealm) const
81064{
81065 return mImpl->GetPrefable3(aRv, aRealm);
81066}
81067
81068bool
81069TestJSImplInterface::GetPrefable4(ErrorResult& aRv, JS::Realm* aRealm) const
81070{
81071 return mImpl->GetPrefable4(aRv, aRealm);
81072}
81073
81074bool
81075TestJSImplInterface::GetPrefable5(ErrorResult& aRv, JS::Realm* aRealm) const
81076{
81077 return mImpl->GetPrefable5(aRv, aRealm);
81078}
81079
81080bool
81081TestJSImplInterface::GetPrefable6(ErrorResult& aRv, JS::Realm* aRealm) const
81082{
81083 return mImpl->GetPrefable6(aRv, aRealm);
81084}
81085
81086bool
81087TestJSImplInterface::GetPrefable7(ErrorResult& aRv, JS::Realm* aRealm) const
81088{
81089 return mImpl->GetPrefable7(aRv, aRealm);
81090}
81091
81092bool
81093TestJSImplInterface::GetPrefable8(ErrorResult& aRv, JS::Realm* aRealm) const
81094{
81095 return mImpl->GetPrefable8(aRv, aRealm);
81096}
81097
81098bool
81099TestJSImplInterface::GetPrefable9(ErrorResult& aRv, JS::Realm* aRealm) const
81100{
81101 return mImpl->GetPrefable9(aRv, aRealm);
81102}
81103
81104void
81105TestJSImplInterface::Prefable10(ErrorResult& aRv, JS::Realm* aRealm)
81106{
81107 return mImpl->Prefable10(aRv, aRealm);
81108}
81109
81110void
81111TestJSImplInterface::Prefable11(ErrorResult& aRv, JS::Realm* aRealm)
81112{
81113 return mImpl->Prefable11(aRv, aRealm);
81114}
81115
81116bool
81117TestJSImplInterface::GetPrefable12(ErrorResult& aRv, JS::Realm* aRealm) const
81118{
81119 return mImpl->GetPrefable12(aRv, aRealm);
81120}
81121
81122void
81123TestJSImplInterface::Prefable13(ErrorResult& aRv, JS::Realm* aRealm)
81124{
81125 return mImpl->Prefable13(aRv, aRealm);
81126}
81127
81128bool
81129TestJSImplInterface::GetPrefable14(ErrorResult& aRv, JS::Realm* aRealm) const
81130{
81131 return mImpl->GetPrefable14(aRv, aRealm);
81132}
81133
81134bool
81135TestJSImplInterface::GetPrefable15(ErrorResult& aRv, JS::Realm* aRealm) const
81136{
81137 return mImpl->GetPrefable15(aRv, aRealm);
81138}
81139
81140bool
81141TestJSImplInterface::GetPrefable16(ErrorResult& aRv, JS::Realm* aRealm) const
81142{
81143 return mImpl->GetPrefable16(aRv, aRealm);
81144}
81145
81146void
81147TestJSImplInterface::Prefable17(ErrorResult& aRv, JS::Realm* aRealm)
81148{
81149 return mImpl->Prefable17(aRv, aRealm);
81150}
81151
81152void
81153TestJSImplInterface::Prefable18(ErrorResult& aRv, JS::Realm* aRealm)
81154{
81155 return mImpl->Prefable18(aRv, aRealm);
81156}
81157
81158void
81159TestJSImplInterface::Prefable19(ErrorResult& aRv, JS::Realm* aRealm)
81160{
81161 return mImpl->Prefable19(aRv, aRealm);
81162}
81163
81164void
81165TestJSImplInterface::Prefable20(ErrorResult& aRv, JS::Realm* aRealm)
81166{
81167 return mImpl->Prefable20(aRv, aRealm);
81168}
81169
81170bool
81171TestJSImplInterface::GetConditionalOnSecureContext1(ErrorResult& aRv, JS::Realm* aRealm) const
81172{
81173 return mImpl->GetConditionalOnSecureContext1(aRv, aRealm);
81174}
81175
81176bool
81177TestJSImplInterface::GetConditionalOnSecureContext2(ErrorResult& aRv, JS::Realm* aRealm) const
81178{
81179 return mImpl->GetConditionalOnSecureContext2(aRv, aRealm);
81180}
81181
81182bool
81183TestJSImplInterface::GetConditionalOnSecureContext3(ErrorResult& aRv, JS::Realm* aRealm) const
81184{
81185 return mImpl->GetConditionalOnSecureContext3(aRv, aRealm);
81186}
81187
81188bool
81189TestJSImplInterface::GetConditionalOnSecureContext4(ErrorResult& aRv, JS::Realm* aRealm) const
81190{
81191 return mImpl->GetConditionalOnSecureContext4(aRv, aRealm);
81192}
81193
81194void
81195TestJSImplInterface::ConditionalOnSecureContext5(ErrorResult& aRv, JS::Realm* aRealm)
81196{
81197 return mImpl->ConditionalOnSecureContext5(aRv, aRealm);
81198}
81199
81200void
81201TestJSImplInterface::ConditionalOnSecureContext6(ErrorResult& aRv, JS::Realm* aRealm)
81202{
81203 return mImpl->ConditionalOnSecureContext6(aRv, aRealm);
81204}
81205
81206void
81207TestJSImplInterface::ConditionalOnSecureContext7(ErrorResult& aRv, JS::Realm* aRealm)
81208{
81209 return mImpl->ConditionalOnSecureContext7(aRv, aRealm);
81210}
81211
81212void
81213TestJSImplInterface::ConditionalOnSecureContext8(ErrorResult& aRv, JS::Realm* aRealm)
81214{
81215 return mImpl->ConditionalOnSecureContext8(aRv, aRealm);
81216}
81217
81218int32_t
81219TestJSImplInterface::GetAttrWithLenientThis(ErrorResult& aRv, JS::Realm* aRealm) const
81220{
81221 return mImpl->GetAttrWithLenientThis(aRv, aRealm);
81222}
81223
81224void
81225TestJSImplInterface::SetAttrWithLenientThis(int32_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81226{
81227 mImpl->SetAttrWithLenientThis(arg, aRv, aRealm);
81228}
81229
81230void
81231TestJSImplInterface::PassRenamedInterface(nsRenamedInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81232{
81233 return mImpl->PassRenamedInterface(arg, aRv, aRealm);
81234}
81235
81236// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81237already_AddRefed<TestJSImplInterface>
81238TestJSImplInterface::GetPutForwardsAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81239{
81240 return mImpl->GetPutForwardsAttr(aRv, aRealm);
81241}
81242
81243// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81244already_AddRefed<TestJSImplInterface>
81245TestJSImplInterface::GetPutForwardsAttr2(ErrorResult& aRv, JS::Realm* aRealm) const
81246{
81247 return mImpl->GetPutForwardsAttr2(aRv, aRealm);
81248}
81249
81250// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81251already_AddRefed<TestJSImplInterface>
81252TestJSImplInterface::GetPutForwardsAttr3(ErrorResult& aRv, JS::Realm* aRealm) const
81253{
81254 return mImpl->GetPutForwardsAttr3(aRv, aRealm);
81255}
81256
81257void
81258TestJSImplInterface::ThrowingMethod(ErrorResult& aRv, JS::Realm* aRealm)
81259{
81260 return mImpl->ThrowingMethod(aRv, aRealm);
81261}
81262
81263bool
81264TestJSImplInterface::GetThrowingAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81265{
81266 return mImpl->GetThrowingAttr(aRv, aRealm);
81267}
81268
81269void
81270TestJSImplInterface::SetThrowingAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81271{
81272 mImpl->SetThrowingAttr(arg, aRv, aRealm);
81273}
81274
81275bool
81276TestJSImplInterface::GetThrowingGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81277{
81278 return mImpl->GetThrowingGetterAttr(aRv, aRealm);
81279}
81280
81281void
81282TestJSImplInterface::SetThrowingGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81283{
81284 mImpl->SetThrowingGetterAttr(arg, aRv, aRealm);
81285}
81286
81287bool
81288TestJSImplInterface::GetThrowingSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81289{
81290 return mImpl->GetThrowingSetterAttr(aRv, aRealm);
81291}
81292
81293void
81294TestJSImplInterface::SetThrowingSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81295{
81296 mImpl->SetThrowingSetterAttr(arg, aRv, aRealm);
81297}
81298
81299void
81300TestJSImplInterface::CanOOMMethod(ErrorResult& aRv, JS::Realm* aRealm)
81301{
81302 return mImpl->CanOOMMethod(aRv, aRealm);
81303}
81304
81305bool
81306TestJSImplInterface::GetCanOOMAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81307{
81308 return mImpl->GetCanOOMAttr(aRv, aRealm);
81309}
81310
81311void
81312TestJSImplInterface::SetCanOOMAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81313{
81314 mImpl->SetCanOOMAttr(arg, aRv, aRealm);
81315}
81316
81317bool
81318TestJSImplInterface::GetCanOOMGetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81319{
81320 return mImpl->GetCanOOMGetterAttr(aRv, aRealm);
81321}
81322
81323void
81324TestJSImplInterface::SetCanOOMGetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81325{
81326 mImpl->SetCanOOMGetterAttr(arg, aRv, aRealm);
81327}
81328
81329bool
81330TestJSImplInterface::GetCanOOMSetterAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81331{
81332 return mImpl->GetCanOOMSetterAttr(aRv, aRealm);
81333}
81334
81335void
81336TestJSImplInterface::SetCanOOMSetterAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81337{
81338 mImpl->SetCanOOMSetterAttr(arg, aRv, aRealm);
81339}
81340
81341void
81342TestJSImplInterface::CeReactionsMethod(ErrorResult& aRv, JS::Realm* aRealm)
81343{
81344 return mImpl->CeReactionsMethod(aRv, aRealm);
81345}
81346
81347void
81348TestJSImplInterface::CeReactionsMethodOverload(ErrorResult& aRv, JS::Realm* aRealm)
81349{
81350 return mImpl->CeReactionsMethodOverload(aRv, aRealm);
81351}
81352
81353void
81354TestJSImplInterface::CeReactionsMethodOverload(const nsAString& bar, ErrorResult& aRv, JS::Realm* aRealm)
81355{
81356 return mImpl->CeReactionsMethodOverload(bar, aRv, aRealm);
81357}
81358
81359bool
81360TestJSImplInterface::GetCeReactionsAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81361{
81362 return mImpl->GetCeReactionsAttr(aRv, aRealm);
81363}
81364
81365void
81366TestJSImplInterface::SetCeReactionsAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81367{
81368 mImpl->SetCeReactionsAttr(arg, aRv, aRealm);
81369}
81370
81371void
81372TestJSImplInterface::PassArgsWithDefaults(const Optional<int32_t>& arg1, TestInterface* arg2, const Dict& arg3, double arg4, const Optional<float>& arg5, ErrorResult& aRv, JS::Realm* aRealm)
81373{
81374 return mImpl->PassArgsWithDefaults(arg1, arg2, arg3, arg4, arg5, aRv, aRealm);
81375}
81376
81377void
81378TestJSImplInterface::GetToJSONShouldSkipThis(JS::MutableHandle<JS::Value> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81379{
81380 return mImpl->GetToJSONShouldSkipThis(aRetVal, aRv, aRealm);
81381}
81382
81383void
81384TestJSImplInterface::SetToJSONShouldSkipThis(JS::Handle<JS::Value> arg, ErrorResult& aRv, JS::Realm* aRealm)
81385{
81386 mImpl->SetToJSONShouldSkipThis(arg, aRv, aRealm);
81387}
81388
81389// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81390already_AddRefed<TestParentInterface>
81391TestJSImplInterface::GetToJSONShouldSkipThis2(ErrorResult& aRv, JS::Realm* aRealm) const
81392{
81393 return mImpl->GetToJSONShouldSkipThis2(aRv, aRealm);
81394}
81395
81396void
81397TestJSImplInterface::SetToJSONShouldSkipThis2(TestParentInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81398{
81399 mImpl->SetToJSONShouldSkipThis2(arg, aRv, aRealm);
81400}
81401
81402// Return a raw pointer here to avoid refcounting, but make sure it's safe (the object should be kept alive by the callee).
81403already_AddRefed<TestCallbackInterface>
81404TestJSImplInterface::GetToJSONShouldSkipThis3(ErrorResult& aRv, JS::Realm* aRealm) const
81405{
81406 return mImpl->GetToJSONShouldSkipThis3(aRv, aRealm);
81407}
81408
81409void
81410TestJSImplInterface::SetToJSONShouldSkipThis3(TestCallbackInterface& arg, ErrorResult& aRv, JS::Realm* aRealm)
81411{
81412 mImpl->SetToJSONShouldSkipThis3(arg, aRv, aRealm);
81413}
81414
81415void
81416TestJSImplInterface::ToJSON(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm)
81417{
81418 return mImpl->ToJSON(aRetVal, aRv, aRealm);
81419}
81420
81421int8_t
81422TestJSImplInterface::GetDashed_attribute(ErrorResult& aRv, JS::Realm* aRealm) const
81423{
81424 return mImpl->GetDashed_attribute(aRv, aRealm);
81425}
81426
81427void
81428TestJSImplInterface::SetDashed_attribute(int8_t arg, ErrorResult& aRv, JS::Realm* aRealm)
81429{
81430 mImpl->SetDashed_attribute(arg, aRv, aRealm);
81431}
81432
81433void
81434TestJSImplInterface::Dashed_method(ErrorResult& aRv, JS::Realm* aRealm)
81435{
81436 return mImpl->Dashed_method(aRv, aRealm);
81437}
81438
81439bool
81440TestJSImplInterface::GetNonEnumerableAttr(ErrorResult& aRv, JS::Realm* aRealm) const
81441{
81442 return mImpl->GetNonEnumerableAttr(aRv, aRealm);
81443}
81444
81445void
81446TestJSImplInterface::SetNonEnumerableAttr(bool arg, ErrorResult& aRv, JS::Realm* aRealm)
81447{
81448 mImpl->SetNonEnumerableAttr(arg, aRv, aRealm);
81449}
81450
81451void
81452TestJSImplInterface::NonEnumerableMethod(ErrorResult& aRv, JS::Realm* aRealm)
81453{
81454 return mImpl->NonEnumerableMethod(aRv, aRealm);
81455}
81456
81457void
81458TestJSImplInterface::GetAllowSharedArrayBufferViewTypedef(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81459{
81460 return mImpl->GetAllowSharedArrayBufferViewTypedef(aRetVal, aRv, aRealm);
81461}
81462
81463void
81464TestJSImplInterface::SetAllowSharedArrayBufferViewTypedef(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
81465{
81466 mImpl->SetAllowSharedArrayBufferViewTypedef(arg, aRv, aRealm);
81467}
81468
81469void
81470TestJSImplInterface::GetAllowSharedArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81471{
81472 return mImpl->GetAllowSharedArrayBufferView(aRetVal, aRv, aRealm);
81473}
81474
81475void
81476TestJSImplInterface::SetAllowSharedArrayBufferView(const ArrayBufferView& arg, ErrorResult& aRv, JS::Realm* aRealm)
81477{
81478 mImpl->SetAllowSharedArrayBufferView(arg, aRv, aRealm);
81479}
81480
81481void
81482TestJSImplInterface::GetAllowSharedNullableArrayBufferView(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81483{
81484 return mImpl->GetAllowSharedNullableArrayBufferView(aRetVal, aRv, aRealm);
81485}
81486
81487void
81488TestJSImplInterface::SetAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81489{
81490 mImpl->SetAllowSharedNullableArrayBufferView(arg, aRv, aRealm);
81491}
81492
81493void
81494TestJSImplInterface::GetAllowSharedArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81495{
81496 return mImpl->GetAllowSharedArrayBuffer(aRetVal, aRv, aRealm);
81497}
81498
81499void
81500TestJSImplInterface::SetAllowSharedArrayBuffer(const ArrayBuffer& arg, ErrorResult& aRv, JS::Realm* aRealm)
81501{
81502 mImpl->SetAllowSharedArrayBuffer(arg, aRv, aRealm);
81503}
81504
81505void
81506TestJSImplInterface::GetAllowSharedNullableArrayBuffer(JS::MutableHandle<JSObject*> aRetVal, ErrorResult& aRv, JS::Realm* aRealm) const
81507{
81508 return mImpl->GetAllowSharedNullableArrayBuffer(aRetVal, aRv, aRealm);
81509}
81510
81511void
81512TestJSImplInterface::SetAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& arg, ErrorResult& aRv, JS::Realm* aRealm)
81513{
81514 mImpl->SetAllowSharedNullableArrayBuffer(arg, aRv, aRealm);
81515}
81516
81517void
81518TestJSImplInterface::PassAllowSharedArrayBufferViewTypedef(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
81519{
81520 return mImpl->PassAllowSharedArrayBufferViewTypedef(foo, aRv, aRealm);
81521}
81522
81523void
81524TestJSImplInterface::PassAllowSharedArrayBufferView(const ArrayBufferView& foo, ErrorResult& aRv, JS::Realm* aRealm)
81525{
81526 return mImpl->PassAllowSharedArrayBufferView(foo, aRv, aRealm);
81527}
81528
81529void
81530TestJSImplInterface::PassAllowSharedNullableArrayBufferView(const Nullable<ArrayBufferView>& foo, ErrorResult& aRv, JS::Realm* aRealm)
81531{
81532 return mImpl->PassAllowSharedNullableArrayBufferView(foo, aRv, aRealm);
81533}
81534
81535void
81536TestJSImplInterface::PassAllowSharedArrayBuffer(const ArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81537{
81538 return mImpl->PassAllowSharedArrayBuffer(foo, aRv, aRealm);
81539}
81540
81541void
81542TestJSImplInterface::PassAllowSharedNullableArrayBuffer(const Nullable<ArrayBuffer>& foo, ErrorResult& aRv, JS::Realm* aRealm)
81543{
81544 return mImpl->PassAllowSharedNullableArrayBuffer(foo, aRv, aRealm);
81545}
81546
81547void
81548TestJSImplInterface::PassUnionArrayBuffer(const StringOrArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81549{
81550 return mImpl->PassUnionArrayBuffer(foo, aRv, aRealm);
81551}
81552
81553void
81554TestJSImplInterface::PassUnionAllowSharedArrayBuffer(const StringOrMaybeSharedArrayBuffer& foo, ErrorResult& aRv, JS::Realm* aRealm)
81555{
81556 return mImpl->PassUnionAllowSharedArrayBuffer(foo, aRv, aRealm);
81557}
81558
81559bool
81560TestJSImplInterface::_Create(JSContext* cx, unsigned argc, JS::Value* vp)
81561{
81562 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
81563 if (!args.requireAtLeast(cx, "TestJSImplInterface._create", 2)) {
81564 return false;
81565 }
81566 BindingCallContext callCx(cx, "TestJSImplInterface._create");
81567 if (!args[0].isObject()) {
81568 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
81569 }
81570 if (!args[1].isObject()) {
81571 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
81572 }
81573
81574 // GlobalObject will go through wrappers as needed for us, and
81575 // is simpler than the right UnwrapArg incantation.
81576 GlobalObject global(cx, &args[0].toObject());
81577 if (global.Failed()) {
81578 return false;
81579 }
81580 nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports());
81581 MOZ_ASSERT(globalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(globalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(globalHolder))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("globalHolder", "../TestJSImplGenBinding.cpp"
, 81581); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder"
")"); do { *((volatile int*)__null) = 81581; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81582 JS::Rooted<JSObject*> arg(cx, &args[1].toObject());
81583 JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx));
81584 RefPtr<TestJSImplInterface> impl = new TestJSImplInterface(arg, argGlobal, globalHolder);
81585 MOZ_ASSERT(js::IsObjectInContextCompartment(arg, cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(js::IsObjectInContextCompartment(arg, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(js::IsObjectInContextCompartment(arg, cx)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("js::IsObjectInContextCompartment(arg, cx)"
, "../TestJSImplGenBinding.cpp", 81585); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)"
")"); do { *((volatile int*)__null) = 81585; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81586 return GetOrCreateDOMReflector(cx, impl, args.rval());
81587}
81588
81589
81590NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_CLASS(TestJSImplNoInterfaceObject)static_assert(std::is_base_of<nsWrapperCache, TestJSImplNoInterfaceObject
>::value, "Class should inherit nsWrapperCache"); TestJSImplNoInterfaceObject
::cycleCollection TestJSImplNoInterfaceObject::_cycleCollectorGlobal
( nsCycleCollectionParticipant::FlagMaybeSingleZoneJSHolder);
void TestJSImplNoInterfaceObject::cycleCollection::Trace( void
* p, const TraceCallbacks& aCallbacks, void* aClosure) { TestJSImplNoInterfaceObject
* tmp = DowncastCCParticipant<TestJSImplNoInterfaceObject>
(p); TraceWrapper(p, aCallbacks, aClosure); (void)tmp; } void
TestJSImplNoInterfaceObject::cycleCollection::TraceWrapper( void
* p, const TraceCallbacks& aCallbacks, void* aClosure) { TestJSImplNoInterfaceObject
* tmp = DowncastCCParticipant<TestJSImplNoInterfaceObject>
(p); tmp->TraceWrapper(aCallbacks, aClosure); }
81591NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(TestJSImplNoInterfaceObject)void TestJSImplNoInterfaceObject::cycleCollection::Unlink(void
* p) { TestJSImplNoInterfaceObject* tmp = DowncastCCParticipant
<TestJSImplNoInterfaceObject>(p);
81592 NS_IMPL_CYCLE_COLLECTION_UNLINK(mImpl)ImplCycleCollectionUnlink(tmp->mImpl);
81593 NS_IMPL_CYCLE_COLLECTION_UNLINK(mParent)ImplCycleCollectionUnlink(tmp->mParent);
81594 NS_IMPL_CYCLE_COLLECTION_UNLINK_PRESERVED_WRAPPERtmp->ReleaseWrapper(p);
81595 tmp->ClearWeakReferences();
81596NS_IMPL_CYCLE_COLLECTION_UNLINK_END(void)tmp; }
81597NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(TestJSImplNoInterfaceObject)nsresult TestJSImplNoInterfaceObject::cycleCollection::TraverseNative
( void* p, nsCycleCollectionTraversalCallback& cb) { TestJSImplNoInterfaceObject
* tmp = DowncastCCParticipant<TestJSImplNoInterfaceObject>
(p); cb.DescribeRefCountedNode(tmp->mRefCnt.get(), "TestJSImplNoInterfaceObject"
);
81598 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mImpl)ImplCycleCollectionTraverse(cb, tmp->mImpl, "mImpl", 0);
81599 NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mParent)ImplCycleCollectionTraverse(cb, tmp->mParent, "mParent", 0
);
81600NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END(void)tmp; return NS_OK; }
81601NS_IMPL_CYCLE_COLLECTING_ADDREF(TestJSImplNoInterfaceObject)MozExternalRefCountType TestJSImplNoInterfaceObject::AddRef(void
) { static_assert(!std::is_destructible_v<TestJSImplNoInterfaceObject
>, "Reference-counted class " "TestJSImplNoInterfaceObject"
" should not have a public destructor. " "Make this class's destructor non-public"
); do { static_assert( mozilla::detail::AssertionConditionType
<decltype(int32_t(mRefCnt) >= 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(int32_t(mRefCnt) >= 0))),
0))) { do { } while (false); MOZ_ReportAssertionFailure("int32_t(mRefCnt) >= 0"
" (" "illegal refcnt" ")", "../TestJSImplGenBinding.cpp", 81601
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) >= 0"
") (" "illegal refcnt" ")"); do { *((volatile int*)__null) =
81601; __attribute__((nomerge)) ::abort(); } while (false); }
} while (false); _mOwningThread.AssertOwnership("TestJSImplNoInterfaceObject"
" not thread-safe"); nsISupports* base = TestJSImplNoInterfaceObject
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.incr
(base); NS_LogAddRef((this), (count), ("TestJSImplNoInterfaceObject"
), (uint32_t)(sizeof(*this))); return count; }
81602NS_IMPL_CYCLE_COLLECTING_RELEASE(TestJSImplNoInterfaceObject)MozExternalRefCountType TestJSImplNoInterfaceObject::Release(
void) { do { static_assert( mozilla::detail::AssertionConditionType
<decltype(int32_t(mRefCnt) > 0)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(int32_t(mRefCnt) > 0))), 0
))) { do { } while (false); MOZ_ReportAssertionFailure("int32_t(mRefCnt) > 0"
" (" "dup release" ")", "../TestJSImplGenBinding.cpp", 81602
); AnnotateMozCrashReason("MOZ_ASSERT" "(" "int32_t(mRefCnt) > 0"
") (" "dup release" ")"); do { *((volatile int*)__null) = 81602
; __attribute__((nomerge)) ::abort(); } while (false); } } while
(false); _mOwningThread.AssertOwnership("TestJSImplNoInterfaceObject"
" not thread-safe"); nsISupports* base = TestJSImplNoInterfaceObject
::cycleCollection::Upcast(this); nsrefcnt count = mRefCnt.decr
(base); NS_LogRelease((this), (count), ("TestJSImplNoInterfaceObject"
)); return count; } void TestJSImplNoInterfaceObject::DeleteCycleCollectable
(void) { delete (this); }
81603NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(TestJSImplNoInterfaceObject)nsresult TestJSImplNoInterfaceObject::QueryInterface(const nsIID
& aIID, void** aInstancePtr) { do { if (!(aInstancePtr)) {
NS_DebugBreak(NS_DEBUG_ASSERTION, "QueryInterface requires a non-NULL destination!"
, "aInstancePtr", "../TestJSImplGenBinding.cpp", 81603); MOZ_PretendNoReturn
(); } } while (0); nsISupports* foundInterface; if (TopThreeWordsEquals
( aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant
, void>::kIID), (nsCycleCollectionISupports::COMTypeInfo<
nsCycleCollectionISupports, void>::kIID)) && (LowWordEquals
(aIID, (nsXPCOMCycleCollectionParticipant::COMTypeInfo<nsXPCOMCycleCollectionParticipant
, void>::kIID)) || LowWordEquals(aIID, (nsCycleCollectionISupports
::COMTypeInfo<nsCycleCollectionISupports, void>::kIID))
)) { if (LowWordEquals(aIID, (nsXPCOMCycleCollectionParticipant
::COMTypeInfo<nsXPCOMCycleCollectionParticipant, void>::
kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject::cycleCollection
::GetParticipant(); return NS_OK; } if (LowWordEquals(aIID, (
nsCycleCollectionISupports::COMTypeInfo<nsCycleCollectionISupports
, void>::kIID))) { *aInstancePtr = TestJSImplNoInterfaceObject
::cycleCollection::Upcast(this); return NS_OK; } foundInterface
= nullptr; } else
81604 NS_WRAPPERCACHE_INTERFACE_MAP_ENTRYif (aIID.Equals((nsWrapperCache::COMTypeInfo<nsWrapperCache
, void>::kIID))) { *aInstancePtr = static_cast<nsWrapperCache
*>(this); return NS_OK; } else
81605 NS_INTERFACE_MAP_ENTRY(nsISupports)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupports>)) foundInterface = static_cast
<nsISupports*>(this); else
81606 NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)if (aIID.Equals(mozilla::detail::kImplementedIID<std::remove_reference_t
<decltype(*this)>, nsISupportsWeakReference>)) foundInterface
= static_cast<nsISupportsWeakReference*>(this); else
81607NS_INTERFACE_MAP_ENDfoundInterface = 0; nsresult status; if (!foundInterface) { do
{ static_assert( mozilla::detail::AssertionConditionType<
decltype(!aIID.Equals((nsISupports::COMTypeInfo<nsISupports
, void>::kIID)))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(!aIID.Equals((nsISupports::COMTypeInfo
<nsISupports, void>::kIID))))), 0))) { do { } while (false
); MOZ_ReportAssertionFailure("!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))"
, "../TestJSImplGenBinding.cpp", 81607); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "!aIID.Equals((nsISupports::COMTypeInfo<nsISupports, void>::kIID))"
")"); do { *((volatile int*)__null) = 81607; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false); status
= NS_NOINTERFACE; } else { (foundInterface)->AddRef(); status
= NS_OK; } *aInstancePtr = foundInterface; return status; }
81608
81609TestJSImplNoInterfaceObject::TestJSImplNoInterfaceObject(JS::Handle<JSObject*> aJSImplObject, JS::Handle<JSObject*> aJSImplGlobal, nsIGlobalObject* aParent)
81610 : mImpl(new TestJSImplNoInterfaceObjectJSImpl(nullptr, aJSImplObject, aJSImplGlobal, /* aIncumbentGlobal = */ nullptr)),
81611 mParent(aParent)
81612{
81613}
81614
81615
81616TestJSImplNoInterfaceObject::~TestJSImplNoInterfaceObject()
81617{
81618}
81619
81620nsISupports*
81621TestJSImplNoInterfaceObject::GetParentObject() const
81622{
81623 return mParent;
81624}
81625
81626JSObject*
81627TestJSImplNoInterfaceObject::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
81628{
81629 JS::Rooted<JSObject*> obj(aCx, TestJSImplNoInterfaceObject_Binding::Wrap(aCx, this, aGivenProto));
81630 if (!obj) {
81631 return nullptr;
81632 }
81633
81634 // Now define it on our chrome object
81635 JSAutoRealm ar(aCx, mImpl->CallbackGlobalOrNull());
81636 if (!JS_WrapObject(aCx, &obj)) {
81637 return nullptr;
81638 }
81639 JS::Rooted<JSObject*> callback(aCx, mImpl->CallbackOrNull());
81640 if (!JS_DefineProperty(aCx, callback, "__DOM_IMPL__", obj, 0)) {
81641 return nullptr;
81642 }
81643 return obj;
81644}
81645
81646bool
81647TestJSImplNoInterfaceObject::_Create(JSContext* cx, unsigned argc, JS::Value* vp)
81648{
81649 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
81650 if (!args.requireAtLeast(cx, "TestJSImplNoInterfaceObject._create", 2)) {
81651 return false;
81652 }
81653 BindingCallContext callCx(cx, "TestJSImplNoInterfaceObject._create");
81654 if (!args[0].isObject()) {
81655 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 1");
81656 }
81657 if (!args[1].isObject()) {
81658 return callCx.ThrowErrorMessage<MSG_NOT_OBJECT>("Argument 2");
81659 }
81660
81661 // GlobalObject will go through wrappers as needed for us, and
81662 // is simpler than the right UnwrapArg incantation.
81663 GlobalObject global(cx, &args[0].toObject());
81664 if (global.Failed()) {
81665 return false;
81666 }
81667 nsCOMPtr<nsIGlobalObject> globalHolder = do_QueryInterface(global.GetAsSupports());
81668 MOZ_ASSERT(globalHolder)do { static_assert( mozilla::detail::AssertionConditionType<
decltype(globalHolder)>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(globalHolder))), 0))) { do {
} while (false); MOZ_ReportAssertionFailure("globalHolder", "../TestJSImplGenBinding.cpp"
, 81668); AnnotateMozCrashReason("MOZ_ASSERT" "(" "globalHolder"
")"); do { *((volatile int*)__null) = 81668; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81669 JS::Rooted<JSObject*> arg(cx, &args[1].toObject());
81670 JS::Rooted<JSObject*> argGlobal(cx, JS::CurrentGlobalOrNull(cx));
81671 RefPtr<TestJSImplNoInterfaceObject> impl = new TestJSImplNoInterfaceObject(arg, argGlobal, globalHolder);
81672 MOZ_ASSERT(js::IsObjectInContextCompartment(arg, cx))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(js::IsObjectInContextCompartment(arg, cx))>::isValid
, "invalid assertion condition"); if ((__builtin_expect(!!(!(
!!(js::IsObjectInContextCompartment(arg, cx)))), 0))) { do { }
while (false); MOZ_ReportAssertionFailure("js::IsObjectInContextCompartment(arg, cx)"
, "../TestJSImplGenBinding.cpp", 81672); AnnotateMozCrashReason
("MOZ_ASSERT" "(" "js::IsObjectInContextCompartment(arg, cx)"
")"); do { *((volatile int*)__null) = 81672; __attribute__((
nomerge)) ::abort(); } while (false); } } while (false)
;
81673 return GetOrCreateDOMReflector(cx, impl, args.rval());
81674}
81675
81676
81677} // namespace dom
81678
81679
81680} // namespace mozilla

/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h

1/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3/* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
5 * You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7/**
8 * Conversions from jsval to primitive values
9 */
10
11#ifndef mozilla_dom_PrimitiveConversions_h
12#define mozilla_dom_PrimitiveConversions_h
13
14#include <limits>
15#include <math.h>
16#include <stdint.h>
17
18#include "js/Conversions.h"
19#include "js/RootingAPI.h"
20#include "mozilla/Assertions.h"
21#include "mozilla/FloatingPoint.h"
22#include "mozilla/dom/BindingCallContext.h"
23
24namespace mozilla::dom {
25
26template <typename T>
27struct TypeName {};
28
29template <>
30struct TypeName<int8_t> {
31 static const char* value() { return "byte"; }
32};
33template <>
34struct TypeName<uint8_t> {
35 static const char* value() { return "octet"; }
36};
37template <>
38struct TypeName<int16_t> {
39 static const char* value() { return "short"; }
40};
41template <>
42struct TypeName<uint16_t> {
43 static const char* value() { return "unsigned short"; }
44};
45template <>
46struct TypeName<int32_t> {
47 static const char* value() { return "long"; }
48};
49template <>
50struct TypeName<uint32_t> {
51 static const char* value() { return "unsigned long"; }
52};
53template <>
54struct TypeName<int64_t> {
55 static const char* value() { return "long long"; }
56};
57template <>
58struct TypeName<uint64_t> {
59 static const char* value() { return "unsigned long long"; }
60};
61
62enum ConversionBehavior { eDefault, eEnforceRange, eClamp };
63
64template <typename T, ConversionBehavior B>
65struct PrimitiveConversionTraits {};
66
67template <typename T>
68struct DisallowedConversion {
69 typedef int jstype;
70 typedef int intermediateType;
71
72 private:
73 static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v,
74 const char* sourceDescription, jstype* retval) {
75 MOZ_CRASH("This should never be instantiated!")do { do { } while (false); MOZ_ReportCrash("" "This should never be instantiated!"
, "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h"
, 75); AnnotateMozCrashReason("MOZ_CRASH(" "This should never be instantiated!"
")"); do { *((volatile int*)__null) = 75; __attribute__((nomerge
)) ::abort(); } while (false); } while (false)
;
76 }
77};
78
79struct PrimitiveConversionTraits_smallInt {
80 // The output of JS::ToInt32 is determined as follows:
81 // 1) The value is converted to a double
82 // 2) Anything that's not a finite double returns 0
83 // 3) The double is rounded towards zero to the nearest integer
84 // 4) The resulting integer is reduced mod 2^32. The output of this
85 // operation is an integer in the range [0, 2^32).
86 // 5) If the resulting number is >= 2^31, 2^32 is subtracted from it.
87 //
88 // The result of all this is a number in the range [-2^31, 2^31)
89 //
90 // WebIDL conversions for the 8-bit, 16-bit, and 32-bit integer types
91 // are defined in the same way, except that step 4 uses reduction mod
92 // 2^8 and 2^16 for the 8-bit and 16-bit types respectively, and step 5
93 // is only done for the signed types.
94 //
95 // C/C++ define integer conversion semantics to unsigned types as taking
96 // your input integer mod (1 + largest value representable in the
97 // unsigned type). Since 2^32 is zero mod 2^8, 2^16, and 2^32,
98 // converting to the unsigned int of the relevant width will correctly
99 // perform step 4; in particular, the 2^32 possibly subtracted in step 5
100 // will become 0.
101 //
102 // Once we have step 4 done, we're just going to assume 2s-complement
103 // representation and cast directly to the type we really want.
104 //
105 // So we can cast directly for all unsigned types and for int32_t; for
106 // the smaller-width signed types we need to cast through the
107 // corresponding unsigned type.
108 typedef int32_t jstype;
109 typedef int32_t intermediateType;
110 static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v,
111 const char* sourceDescription, jstype* retval) {
112 return JS::ToInt32(cx, v, retval);
113 }
114};
115template <>
116struct PrimitiveConversionTraits<int8_t, eDefault>
117 : PrimitiveConversionTraits_smallInt {
118 typedef uint8_t intermediateType;
119};
120template <>
121struct PrimitiveConversionTraits<uint8_t, eDefault>
122 : PrimitiveConversionTraits_smallInt {};
123template <>
124struct PrimitiveConversionTraits<int16_t, eDefault>
125 : PrimitiveConversionTraits_smallInt {
126 typedef uint16_t intermediateType;
127};
128template <>
129struct PrimitiveConversionTraits<uint16_t, eDefault>
130 : PrimitiveConversionTraits_smallInt {};
131template <>
132struct PrimitiveConversionTraits<int32_t, eDefault>
133 : PrimitiveConversionTraits_smallInt {};
134template <>
135struct PrimitiveConversionTraits<uint32_t, eDefault>
136 : PrimitiveConversionTraits_smallInt {};
137
138template <>
139struct PrimitiveConversionTraits<int64_t, eDefault> {
140 typedef int64_t jstype;
141 typedef int64_t intermediateType;
142 static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v,
143 const char* sourceDescription, jstype* retval) {
144 return JS::ToInt64(cx, v, retval);
145 }
146};
147
148template <>
149struct PrimitiveConversionTraits<uint64_t, eDefault> {
150 typedef uint64_t jstype;
151 typedef uint64_t intermediateType;
152 static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v,
153 const char* sourceDescription, jstype* retval) {
154 return JS::ToUint64(cx, v, retval);
155 }
156};
157
158template <typename T>
159struct PrimitiveConversionTraits_Limits {
160 static inline T min() { return std::numeric_limits<T>::min(); }
161 static inline T max() { return std::numeric_limits<T>::max(); }
162};
163
164template <>
165struct PrimitiveConversionTraits_Limits<int64_t> {
166 static inline int64_t min() { return -(1LL << 53) + 1; }
167 static inline int64_t max() { return (1LL << 53) - 1; }
168};
169
170template <>
171struct PrimitiveConversionTraits_Limits<uint64_t> {
172 static inline uint64_t min() { return 0; }
173 static inline uint64_t max() { return (1LL << 53) - 1; }
174};
175
176template <typename T, typename U,
177 bool (*Enforce)(U cx, const char* sourceDescription, const double& d,
178 T* retval)>
179struct PrimitiveConversionTraits_ToCheckedIntHelper {
180 typedef T jstype;
181 typedef T intermediateType;
182
183 static inline bool converter(U cx, JS::Handle<JS::Value> v,
184 const char* sourceDescription, jstype* retval) {
185 double intermediate;
186 if (!JS::ToNumber(cx, v, &intermediate)) {
17
Assuming the condition is false
18
Taking false branch
187 return false;
188 }
189
190 return Enforce(cx, sourceDescription, intermediate, retval);
19
Calling 'PrimitiveConversionTraits_EnforceRange<signed char>'
23
Returning from 'PrimitiveConversionTraits_EnforceRange<signed char>'
24
Returning without writing to '*retval'
191 }
192};
193
194template <typename T>
195inline bool PrimitiveConversionTraits_EnforceRange(
196 BindingCallContext& cx, const char* sourceDescription, const double& d,
197 T* retval) {
198 static_assert(std::numeric_limits<T>::is_integer,
199 "This can only be applied to integers!");
200
201 if (!std::isfinite(d)) {
20
Assuming the condition is true
21
Taking true branch
202 return cx.ThrowErrorMessage<MSG_ENFORCE_RANGE_NON_FINITE>(
22
Returning without writing to '*retval'
203 sourceDescription, TypeName<T>::value());
204 }
205
206 bool neg = (d < 0);
207 double rounded = floor(neg ? -d : d);
208 rounded = neg ? -rounded : rounded;
209 if (rounded < PrimitiveConversionTraits_Limits<T>::min() ||
210 rounded > PrimitiveConversionTraits_Limits<T>::max()) {
211 return cx.ThrowErrorMessage<MSG_ENFORCE_RANGE_OUT_OF_RANGE>(
212 sourceDescription, TypeName<T>::value());
213 }
214
215 *retval = static_cast<T>(rounded);
216 return true;
217}
218
219template <typename T>
220struct PrimitiveConversionTraits<T, eEnforceRange>
221 : public PrimitiveConversionTraits_ToCheckedIntHelper<
222 T, BindingCallContext&, PrimitiveConversionTraits_EnforceRange<T> > {
223};
224
225template <typename T>
226inline bool PrimitiveConversionTraits_Clamp(JSContext* cx,
227 const char* sourceDescription,
228 const double& d, T* retval) {
229 static_assert(std::numeric_limits<T>::is_integer,
230 "This can only be applied to integers!");
231
232 if (std::isnan(d)) {
233 *retval = 0;
234 return true;
235 }
236 if (d >= PrimitiveConversionTraits_Limits<T>::max()) {
237 *retval = PrimitiveConversionTraits_Limits<T>::max();
238 return true;
239 }
240 if (d <= PrimitiveConversionTraits_Limits<T>::min()) {
241 *retval = PrimitiveConversionTraits_Limits<T>::min();
242 return true;
243 }
244
245 MOZ_ASSERT(std::isfinite(d))do { static_assert( mozilla::detail::AssertionConditionType<
decltype(std::isfinite(d))>::isValid, "invalid assertion condition"
); if ((__builtin_expect(!!(!(!!(std::isfinite(d)))), 0))) { do
{ } while (false); MOZ_ReportAssertionFailure("std::isfinite(d)"
, "/var/lib/jenkins/workspace/firefox-scan-build/obj-x86_64-pc-linux-gnu/dist/include/mozilla/dom/PrimitiveConversions.h"
, 245); AnnotateMozCrashReason("MOZ_ASSERT" "(" "std::isfinite(d)"
")"); do { *((volatile int*)__null) = 245; __attribute__((nomerge
)) ::abort(); } while (false); } } while (false)
;
246
247 // Banker's rounding (round ties towards even).
248 // We move away from 0 by 0.5f and then truncate. That gets us the right
249 // answer for any starting value except plus or minus N.5. With a starting
250 // value of that form, we now have plus or minus N+1. If N is odd, this is
251 // the correct result. If N is even, plus or minus N is the correct result.
252 double toTruncate = (d < 0) ? d - 0.5 : d + 0.5;
253
254 T truncated = static_cast<T>(toTruncate);
255
256 if (truncated == toTruncate) {
257 /*
258 * It was a tie (since moving away from 0 by 0.5 gave us the exact integer
259 * we want). Since we rounded away from 0, we either already have an even
260 * number or we have an odd number but the number we want is one closer to
261 * 0. So just unconditionally masking out the ones bit should do the trick
262 * to get us the value we want.
263 */
264 truncated &= ~1;
265 }
266
267 *retval = truncated;
268 return true;
269}
270
271template <typename T>
272struct PrimitiveConversionTraits<T, eClamp>
273 : public PrimitiveConversionTraits_ToCheckedIntHelper<
274 T, JSContext*, PrimitiveConversionTraits_Clamp<T> > {};
275
276template <ConversionBehavior B>
277struct PrimitiveConversionTraits<bool, B> : public DisallowedConversion<bool> {
278};
279
280template <>
281struct PrimitiveConversionTraits<bool, eDefault> {
282 typedef bool jstype;
283 typedef bool intermediateType;
284 static inline bool converter(JSContext* /* unused */, JS::Handle<JS::Value> v,
285 const char* sourceDescription, jstype* retval) {
286 *retval = JS::ToBoolean(v);
287 return true;
288 }
289};
290
291template <ConversionBehavior B>
292struct PrimitiveConversionTraits<float, B>
293 : public DisallowedConversion<float> {};
294
295template <ConversionBehavior B>
296struct PrimitiveConversionTraits<double, B>
297 : public DisallowedConversion<double> {};
298
299struct PrimitiveConversionTraits_float {
300 typedef double jstype;
301 typedef double intermediateType;
302 static inline bool converter(JSContext* cx, JS::Handle<JS::Value> v,
303 const char* sourceDescription, jstype* retval) {
304 return JS::ToNumber(cx, v, retval);
305 }
306};
307
308template <>
309struct PrimitiveConversionTraits<float, eDefault>
310 : PrimitiveConversionTraits_float {};
311template <>
312struct PrimitiveConversionTraits<double, eDefault>
313 : PrimitiveConversionTraits_float {};
314
315template <typename T, ConversionBehavior B, typename U>
316bool ValueToPrimitive(U& cx, JS::Handle<JS::Value> v,
317 const char* sourceDescription, T* retval) {
318 typename PrimitiveConversionTraits<T, B>::jstype t;
15
't' declared without an initial value
319 if (!PrimitiveConversionTraits<T, B>::converter(cx, v, sourceDescription, &t))
16
Calling 'PrimitiveConversionTraits_ToCheckedIntHelper::converter'
25
Returning from 'PrimitiveConversionTraits_ToCheckedIntHelper::converter'
26
Assuming the condition is false
27
Taking false branch
320 return false;
321
322 *retval = static_cast<T>(
28
Assigned value is garbage or undefined
323 static_cast<typename PrimitiveConversionTraits<T, B>::intermediateType>(
324 t));
325 return true;
326}
327
328} // namespace mozilla::dom
329
330#endif /* mozilla_dom_PrimitiveConversions_h */